PHP 8.2.30
Preview: convert-nested-param.js Size: 828 B
//proc/thread-self/root/home/byroehnu/.trash/node_modules11/adminjs/lib/utils/param-converter/convert-nested-param.js

import { DELIMITER } from './constants.js';
import { convertParam } from './convert-param.js';
const convertNestedParam = (parentValue, subProperty) => {
  const path = subProperty.propertyPath.split(DELIMITER).slice(-1)[0];
  const {
    type = 'string'
  } = subProperty;
  let value = parentValue[path];
  if (type === 'mixed' && value) {
    const nestedSubProperties = subProperty.subProperties;
    for (const nestedSubProperty of nestedSubProperties) {
      if (subProperty.isArray) {
        value = [...value].map(element => convertNestedParam(element, nestedSubProperty));
      } else {
        value = convertNestedParam(value, nestedSubProperty);
      }
    }
  } else {
    value = convertParam(value, subProperty.type);
  }
  return {
    ...parentValue,
    [path]: value
  };
};
export { convertNestedParam };

Directory Contents

Dirs: 0 × Files: 9

Name Size Perms Modified Actions
44 B lrw-r--r-- 2026-02-28 00:31:26
Edit Download
828 B lrw-r--r-- 2026-02-28 00:31:26
Edit Download
1.88 KB lrw-r--r-- 2026-02-28 00:31:26
Edit Download
386 B lrw-r--r-- 2026-02-28 00:31:26
Edit Download
824 B lrw-r--r-- 2026-02-28 00:31:26
Edit Download
44 B lrw-r--r-- 2026-02-28 00:31:44
Edit Download
313 B lrw-r--r-- 2026-02-28 00:31:48
Edit Download
1.35 KB lrw-r--r-- 2026-02-28 00:31:48
Edit Download
819 B lrw-r--r-- 2026-02-28 00:31:52
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).