Files
NapCatQQ/.pnpm-store/v3/files/1a/5b527fad754dbfafd7571cc70b72fd2f9c3d6ad820f20d70c32eabf7bd580cf8160ee43153378e1dc0e509e8d9124cda27a5d5a1268a1ad2fcc9a72f996865
T
TanTan e311ca3275
Build NapCat Artifacts / Type Check & Test (push) Waiting to run
docs: 仓库链接指向本镜像仓库
2026-11-13 09:25:58 +08:00

25 lines
802 B
Plaintext

import { MappedResult } from '../mapped/index.mjs';
import { Pick } from './pick.mjs';
import { Clone } from '../clone/value.mjs';
// prettier-ignore
function FromPropertyKey(type, key, options) {
return {
[key]: Pick(type, [key], Clone(options))
};
}
// prettier-ignore
function FromPropertyKeys(type, propertyKeys, options) {
return propertyKeys.reduce((result, leftKey) => {
return { ...result, ...FromPropertyKey(type, leftKey, options) };
}, {});
}
// prettier-ignore
function FromMappedKey(type, mappedKey, options) {
return FromPropertyKeys(type, mappedKey.keys, options);
}
// prettier-ignore
export function PickFromMappedKey(type, mappedKey, options) {
const properties = FromMappedKey(type, mappedKey, options);
return MappedResult(properties);
}