rotorise 0.1.0 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Rotorise.cjs +101 -0
- package/dist/Rotorise.cjs.map +1 -0
- package/dist/Rotorise.d.cts +78 -0
- package/dist/Rotorise.d.ts +35 -26
- package/dist/Rotorise.js +67 -68
- package/dist/Rotorise.js.map +1 -1
- package/package.json +13 -8
- package/dist/Rotorise.d.ts.map +0 -1
- package/dist/typeUtils.d.ts +0 -23
- package/dist/typeUtils.d.ts.map +0 -1
- package/dist/typeUtils.js +0 -3
- package/dist/typeUtils.js.map +0 -1
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key2 of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key2) && key2 !== except)
|
|
14
|
+
__defProp(to, key2, { get: () => from[key2], enumerable: !(desc = __getOwnPropDesc(from, key2)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/Rotorise.ts
|
|
21
|
+
var Rotorise_exports = {};
|
|
22
|
+
__export(Rotorise_exports, {
|
|
23
|
+
tableEntry: () => tableEntry
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(Rotorise_exports);
|
|
26
|
+
var chainableNoOpProxy = new Proxy(() => chainableNoOpProxy, {
|
|
27
|
+
get: () => chainableNoOpProxy
|
|
28
|
+
});
|
|
29
|
+
var createPathProxy = (path = "") => {
|
|
30
|
+
return new Proxy(() => {
|
|
31
|
+
}, {
|
|
32
|
+
get: (target, prop, receiver) => {
|
|
33
|
+
if (typeof prop === "string") {
|
|
34
|
+
if (prop === "toString") {
|
|
35
|
+
return () => path;
|
|
36
|
+
}
|
|
37
|
+
return createPathProxy(
|
|
38
|
+
path === "" ? prop : !Number.isNaN(Number.parseInt(prop)) ? `${path}[${prop}]` : `${path}.${prop}`
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
};
|
|
44
|
+
var key = () => (schema, separator = "#") => (key2, attributes, config) => {
|
|
45
|
+
let structure = schema[key2] ?? [];
|
|
46
|
+
if (!Array.isArray(structure)) {
|
|
47
|
+
return attributes[structure];
|
|
48
|
+
}
|
|
49
|
+
if (config?.depth !== void 0) {
|
|
50
|
+
structure = structure.slice(0, config.depth);
|
|
51
|
+
}
|
|
52
|
+
const composite = [];
|
|
53
|
+
for (const keySpec of structure) {
|
|
54
|
+
const [key3, transform] = Array.isArray(keySpec) ? keySpec : [keySpec];
|
|
55
|
+
const value = attributes[key3];
|
|
56
|
+
if (value !== void 0 && value !== null && value !== "") {
|
|
57
|
+
composite.push(key3.toString().toUpperCase());
|
|
58
|
+
composite.push(
|
|
59
|
+
`${transform ? transform(value) : value}`
|
|
60
|
+
);
|
|
61
|
+
} else if (config?.allowPartial) {
|
|
62
|
+
break;
|
|
63
|
+
} else {
|
|
64
|
+
throw new Error(
|
|
65
|
+
`buildCompositeKey: Attribute ${key3.toString()} not found in ${JSON.stringify(attributes)}`
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
return composite.join(separator);
|
|
70
|
+
};
|
|
71
|
+
var toEntry = () => (schema, separator = "#") => (item) => {
|
|
72
|
+
const entry = { ...item };
|
|
73
|
+
for (const key_ in schema) {
|
|
74
|
+
entry[key_] = key()(schema, separator)(
|
|
75
|
+
key_,
|
|
76
|
+
item
|
|
77
|
+
);
|
|
78
|
+
}
|
|
79
|
+
return entry;
|
|
80
|
+
};
|
|
81
|
+
var fromEntry = () => (schema) => (entry) => {
|
|
82
|
+
const item = { ...entry };
|
|
83
|
+
for (const key_ in schema) {
|
|
84
|
+
delete item[key_];
|
|
85
|
+
}
|
|
86
|
+
return item;
|
|
87
|
+
};
|
|
88
|
+
var tableEntry = () => (schema, separator = "#") => {
|
|
89
|
+
return {
|
|
90
|
+
toEntry: toEntry()(schema, separator),
|
|
91
|
+
fromEntry: fromEntry()(schema),
|
|
92
|
+
key: key()(schema, separator),
|
|
93
|
+
infer: chainableNoOpProxy,
|
|
94
|
+
path: () => createPathProxy()
|
|
95
|
+
};
|
|
96
|
+
};
|
|
97
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
98
|
+
0 && (module.exports = {
|
|
99
|
+
tableEntry
|
|
100
|
+
});
|
|
101
|
+
//# sourceMappingURL=Rotorise.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/Rotorise.ts"],"sourcesContent":["type KeysOfUnion<ObjectType> = ObjectType extends unknown\n ? keyof ObjectType\n : never\ntype IsEqual<T, U> = (<G>() => G extends T ? 1 : 2) extends <G>() => G extends U\n ? 1\n : 2\n ? true\n : false\n\ntype ArrayElement<T> = T extends readonly unknown[] ? T[0] : never\n\ntype ExactObject<ParameterType, InputType> = {\n [Key in keyof ParameterType]: Exact<\n ParameterType[Key],\n Key extends keyof InputType ? InputType[Key] : never\n >\n} & Record<Exclude<keyof InputType, KeysOfUnion<ParameterType>>, never>\n\ntype Exact<ParameterType, InputType> = IsEqual<\n ParameterType,\n InputType\n> extends true\n ? ParameterType\n : // Convert union of array to array of union: A[] & B[] => (A & B)[]\n ParameterType extends unknown[]\n ? Array<Exact<ArrayElement<ParameterType>, ArrayElement<InputType>>>\n : // In TypeScript, Array is a subtype of ReadonlyArray, so always test Array before ReadonlyArray.\n ParameterType extends readonly unknown[]\n ? ReadonlyArray<\n Exact<ArrayElement<ParameterType>, ArrayElement<InputType>>\n >\n : ParameterType extends object\n ? ExactObject<ParameterType, InputType>\n : ParameterType\n\ntype ValueOf<\n ObjectType,\n ValueType extends keyof ObjectType = keyof ObjectType,\n> = ObjectType[ValueType]\n\ntype evaluate<T> = T extends unknown\n ? { [K in keyof T]: T[K] } & unknown\n : never\n\ntype SliceFromStart<\n T extends unknown[],\n End extends number,\n Target extends unknown[] = [],\n> = T['length'] | End extends 0\n ? []\n : Target['length'] extends End\n ? Target\n : T extends [infer A, ...infer R]\n ? SliceFromStart<R, End, [...Target, A]>\n : never\n\ntype DistributivePick<T, K> = T extends unknown\n ? K extends keyof T\n ? Pick<T, K>\n : never\n : never\n\ntype DistributiveOmit<T, K extends keyof T> = T extends unknown\n ? Omit<T, K>\n : never\n\ntype Slices<\n rest extends unknown[],\n minLength extends number = 0,\n slice extends unknown[] = [],\n passedSkip extends 1 | 0 = slice['length'] extends minLength ? 1 : 0,\n> =\n | (passedSkip extends 1 ? slice : never)\n | (rest extends [infer h, ...infer R]\n ? Slices<\n R,\n minLength,\n [...slice, h],\n [...slice, h]['length'] extends minLength ? 1 : passedSkip\n >\n : never)\n\nexport type CompositeKeyParams<\n Entity extends Record<string, unknown>,\n Spec extends InputSpec<Entity>[],\n skip extends number = 1,\n P extends InputSpec<Entity>[] = Slices<\n Spec,\n IsLiteral<skip> extends true ? skip : 1\n >,\n> = Entity extends unknown\n ? P extends unknown\n ? evaluate<\n {\n [K in extractHeadOrPass<P[number]> & string]: Entity[K]\n } & {\n [K in extractHeadOrPass<\n Exclude<Spec[number], P[number]>\n >]?: undefined\n }\n >\n : never\n : never\ntype IsLiteral<a> = [a] extends [null | undefined]\n ? true\n : [a] extends [string]\n ? string extends a\n ? false\n : true\n : [a] extends [number]\n ? number extends a\n ? false\n : true\n : [a] extends [boolean]\n ? boolean extends a\n ? false\n : true\n : [a] extends [symbol]\n ? symbol extends a\n ? false\n : true\n : [a] extends [bigint]\n ? bigint extends a\n ? false\n : true\n : false\n\nexport type CompositeKeyBuilder<\n Entity extends Record<string, unknown>,\n Spec extends InputSpec<Entity>[],\n Delimiter extends string = '#',\n Deep extends number = Spec['length'],\n isPartial extends boolean = false,\n> = Entity extends unknown\n ? CompositeKeyBuilderImpl<\n Entity,\n IsLiteral<Deep> extends true ? SliceFromStart<Spec, Deep> : Spec\n > extends infer Values extends joinablePair[]\n ? Join<\n isPartial & IsLiteral<isPartial> extends false\n ? Values\n : Slices<Values>,\n Delimiter\n >\n : never\n : never\n\ntype joinable = string | number | bigint | boolean | null | undefined\ntype joinablePair = [joinable, joinable]\n\ntype Join<\n Pairs extends joinablePair[],\n Delimiter extends string,\n> = Pairs extends [joinablePair]\n ? `${Pairs[0][0]}${Delimiter}${Pairs[0][1]}`\n : Pairs extends [joinablePair, ...infer Tail extends joinablePair[]]\n ? `${Pairs[0][0]}${Delimiter}${Pairs[0][1]}${Delimiter}${Join<\n Tail,\n Delimiter\n >}`\n : never\n\ntype CompositeKeyBuilderImpl<\n Entity extends Record<string, unknown>,\n Spec extends InputSpec<Entity>[],\n Pairs extends joinablePair[] = [],\n> = Spec extends [infer F, ...infer R extends InputSpec<Entity>[]]\n ? F extends keyof Entity & string\n ? Entity[F] extends joinable\n ? CompositeKeyBuilderImpl<\n Entity,\n R,\n [...Pairs, [Uppercase<F>, Entity[F]]]\n >\n : never\n : F extends [keyof Entity & string, (...x: (infer _)[]) => infer Tr]\n ? Tr extends joinable\n ? CompositeKeyBuilderImpl<\n Entity,\n R,\n [...Pairs, [Uppercase<F[0]>, Tr]]\n >\n : never\n : never\n : Pairs\n\nexport type TableEntry<\n Entity extends Record<string, unknown>,\n Schema extends Record<string, FullKeySpec<Entity>>,\n Delimiter extends string = '#',\n> = Entity extends unknown\n ? Entity & {\n [K in keyof Schema]: Schema[K] extends unknown[]\n ? CompositeKeyBuilder<Entity, Schema[K], Delimiter>\n : Entity[Schema[K] & keyof Entity]\n }\n : never\n\ntype Unionize<T extends object> = {\n [k in keyof T]: { k: k; v: T[k] }\n}[keyof T]\ntype KVPair = { k: PropertyKey; v: unknown }\n\ntype InputSpec<\n Entity extends Record<string, unknown>,\n KV extends KVPair = Unionize<Entity>,\n> = evaluate<\n {\n [key in keyof Entity]:\n | [key, (key: Extract<KV, { k: key }>['v']) => unknown]\n | key\n }[keyof Entity]\n>\n\ntype extractHeadOrPass<T> = T extends unknown[] ? T[0] : T\ntype numeric = number | bigint\ntype keysWithNumericValue<\n Entity extends object,\n KVs extends KVPair = Unionize<Entity>,\n K_wNumber extends PropertyKey = Extract<KVs, { v: numeric }>['k'],\n K_woNumber extends PropertyKey = Exclude<\n KVs,\n { k: K_wNumber; v: numeric }\n >['k'],\n> = Exclude<K_wNumber, K_woNumber>\n\ntype FullKeySpec<Entity extends Record<string, unknown>> =\n | InputSpec<Entity>[]\n | (keysWithNumericValue<Entity> & keyof Entity)\n\nconst chainableNoOpProxy: unknown = new Proxy(() => chainableNoOpProxy, {\n get: () => chainableNoOpProxy,\n})\n\nconst createPathProxy = <T>(path = ''): T => {\n return new Proxy(() => {}, {\n get: (target, prop, receiver) => {\n if (typeof prop === 'string') {\n if (prop === 'toString') {\n return () => path\n }\n\n return createPathProxy(\n path === ''\n ? prop\n : !Number.isNaN(Number.parseInt(prop))\n ? `${path}[${prop}]`\n : `${path}.${prop}`,\n )\n }\n },\n }) as T\n}\n\nconst key =\n <const Entity extends Record<string, unknown>>() =>\n <\n const Schema extends Record<string, FullKeySpec<Entity>>,\n Separator extends string = '#',\n >(\n schema: Schema,\n separator: Separator = '#' as Separator,\n ) =>\n <\n const Key extends keyof Schema,\n const Config extends Schema[Key] extends unknown[]\n ? { depth?: number; allowPartial?: boolean }\n : never,\n const Attributes extends Exact<\n Schema[Key] extends keyof Entity\n ? DistributivePick<Entity, Schema[Key] & keyof Entity>\n : CompositeKeyParams<\n Entity,\n Schema[Key],\n Config['allowPartial'] extends true\n ? 1\n : Schema[Key]['length']\n >,\n Attributes\n >,\n >(\n key: Key,\n attributes: Attributes,\n config?: Config,\n ): Schema[Key] extends keyof Entity\n ? ValueOf<Attributes>\n : CompositeKeyBuilder<\n Entity & Attributes,\n Schema[Key] extends FullKeySpec<Entity & Attributes>\n ? Schema[Key]\n : never,\n Separator,\n Exclude<Config['depth'], undefined>,\n Exclude<Config['allowPartial'], undefined>\n > => {\n let structure = schema[key] ?? []\n if (!Array.isArray(structure)) {\n return attributes[structure as keyof Attributes] as never\n }\n\n if (config?.depth !== undefined) {\n structure = structure.slice(0, config.depth) as never\n }\n const composite: string[] = []\n\n for (const keySpec of structure) {\n const [key, transform] = Array.isArray(keySpec)\n ? keySpec\n : [keySpec]\n const value = attributes[key as keyof Attributes]\n if (value !== undefined && value !== null && value !== '') {\n composite.push(key.toString().toUpperCase())\n composite.push(\n `${transform ? transform(value as never) : value}`,\n )\n } else if (config?.allowPartial) {\n break\n } else {\n throw new Error(\n `buildCompositeKey: Attribute ${key.toString()} not found in ${JSON.stringify(attributes)}`,\n )\n }\n }\n\n return composite.join(separator) as never\n }\n\nconst toEntry =\n <const Entity extends Record<string, unknown>>() =>\n <\n const Schema extends Record<string, FullKeySpec<Entity>>,\n Separator extends string = '#',\n >(\n schema: Schema,\n separator: Separator = '#' as Separator,\n ) =>\n <const ExactEntity extends Exact<Entity, ExactEntity>>(\n item: ExactEntity,\n ): ExactEntity extends infer E extends Entity\n ? Schema extends Record<string, FullKeySpec<E>>\n ? TableEntry<E, Schema, Separator>\n : never\n : never => {\n const entry = { ...item }\n\n for (const key_ in schema) {\n entry[key_] = key<Entity>()(schema, separator)(\n key_,\n item as never,\n ) as never\n }\n // console.log({ entry })\n return entry as never\n }\n\nconst fromEntry =\n <const Entity extends Record<string, unknown>>() =>\n <\n const Schema extends Record<string, FullKeySpec<Entity>>,\n Separator extends string = '#',\n >(\n schema: Schema,\n ) =>\n <const Entry extends TableEntry<Entity, Schema, Separator>>(\n entry: Entry,\n ): DistributiveOmit<Entry, keyof Schema> => {\n const item = { ...entry }\n\n for (const key_ in schema) {\n delete item[key_]\n }\n // console.log({ item })\n return item as never\n }\n\ntype TableEntryDefinition<\n Entity extends Record<string, unknown>,\n Schema extends Record<string, FullKeySpec<Entity>>,\n Separator extends string = '#',\n> = {\n toEntry: <const ExactEntity extends Exact<Entity, ExactEntity>>(\n item: ExactEntity,\n ) => ExactEntity extends infer E extends Entity\n ? Schema extends Record<string, FullKeySpec<E>>\n ? TableEntry<E, Schema, Separator>\n : never\n : never\n fromEntry: <const Entry extends TableEntry<Entity, Schema, Separator>>(\n entry: Entry,\n ) => DistributiveOmit<Entry, keyof Schema>\n key: <\n const Key extends keyof Schema,\n const Config extends Schema[Key] extends unknown[]\n ? { depth?: number; allowPartial?: boolean }\n : never,\n const Attributes extends Exact<\n Schema[Key] extends keyof Entity\n ? DistributivePick<Entity, Schema[Key] & keyof Entity>\n : CompositeKeyParams<\n Entity,\n Schema[Key],\n Config['allowPartial'] extends true\n ? 1\n : Schema[Key]['length']\n >,\n Attributes\n >,\n >(\n key: Key,\n attributes: Attributes,\n config?: Config,\n ) => Schema[Key] extends keyof Entity\n ? ValueOf<Attributes>\n : CompositeKeyBuilder<\n Entity & Attributes,\n Schema[Key] extends FullKeySpec<Entity & Attributes>\n ? Schema[Key]\n : never,\n Separator,\n Exclude<Config['depth'], undefined>,\n Exclude<Config['allowPartial'], undefined>\n >\n\n infer: TableEntry<Entity, Schema, Separator>\n path: () => TableEntry<Entity, Schema, Separator>\n}\n\nexport const tableEntry =\n <const Entity extends Record<string, unknown>>() =>\n <\n const Schema extends Record<string, FullKeySpec<Entity>>,\n Separator extends string = '#',\n >(\n schema: Schema,\n separator: Separator = '#' as Separator,\n ): TableEntryDefinition<Entity, Schema, Separator> => {\n return {\n toEntry: toEntry<Entity>()(schema, separator) as never,\n fromEntry: fromEntry<Entity>()(schema),\n key: key<Entity>()(schema, separator),\n infer: chainableNoOpProxy as TableEntry<Entity, Schema, Separator>,\n path: () =>\n createPathProxy<TableEntry<Entity, Schema, Separator>>(),\n }\n }\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAsOA,IAAM,qBAA8B,IAAI,MAAM,MAAM,oBAAoB;AAAA,EACpE,KAAK,MAAM;AACf,CAAC;AAED,IAAM,kBAAkB,CAAI,OAAO,OAAU;AACzC,SAAO,IAAI,MAAM,MAAM;AAAA,EAAC,GAAG;AAAA,IACvB,KAAK,CAAC,QAAQ,MAAM,aAAa;AAC7B,UAAI,OAAO,SAAS,UAAU;AAC1B,YAAI,SAAS,YAAY;AACrB,iBAAO,MAAM;AAAA,QACjB;AAEA,eAAO;AAAA,UACH,SAAS,KACH,OACA,CAAC,OAAO,MAAM,OAAO,SAAS,IAAI,CAAC,IACjC,GAAG,IAAI,IAAI,IAAI,MACf,GAAG,IAAI,IAAI,IAAI;AAAA,QAC3B;AAAA,MACJ;AAAA,IACJ;AAAA,EACJ,CAAC;AACL;AAEA,IAAM,MACF,MACA,CAII,QACA,YAAuB,QAE3B,CAkBIA,MACA,YACA,WAWO;AACP,MAAI,YAAY,OAAOA,IAAG,KAAK,CAAC;AAChC,MAAI,CAAC,MAAM,QAAQ,SAAS,GAAG;AAC3B,WAAO,WAAW,SAA6B;AAAA,EACnD;AAEA,MAAI,QAAQ,UAAU,QAAW;AAC7B,gBAAY,UAAU,MAAM,GAAG,OAAO,KAAK;AAAA,EAC/C;AACA,QAAM,YAAsB,CAAC;AAE7B,aAAW,WAAW,WAAW;AAC7B,UAAM,CAACA,MAAK,SAAS,IAAI,MAAM,QAAQ,OAAO,IACxC,UACA,CAAC,OAAO;AACd,UAAM,QAAQ,WAAWA,IAAuB;AAChD,QAAI,UAAU,UAAa,UAAU,QAAQ,UAAU,IAAI;AACvD,gBAAU,KAAKA,KAAI,SAAS,EAAE,YAAY,CAAC;AAC3C,gBAAU;AAAA,QACN,GAAG,YAAY,UAAU,KAAc,IAAI,KAAK;AAAA,MACpD;AAAA,IACJ,WAAW,QAAQ,cAAc;AAC7B;AAAA,IACJ,OAAO;AACH,YAAM,IAAI;AAAA,QACN,gCAAgCA,KAAI,SAAS,CAAC,iBAAiB,KAAK,UAAU,UAAU,CAAC;AAAA,MAC7F;AAAA,IACJ;AAAA,EACJ;AAEA,SAAO,UAAU,KAAK,SAAS;AACnC;AAEJ,IAAM,UACF,MACA,CAII,QACA,YAAuB,QAE3B,CACI,SAKW;AACX,QAAM,QAAQ,EAAE,GAAG,KAAK;AAExB,aAAW,QAAQ,QAAQ;AACvB,UAAM,IAAI,IAAI,IAAY,EAAE,QAAQ,SAAS;AAAA,MACzC;AAAA,MACA;AAAA,IACJ;AAAA,EACJ;AAEA,SAAO;AACX;AAEJ,IAAM,YACF,MACA,CAII,WAEJ,CACI,UACwC;AACxC,QAAM,OAAO,EAAE,GAAG,MAAM;AAExB,aAAW,QAAQ,QAAQ;AACvB,WAAO,KAAK,IAAI;AAAA,EACpB;AAEA,SAAO;AACX;AAsDG,IAAM,aACT,MACA,CAII,QACA,YAAuB,QAC2B;AAClD,SAAO;AAAA,IACH,SAAS,QAAgB,EAAE,QAAQ,SAAS;AAAA,IAC5C,WAAW,UAAkB,EAAE,MAAM;AAAA,IACrC,KAAK,IAAY,EAAE,QAAQ,SAAS;AAAA,IACpC,OAAO;AAAA,IACP,MAAM,MACF,gBAAuD;AAAA,EAC/D;AACJ;","names":["key"]}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
type KeysOfUnion<ObjectType> = ObjectType extends unknown ? keyof ObjectType : never;
|
|
2
|
+
type IsEqual<T, U> = (<G>() => G extends T ? 1 : 2) extends <G>() => G extends U ? 1 : 2 ? true : false;
|
|
3
|
+
type ArrayElement<T> = T extends readonly unknown[] ? T[0] : never;
|
|
4
|
+
type ExactObject<ParameterType, InputType> = {
|
|
5
|
+
[Key in keyof ParameterType]: Exact<ParameterType[Key], Key extends keyof InputType ? InputType[Key] : never>;
|
|
6
|
+
} & Record<Exclude<keyof InputType, KeysOfUnion<ParameterType>>, never>;
|
|
7
|
+
type Exact<ParameterType, InputType> = IsEqual<ParameterType, InputType> extends true ? ParameterType : ParameterType extends unknown[] ? Array<Exact<ArrayElement<ParameterType>, ArrayElement<InputType>>> : ParameterType extends readonly unknown[] ? ReadonlyArray<Exact<ArrayElement<ParameterType>, ArrayElement<InputType>>> : ParameterType extends object ? ExactObject<ParameterType, InputType> : ParameterType;
|
|
8
|
+
type ValueOf<ObjectType, ValueType extends keyof ObjectType = keyof ObjectType> = ObjectType[ValueType];
|
|
9
|
+
type evaluate<T> = T extends unknown ? {
|
|
10
|
+
[K in keyof T]: T[K];
|
|
11
|
+
} & unknown : never;
|
|
12
|
+
type SliceFromStart<T extends unknown[], End extends number, Target extends unknown[] = []> = T['length'] | End extends 0 ? [] : Target['length'] extends End ? Target : T extends [infer A, ...infer R] ? SliceFromStart<R, End, [...Target, A]> : never;
|
|
13
|
+
type DistributivePick<T, K> = T extends unknown ? K extends keyof T ? Pick<T, K> : never : never;
|
|
14
|
+
type DistributiveOmit<T, K extends keyof T> = T extends unknown ? Omit<T, K> : never;
|
|
15
|
+
type Slices<rest extends unknown[], minLength extends number = 0, slice extends unknown[] = [], passedSkip extends 1 | 0 = slice['length'] extends minLength ? 1 : 0> = (passedSkip extends 1 ? slice : never) | (rest extends [infer h, ...infer R] ? Slices<R, minLength, [
|
|
16
|
+
...slice,
|
|
17
|
+
h
|
|
18
|
+
], [
|
|
19
|
+
...slice,
|
|
20
|
+
h
|
|
21
|
+
]['length'] extends minLength ? 1 : passedSkip> : never);
|
|
22
|
+
type CompositeKeyParams<Entity extends Record<string, unknown>, Spec extends InputSpec<Entity>[], skip extends number = 1, P extends InputSpec<Entity>[] = Slices<Spec, IsLiteral<skip> extends true ? skip : 1>> = Entity extends unknown ? P extends unknown ? evaluate<{
|
|
23
|
+
[K in extractHeadOrPass<P[number]> & string]: Entity[K];
|
|
24
|
+
} & {
|
|
25
|
+
[K in extractHeadOrPass<Exclude<Spec[number], P[number]>>]?: undefined;
|
|
26
|
+
}> : never : never;
|
|
27
|
+
type IsLiteral<a> = [a] extends [null | undefined] ? true : [a] extends [string] ? string extends a ? false : true : [a] extends [number] ? number extends a ? false : true : [a] extends [boolean] ? boolean extends a ? false : true : [a] extends [symbol] ? symbol extends a ? false : true : [a] extends [bigint] ? bigint extends a ? false : true : false;
|
|
28
|
+
type CompositeKeyBuilder<Entity extends Record<string, unknown>, Spec extends InputSpec<Entity>[], Delimiter extends string = '#', Deep extends number = Spec['length'], isPartial extends boolean = false> = Entity extends unknown ? CompositeKeyBuilderImpl<Entity, IsLiteral<Deep> extends true ? SliceFromStart<Spec, Deep> : Spec> extends infer Values extends joinablePair[] ? Join<isPartial & IsLiteral<isPartial> extends false ? Values : Slices<Values>, Delimiter> : never : never;
|
|
29
|
+
type joinable = string | number | bigint | boolean | null | undefined;
|
|
30
|
+
type joinablePair = [joinable, joinable];
|
|
31
|
+
type Join<Pairs extends joinablePair[], Delimiter extends string> = Pairs extends [joinablePair] ? `${Pairs[0][0]}${Delimiter}${Pairs[0][1]}` : Pairs extends [joinablePair, ...infer Tail extends joinablePair[]] ? `${Pairs[0][0]}${Delimiter}${Pairs[0][1]}${Delimiter}${Join<Tail, Delimiter>}` : never;
|
|
32
|
+
type CompositeKeyBuilderImpl<Entity extends Record<string, unknown>, Spec extends InputSpec<Entity>[], Pairs extends joinablePair[] = []> = Spec extends [infer F, ...infer R extends InputSpec<Entity>[]] ? F extends keyof Entity & string ? Entity[F] extends joinable ? CompositeKeyBuilderImpl<Entity, R, [
|
|
33
|
+
...Pairs,
|
|
34
|
+
[Uppercase<F>, Entity[F]]
|
|
35
|
+
]> : never : F extends [keyof Entity & string, (...x: (infer _)[]) => infer Tr] ? Tr extends joinable ? CompositeKeyBuilderImpl<Entity, R, [
|
|
36
|
+
...Pairs,
|
|
37
|
+
[Uppercase<F[0]>, Tr]
|
|
38
|
+
]> : never : never : Pairs;
|
|
39
|
+
type TableEntry<Entity extends Record<string, unknown>, Schema extends Record<string, FullKeySpec<Entity>>, Delimiter extends string = '#'> = Entity extends unknown ? Entity & {
|
|
40
|
+
[K in keyof Schema]: Schema[K] extends unknown[] ? CompositeKeyBuilder<Entity, Schema[K], Delimiter> : Entity[Schema[K] & keyof Entity];
|
|
41
|
+
} : never;
|
|
42
|
+
type Unionize<T extends object> = {
|
|
43
|
+
[k in keyof T]: {
|
|
44
|
+
k: k;
|
|
45
|
+
v: T[k];
|
|
46
|
+
};
|
|
47
|
+
}[keyof T];
|
|
48
|
+
type KVPair = {
|
|
49
|
+
k: PropertyKey;
|
|
50
|
+
v: unknown;
|
|
51
|
+
};
|
|
52
|
+
type InputSpec<Entity extends Record<string, unknown>, KV extends KVPair = Unionize<Entity>> = evaluate<{
|
|
53
|
+
[key in keyof Entity]: [key, (key: Extract<KV, {
|
|
54
|
+
k: key;
|
|
55
|
+
}>['v']) => unknown] | key;
|
|
56
|
+
}[keyof Entity]>;
|
|
57
|
+
type extractHeadOrPass<T> = T extends unknown[] ? T[0] : T;
|
|
58
|
+
type numeric = number | bigint;
|
|
59
|
+
type keysWithNumericValue<Entity extends object, KVs extends KVPair = Unionize<Entity>, K_wNumber extends PropertyKey = Extract<KVs, {
|
|
60
|
+
v: numeric;
|
|
61
|
+
}>['k'], K_woNumber extends PropertyKey = Exclude<KVs, {
|
|
62
|
+
k: K_wNumber;
|
|
63
|
+
v: numeric;
|
|
64
|
+
}>['k']> = Exclude<K_wNumber, K_woNumber>;
|
|
65
|
+
type FullKeySpec<Entity extends Record<string, unknown>> = InputSpec<Entity>[] | (keysWithNumericValue<Entity> & keyof Entity);
|
|
66
|
+
type TableEntryDefinition<Entity extends Record<string, unknown>, Schema extends Record<string, FullKeySpec<Entity>>, Separator extends string = '#'> = {
|
|
67
|
+
toEntry: <const ExactEntity extends Exact<Entity, ExactEntity>>(item: ExactEntity) => ExactEntity extends infer E extends Entity ? Schema extends Record<string, FullKeySpec<E>> ? TableEntry<E, Schema, Separator> : never : never;
|
|
68
|
+
fromEntry: <const Entry extends TableEntry<Entity, Schema, Separator>>(entry: Entry) => DistributiveOmit<Entry, keyof Schema>;
|
|
69
|
+
key: <const Key extends keyof Schema, const Config extends Schema[Key] extends unknown[] ? {
|
|
70
|
+
depth?: number;
|
|
71
|
+
allowPartial?: boolean;
|
|
72
|
+
} : never, const Attributes extends Exact<Schema[Key] extends keyof Entity ? DistributivePick<Entity, Schema[Key] & keyof Entity> : CompositeKeyParams<Entity, Schema[Key], Config['allowPartial'] extends true ? 1 : Schema[Key]['length']>, Attributes>>(key: Key, attributes: Attributes, config?: Config) => Schema[Key] extends keyof Entity ? ValueOf<Attributes> : CompositeKeyBuilder<Entity & Attributes, Schema[Key] extends FullKeySpec<Entity & Attributes> ? Schema[Key] : never, Separator, Exclude<Config['depth'], undefined>, Exclude<Config['allowPartial'], undefined>>;
|
|
73
|
+
infer: TableEntry<Entity, Schema, Separator>;
|
|
74
|
+
path: () => TableEntry<Entity, Schema, Separator>;
|
|
75
|
+
};
|
|
76
|
+
declare const tableEntry: <const Entity extends Record<string, unknown>>() => <const Schema extends Record<string, FullKeySpec<Entity>>, Separator extends string = "#">(schema: Schema, separator?: Separator) => TableEntryDefinition<Entity, Schema, Separator>;
|
|
77
|
+
|
|
78
|
+
export { type CompositeKeyBuilder, type CompositeKeyParams, type TableEntry, tableEntry };
|
package/dist/Rotorise.d.ts
CHANGED
|
@@ -1,21 +1,34 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
type KeysOfUnion<ObjectType> = ObjectType extends unknown ? keyof ObjectType : never;
|
|
2
|
+
type IsEqual<T, U> = (<G>() => G extends T ? 1 : 2) extends <G>() => G extends U ? 1 : 2 ? true : false;
|
|
3
|
+
type ArrayElement<T> = T extends readonly unknown[] ? T[0] : never;
|
|
4
|
+
type ExactObject<ParameterType, InputType> = {
|
|
5
|
+
[Key in keyof ParameterType]: Exact<ParameterType[Key], Key extends keyof InputType ? InputType[Key] : never>;
|
|
6
|
+
} & Record<Exclude<keyof InputType, KeysOfUnion<ParameterType>>, never>;
|
|
7
|
+
type Exact<ParameterType, InputType> = IsEqual<ParameterType, InputType> extends true ? ParameterType : ParameterType extends unknown[] ? Array<Exact<ArrayElement<ParameterType>, ArrayElement<InputType>>> : ParameterType extends readonly unknown[] ? ReadonlyArray<Exact<ArrayElement<ParameterType>, ArrayElement<InputType>>> : ParameterType extends object ? ExactObject<ParameterType, InputType> : ParameterType;
|
|
8
|
+
type ValueOf<ObjectType, ValueType extends keyof ObjectType = keyof ObjectType> = ObjectType[ValueType];
|
|
9
|
+
type evaluate<T> = T extends unknown ? {
|
|
10
|
+
[K in keyof T]: T[K];
|
|
11
|
+
} & unknown : never;
|
|
12
|
+
type SliceFromStart<T extends unknown[], End extends number, Target extends unknown[] = []> = T['length'] | End extends 0 ? [] : Target['length'] extends End ? Target : T extends [infer A, ...infer R] ? SliceFromStart<R, End, [...Target, A]> : never;
|
|
13
|
+
type DistributivePick<T, K> = T extends unknown ? K extends keyof T ? Pick<T, K> : never : never;
|
|
14
|
+
type DistributiveOmit<T, K extends keyof T> = T extends unknown ? Omit<T, K> : never;
|
|
15
|
+
type Slices<rest extends unknown[], minLength extends number = 0, slice extends unknown[] = [], passedSkip extends 1 | 0 = slice['length'] extends minLength ? 1 : 0> = (passedSkip extends 1 ? slice : never) | (rest extends [infer h, ...infer R] ? Slices<R, minLength, [
|
|
4
16
|
...slice,
|
|
5
17
|
h
|
|
6
18
|
], [
|
|
7
19
|
...slice,
|
|
8
20
|
h
|
|
9
21
|
]['length'] extends minLength ? 1 : passedSkip> : never);
|
|
10
|
-
|
|
22
|
+
type CompositeKeyParams<Entity extends Record<string, unknown>, Spec extends InputSpec<Entity>[], skip extends number = 1, P extends InputSpec<Entity>[] = Slices<Spec, IsLiteral<skip> extends true ? skip : 1>> = Entity extends unknown ? P extends unknown ? evaluate<{
|
|
11
23
|
[K in extractHeadOrPass<P[number]> & string]: Entity[K];
|
|
12
24
|
} & {
|
|
13
25
|
[K in extractHeadOrPass<Exclude<Spec[number], P[number]>>]?: undefined;
|
|
14
26
|
}> : never : never;
|
|
15
|
-
|
|
27
|
+
type IsLiteral<a> = [a] extends [null | undefined] ? true : [a] extends [string] ? string extends a ? false : true : [a] extends [number] ? number extends a ? false : true : [a] extends [boolean] ? boolean extends a ? false : true : [a] extends [symbol] ? symbol extends a ? false : true : [a] extends [bigint] ? bigint extends a ? false : true : false;
|
|
28
|
+
type CompositeKeyBuilder<Entity extends Record<string, unknown>, Spec extends InputSpec<Entity>[], Delimiter extends string = '#', Deep extends number = Spec['length'], isPartial extends boolean = false> = Entity extends unknown ? CompositeKeyBuilderImpl<Entity, IsLiteral<Deep> extends true ? SliceFromStart<Spec, Deep> : Spec> extends infer Values extends joinablePair[] ? Join<isPartial & IsLiteral<isPartial> extends false ? Values : Slices<Values>, Delimiter> : never : never;
|
|
16
29
|
type joinable = string | number | bigint | boolean | null | undefined;
|
|
17
30
|
type joinablePair = [joinable, joinable];
|
|
18
|
-
|
|
31
|
+
type Join<Pairs extends joinablePair[], Delimiter extends string> = Pairs extends [joinablePair] ? `${Pairs[0][0]}${Delimiter}${Pairs[0][1]}` : Pairs extends [joinablePair, ...infer Tail extends joinablePair[]] ? `${Pairs[0][0]}${Delimiter}${Pairs[0][1]}${Delimiter}${Join<Tail, Delimiter>}` : never;
|
|
19
32
|
type CompositeKeyBuilderImpl<Entity extends Record<string, unknown>, Spec extends InputSpec<Entity>[], Pairs extends joinablePair[] = []> = Spec extends [infer F, ...infer R extends InputSpec<Entity>[]] ? F extends keyof Entity & string ? Entity[F] extends joinable ? CompositeKeyBuilderImpl<Entity, R, [
|
|
20
33
|
...Pairs,
|
|
21
34
|
[Uppercase<F>, Entity[F]]
|
|
@@ -23,14 +36,9 @@ type CompositeKeyBuilderImpl<Entity extends Record<string, unknown>, Spec extend
|
|
|
23
36
|
...Pairs,
|
|
24
37
|
[Uppercase<F[0]>, Tr]
|
|
25
38
|
]> : never : never : Pairs;
|
|
26
|
-
|
|
27
|
-
[K in keyof Schema]: Schema[K] extends
|
|
39
|
+
type TableEntry<Entity extends Record<string, unknown>, Schema extends Record<string, FullKeySpec<Entity>>, Delimiter extends string = '#'> = Entity extends unknown ? Entity & {
|
|
40
|
+
[K in keyof Schema]: Schema[K] extends unknown[] ? CompositeKeyBuilder<Entity, Schema[K], Delimiter> : Entity[Schema[K] & keyof Entity];
|
|
28
41
|
} : never;
|
|
29
|
-
export type InterfaceWithInjection<I, D> = {
|
|
30
|
-
[K in keyof I]: (dep: D) => I[K];
|
|
31
|
-
};
|
|
32
|
-
export declare const chainableNoOpProxy: unknown;
|
|
33
|
-
export declare const createPathProxy: <T>(path?: string) => T;
|
|
34
42
|
type Unionize<T extends object> = {
|
|
35
43
|
[k in keyof T]: {
|
|
36
44
|
k: k;
|
|
@@ -41,29 +49,30 @@ type KVPair = {
|
|
|
41
49
|
k: PropertyKey;
|
|
42
50
|
v: unknown;
|
|
43
51
|
};
|
|
44
|
-
type InputSpec<Entity extends Record<string, unknown>, KV extends KVPair = Unionize<Entity>> =
|
|
52
|
+
type InputSpec<Entity extends Record<string, unknown>, KV extends KVPair = Unionize<Entity>> = evaluate<{
|
|
45
53
|
[key in keyof Entity]: [key, (key: Extract<KV, {
|
|
46
54
|
k: key;
|
|
47
55
|
}>['v']) => unknown] | key;
|
|
48
56
|
}[keyof Entity]>;
|
|
49
|
-
type extractHeadOrPass<T
|
|
50
|
-
|
|
51
|
-
|
|
57
|
+
type extractHeadOrPass<T> = T extends unknown[] ? T[0] : T;
|
|
58
|
+
type numeric = number | bigint;
|
|
59
|
+
type keysWithNumericValue<Entity extends object, KVs extends KVPair = Unionize<Entity>, K_wNumber extends PropertyKey = Extract<KVs, {
|
|
60
|
+
v: numeric;
|
|
52
61
|
}>['k'], K_woNumber extends PropertyKey = Exclude<KVs, {
|
|
53
62
|
k: K_wNumber;
|
|
54
|
-
v:
|
|
63
|
+
v: numeric;
|
|
55
64
|
}>['k']> = Exclude<K_wNumber, K_woNumber>;
|
|
56
65
|
type FullKeySpec<Entity extends Record<string, unknown>> = InputSpec<Entity>[] | (keysWithNumericValue<Entity> & keyof Entity);
|
|
57
66
|
type TableEntryDefinition<Entity extends Record<string, unknown>, Schema extends Record<string, FullKeySpec<Entity>>, Separator extends string = '#'> = {
|
|
58
|
-
toEntry: <const ExactEntity extends Exact<Entity, ExactEntity>>(item: ExactEntity) => ExactEntity extends infer E extends Entity ? Schema extends Record<string, FullKeySpec<E>> ? TableEntry<
|
|
59
|
-
fromEntry: <const Entry extends TableEntry<
|
|
67
|
+
toEntry: <const ExactEntity extends Exact<Entity, ExactEntity>>(item: ExactEntity) => ExactEntity extends infer E extends Entity ? Schema extends Record<string, FullKeySpec<E>> ? TableEntry<E, Schema, Separator> : never : never;
|
|
68
|
+
fromEntry: <const Entry extends TableEntry<Entity, Schema, Separator>>(entry: Entry) => DistributiveOmit<Entry, keyof Schema>;
|
|
60
69
|
key: <const Key extends keyof Schema, const Config extends Schema[Key] extends unknown[] ? {
|
|
61
70
|
depth?: number;
|
|
62
71
|
allowPartial?: boolean;
|
|
63
|
-
} : never, const Attributes extends Schema[Key] extends keyof Entity ? DistributivePick<Entity, Schema[Key] & keyof Entity> : Config['allowPartial'] extends true ?
|
|
64
|
-
infer: TableEntry<
|
|
65
|
-
path: () => TableEntry<
|
|
72
|
+
} : never, const Attributes extends Exact<Schema[Key] extends keyof Entity ? DistributivePick<Entity, Schema[Key] & keyof Entity> : CompositeKeyParams<Entity, Schema[Key], Config['allowPartial'] extends true ? 1 : Schema[Key]['length']>, Attributes>>(key: Key, attributes: Attributes, config?: Config) => Schema[Key] extends keyof Entity ? ValueOf<Attributes> : CompositeKeyBuilder<Entity & Attributes, Schema[Key] extends FullKeySpec<Entity & Attributes> ? Schema[Key] : never, Separator, Exclude<Config['depth'], undefined>, Exclude<Config['allowPartial'], undefined>>;
|
|
73
|
+
infer: TableEntry<Entity, Schema, Separator>;
|
|
74
|
+
path: () => TableEntry<Entity, Schema, Separator>;
|
|
66
75
|
};
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
76
|
+
declare const tableEntry: <const Entity extends Record<string, unknown>>() => <const Schema extends Record<string, FullKeySpec<Entity>>, Separator extends string = "#">(schema: Schema, separator?: Separator) => TableEntryDefinition<Entity, Schema, Separator>;
|
|
77
|
+
|
|
78
|
+
export { type CompositeKeyBuilder, type CompositeKeyParams, type TableEntry, tableEntry };
|
package/dist/Rotorise.js
CHANGED
|
@@ -1,77 +1,76 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
exports.chainableNoOpProxy = new Proxy(() => exports.chainableNoOpProxy, {
|
|
5
|
-
get: () => exports.chainableNoOpProxy,
|
|
1
|
+
// src/Rotorise.ts
|
|
2
|
+
var chainableNoOpProxy = new Proxy(() => chainableNoOpProxy, {
|
|
3
|
+
get: () => chainableNoOpProxy
|
|
6
4
|
});
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
return (0, exports.createPathProxy)(path === ''
|
|
15
|
-
? prop
|
|
16
|
-
: !Number.isNaN(Number.parseInt(prop))
|
|
17
|
-
? `${path}[${prop}]`
|
|
18
|
-
: `${path}.${prop}`);
|
|
19
|
-
}
|
|
20
|
-
},
|
|
21
|
-
});
|
|
22
|
-
};
|
|
23
|
-
exports.createPathProxy = createPathProxy;
|
|
24
|
-
const key = () => (schema, separator = '#') => (key, attributes, config) => {
|
|
25
|
-
let structure = schema[key] ?? [];
|
|
26
|
-
if (!Array.isArray(structure)) {
|
|
27
|
-
return attributes[structure];
|
|
28
|
-
}
|
|
29
|
-
if (config?.depth !== undefined) {
|
|
30
|
-
structure = structure.slice(0, config.depth);
|
|
31
|
-
}
|
|
32
|
-
const composite = [];
|
|
33
|
-
for (const keySpec of structure) {
|
|
34
|
-
const [key, transform] = Array.isArray(keySpec)
|
|
35
|
-
? keySpec
|
|
36
|
-
: [keySpec];
|
|
37
|
-
const value = attributes[key];
|
|
38
|
-
if (value !== undefined && value !== null && value !== '') {
|
|
39
|
-
composite.push(key.toString().toUpperCase());
|
|
40
|
-
composite.push(`${transform ? transform(value) : value}`);
|
|
41
|
-
}
|
|
42
|
-
else if (config?.allowPartial) {
|
|
43
|
-
break;
|
|
44
|
-
}
|
|
45
|
-
else {
|
|
46
|
-
throw new Error(`buildCompositeKey: Attribute ${key.toString()} not found in ${attributes}`);
|
|
5
|
+
var createPathProxy = (path = "") => {
|
|
6
|
+
return new Proxy(() => {
|
|
7
|
+
}, {
|
|
8
|
+
get: (target, prop, receiver) => {
|
|
9
|
+
if (typeof prop === "string") {
|
|
10
|
+
if (prop === "toString") {
|
|
11
|
+
return () => path;
|
|
47
12
|
}
|
|
13
|
+
return createPathProxy(
|
|
14
|
+
path === "" ? prop : !Number.isNaN(Number.parseInt(prop)) ? `${path}[${prop}]` : `${path}.${prop}`
|
|
15
|
+
);
|
|
16
|
+
}
|
|
48
17
|
}
|
|
49
|
-
|
|
18
|
+
});
|
|
50
19
|
};
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
20
|
+
var key = () => (schema, separator = "#") => (key2, attributes, config) => {
|
|
21
|
+
let structure = schema[key2] ?? [];
|
|
22
|
+
if (!Array.isArray(structure)) {
|
|
23
|
+
return attributes[structure];
|
|
24
|
+
}
|
|
25
|
+
if (config?.depth !== void 0) {
|
|
26
|
+
structure = structure.slice(0, config.depth);
|
|
27
|
+
}
|
|
28
|
+
const composite = [];
|
|
29
|
+
for (const keySpec of structure) {
|
|
30
|
+
const [key3, transform] = Array.isArray(keySpec) ? keySpec : [keySpec];
|
|
31
|
+
const value = attributes[key3];
|
|
32
|
+
if (value !== void 0 && value !== null && value !== "") {
|
|
33
|
+
composite.push(key3.toString().toUpperCase());
|
|
34
|
+
composite.push(
|
|
35
|
+
`${transform ? transform(value) : value}`
|
|
36
|
+
);
|
|
37
|
+
} else if (config?.allowPartial) {
|
|
38
|
+
break;
|
|
39
|
+
} else {
|
|
40
|
+
throw new Error(
|
|
41
|
+
`buildCompositeKey: Attribute ${key3.toString()} not found in ${JSON.stringify(attributes)}`
|
|
42
|
+
);
|
|
55
43
|
}
|
|
56
|
-
|
|
57
|
-
|
|
44
|
+
}
|
|
45
|
+
return composite.join(separator);
|
|
58
46
|
};
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
47
|
+
var toEntry = () => (schema, separator = "#") => (item) => {
|
|
48
|
+
const entry = { ...item };
|
|
49
|
+
for (const key_ in schema) {
|
|
50
|
+
entry[key_] = key()(schema, separator)(
|
|
51
|
+
key_,
|
|
52
|
+
item
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
return entry;
|
|
56
|
+
};
|
|
57
|
+
var fromEntry = () => (schema) => (entry) => {
|
|
58
|
+
const item = { ...entry };
|
|
59
|
+
for (const key_ in schema) {
|
|
60
|
+
delete item[key_];
|
|
61
|
+
}
|
|
62
|
+
return item;
|
|
63
|
+
};
|
|
64
|
+
var tableEntry = () => (schema, separator = "#") => {
|
|
65
|
+
return {
|
|
66
|
+
toEntry: toEntry()(schema, separator),
|
|
67
|
+
fromEntry: fromEntry()(schema),
|
|
68
|
+
key: key()(schema, separator),
|
|
69
|
+
infer: chainableNoOpProxy,
|
|
70
|
+
path: () => createPathProxy()
|
|
71
|
+
};
|
|
66
72
|
};
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
toEntry: toEntry()(schema, separator),
|
|
70
|
-
fromEntry: fromEntry()(schema, separator),
|
|
71
|
-
key: key()(schema, separator),
|
|
72
|
-
infer: exports.chainableNoOpProxy,
|
|
73
|
-
path: () => (0, exports.createPathProxy)(),
|
|
74
|
-
};
|
|
73
|
+
export {
|
|
74
|
+
tableEntry
|
|
75
75
|
};
|
|
76
|
-
exports.tableEntry = tableEntry;
|
|
77
76
|
//# sourceMappingURL=Rotorise.js.map
|
package/dist/Rotorise.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Rotorise.js","sourceRoot":"","sources":["../src/Rotorise.ts"],"names":[],"mappings":";;;AAkHa,QAAA,kBAAkB,GAAY,IAAI,KAAK,CAAC,GAAG,EAAE,CAAC,0BAAkB,EAAE;IAC3E,GAAG,EAAE,GAAG,EAAE,CAAC,0BAAkB;CAChC,CAAC,CAAA;AAEK,MAAM,eAAe,GAAG,CAAI,IAAI,GAAG,EAAE,EAAK,EAAE;IAC/C,OAAO,IAAI,KAAK,CAAC,GAAG,EAAE,GAAE,CAAC,EAAE;QACvB,GAAG,EAAE,CAAC,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE;YAC5B,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;gBAC3B,IAAI,IAAI,KAAK,UAAU,EAAE,CAAC;oBACtB,OAAO,GAAG,EAAE,CAAC,IAAI,CAAA;gBACrB,CAAC;gBAED,OAAO,IAAA,uBAAe,EAClB,IAAI,KAAK,EAAE;oBACP,CAAC,CAAC,IAAI;oBACN,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;wBACpC,CAAC,CAAC,GAAG,IAAI,IAAI,IAAI,GAAG;wBACpB,CAAC,CAAC,GAAG,IAAI,IAAI,IAAI,EAAE,CAC5B,CAAA;YACL,CAAC;QACL,CAAC;KACJ,CAAM,CAAA;AACX,CAAC,CAAA;AAlBY,QAAA,eAAe,mBAkB3B;AAmCD,MAAM,GAAG,GACL,GAAiD,EAAE,CACnD,CAII,MAAc,EACd,YAAuB,GAAgB,EACzC,EAAE,CACJ,CAqBI,GAAQ,EACR,UAAsB,EACtB,MAAe,EAWc,EAAE;IAC/B,IAAI,SAAS,GAAG,MAAM,CAAC,GAAG,CAAC,I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gB,EACzC,EAAE,CACJ,CACI,IAAiB,EAKT,EAAE;IACV,MAAM,KAAK,GAAG,EAAE,GAAG,IAAI,EAAE,CAAA;IAEzB,KAAK,MAAM,IAAI,IAAI,MAAM,EAAE,CAAC;QACxB,KAAK,CAAC,IAAI,CAAC,GAAG,GAAG,EAAU,CAAC,MAAM,EAAE,SAAS,CAAC,CAC1C,IAAI,EACJ,IAAa,CACP,CAAA;IACd,CAAC;IACD,yBAAyB;IACzB,OAAO,KAAc,CAAA;AACzB,CAAC,CAAA;AAEL,MAAM,SAAS,GACX,GAAiD,EAAE,CACnD,CAII,MAAc,EACd,YAAuB,GAAgB,EACzC,EAAE,CACJ,CACI,KAAY,EACyB,EAAE;IACvC,MAAM,IAAI,GAAG,EAAE,GAAG,KAAK,EAAE,CAAA;IAEzB,KAAK,MAAM,IAAI,IAAI,MAAM,EAAE,CAAC;QACxB,OAAO,IAAI,CAAC,IAAI,CAAC,CAAA;IACrB,CAAC;IACD,wBAAwB;IACxB,OAAO,IAAa,CAAA;AACxB,CAAC,CAAA;AA2DE,MAAM,UAAU,GACnB,GAAiD,EAAE,CACnD,CAII,MAAc,EACd,YAAuB,GAAgB,EACU,EAAE;IACnD,OAAO;QACH,OAAO,EAAE,OAAO,EAAU,CAAC,MAAM,EAAE,SAAS,CAAU;QACtD,SAAS,EAAE,SAAS,EAAU,CAAC,MAAM,EAAE,SAAS,CAAC;QACjD,GAAG,EAAE,GAAG,EAAU,CAAC,MAAM,EAAE,SAAS,CAAC;QACrC,KAAK,EAAE,0BAA2D;QAClE,IAAI,EAAE,GAAG,EAAE,CACP,IAAA,uBAAe,GAAyC;KAC/D,CAAA;AACL,CAAC,CAAA;AAjBQ,QAAA,UAAU,cAiBlB"}
|
|
1
|
+
{"version":3,"sources":["../src/Rotorise.ts"],"sourcesContent":["type KeysOfUnion<ObjectType> = ObjectType extends unknown\n ? keyof ObjectType\n : never\ntype IsEqual<T, U> = (<G>() => G extends T ? 1 : 2) extends <G>() => G extends U\n ? 1\n : 2\n ? true\n : false\n\ntype ArrayElement<T> = T extends readonly unknown[] ? T[0] : never\n\ntype ExactObject<ParameterType, InputType> = {\n [Key in keyof ParameterType]: Exact<\n ParameterType[Key],\n Key extends keyof InputType ? InputType[Key] : never\n >\n} & Record<Exclude<keyof InputType, KeysOfUnion<ParameterType>>, never>\n\ntype Exact<ParameterType, InputType> = IsEqual<\n ParameterType,\n InputType\n> extends true\n ? ParameterType\n : // Convert union of array to array of union: A[] & B[] => (A & B)[]\n ParameterType extends unknown[]\n ? Array<Exact<ArrayElement<ParameterType>, ArrayElement<InputType>>>\n : // In TypeScript, Array is a subtype of ReadonlyArray, so always test Array before ReadonlyArray.\n ParameterType extends readonly unknown[]\n ? ReadonlyArray<\n Exact<ArrayElement<ParameterType>, ArrayElement<InputType>>\n >\n : ParameterType extends object\n ? ExactObject<ParameterType, InputType>\n : ParameterType\n\ntype ValueOf<\n ObjectType,\n ValueType extends keyof ObjectType = keyof ObjectType,\n> = ObjectType[ValueType]\n\ntype evaluate<T> = T extends unknown\n ? { [K in keyof T]: T[K] } & unknown\n : never\n\ntype SliceFromStart<\n T extends unknown[],\n End extends number,\n Target extends unknown[] = [],\n> = T['length'] | End extends 0\n ? []\n : Target['length'] extends End\n ? Target\n : T extends [infer A, ...infer R]\n ? SliceFromStart<R, End, [...Target, A]>\n : never\n\ntype DistributivePick<T, K> = T extends unknown\n ? K extends keyof T\n ? Pick<T, K>\n : never\n : never\n\ntype DistributiveOmit<T, K extends keyof T> = T extends unknown\n ? Omit<T, K>\n : never\n\ntype Slices<\n rest extends unknown[],\n minLength extends number = 0,\n slice extends unknown[] = [],\n passedSkip extends 1 | 0 = slice['length'] extends minLength ? 1 : 0,\n> =\n | (passedSkip extends 1 ? slice : never)\n | (rest extends [infer h, ...infer R]\n ? Slices<\n R,\n minLength,\n [...slice, h],\n [...slice, h]['length'] extends minLength ? 1 : passedSkip\n >\n : never)\n\nexport type CompositeKeyParams<\n Entity extends Record<string, unknown>,\n Spec extends InputSpec<Entity>[],\n skip extends number = 1,\n P extends InputSpec<Entity>[] = Slices<\n Spec,\n IsLiteral<skip> extends true ? skip : 1\n >,\n> = Entity extends unknown\n ? P extends unknown\n ? evaluate<\n {\n [K in extractHeadOrPass<P[number]> & string]: Entity[K]\n } & {\n [K in extractHeadOrPass<\n Exclude<Spec[number], P[number]>\n >]?: undefined\n }\n >\n : never\n : never\ntype IsLiteral<a> = [a] extends [null | undefined]\n ? true\n : [a] extends [string]\n ? string extends a\n ? false\n : true\n : [a] extends [number]\n ? number extends a\n ? false\n : true\n : [a] extends [boolean]\n ? boolean extends a\n ? false\n : true\n : [a] extends [symbol]\n ? symbol extends a\n ? false\n : true\n : [a] extends [bigint]\n ? bigint extends a\n ? false\n : true\n : false\n\nexport type CompositeKeyBuilder<\n Entity extends Record<string, unknown>,\n Spec extends InputSpec<Entity>[],\n Delimiter extends string = '#',\n Deep extends number = Spec['length'],\n isPartial extends boolean = false,\n> = Entity extends unknown\n ? CompositeKeyBuilderImpl<\n Entity,\n IsLiteral<Deep> extends true ? SliceFromStart<Spec, Deep> : Spec\n > extends infer Values extends joinablePair[]\n ? Join<\n isPartial & IsLiteral<isPartial> extends false\n ? Values\n : Slices<Values>,\n Delimiter\n >\n : never\n : never\n\ntype joinable = string | number | bigint | boolean | null | undefined\ntype joinablePair = [joinable, joinable]\n\ntype Join<\n Pairs extends joinablePair[],\n Delimiter extends string,\n> = Pairs extends [joinablePair]\n ? `${Pairs[0][0]}${Delimiter}${Pairs[0][1]}`\n : Pairs extends [joinablePair, ...infer Tail extends joinablePair[]]\n ? `${Pairs[0][0]}${Delimiter}${Pairs[0][1]}${Delimiter}${Join<\n Tail,\n Delimiter\n >}`\n : never\n\ntype CompositeKeyBuilderImpl<\n Entity extends Record<string, unknown>,\n Spec extends InputSpec<Entity>[],\n Pairs extends joinablePair[] = [],\n> = Spec extends [infer F, ...infer R extends InputSpec<Entity>[]]\n ? F extends keyof Entity & string\n ? Entity[F] extends joinable\n ? CompositeKeyBuilderImpl<\n Entity,\n R,\n [...Pairs, [Uppercase<F>, Entity[F]]]\n >\n : never\n : F extends [keyof Entity & string, (...x: (infer _)[]) => infer Tr]\n ? Tr extends joinable\n ? CompositeKeyBuilderImpl<\n Entity,\n R,\n [...Pairs, [Uppercase<F[0]>, Tr]]\n >\n : never\n : never\n : Pairs\n\nexport type TableEntry<\n Entity extends Record<string, unknown>,\n Schema extends Record<string, FullKeySpec<Entity>>,\n Delimiter extends string = '#',\n> = Entity extends unknown\n ? Entity & {\n [K in keyof Schema]: Schema[K] extends unknown[]\n ? CompositeKeyBuilder<Entity, Schema[K], Delimiter>\n : Entity[Schema[K] & keyof Entity]\n }\n : never\n\ntype Unionize<T extends object> = {\n [k in keyof T]: { k: k; v: T[k] }\n}[keyof T]\ntype KVPair = { k: PropertyKey; v: unknown }\n\ntype InputSpec<\n Entity extends Record<string, unknown>,\n KV extends KVPair = Unionize<Entity>,\n> = evaluate<\n {\n [key in keyof Entity]:\n | [key, (key: Extract<KV, { k: key }>['v']) => unknown]\n | key\n }[keyof Entity]\n>\n\ntype extractHeadOrPass<T> = T extends unknown[] ? T[0] : T\ntype numeric = number | bigint\ntype keysWithNumericValue<\n Entity extends object,\n KVs extends KVPair = Unionize<Entity>,\n K_wNumber extends PropertyKey = Extract<KVs, { v: numeric }>['k'],\n K_woNumber extends PropertyKey = Exclude<\n KVs,\n { k: K_wNumber; v: numeric }\n >['k'],\n> = Exclude<K_wNumber, K_woNumber>\n\ntype FullKeySpec<Entity extends Record<string, unknown>> =\n | InputSpec<Entity>[]\n | (keysWithNumericValue<Entity> & keyof Entity)\n\nconst chainableNoOpProxy: unknown = new Proxy(() => chainableNoOpProxy, {\n get: () => chainableNoOpProxy,\n})\n\nconst createPathProxy = <T>(path = ''): T => {\n return new Proxy(() => {}, {\n get: (target, prop, receiver) => {\n if (typeof prop === 'string') {\n if (prop === 'toString') {\n return () => path\n }\n\n return createPathProxy(\n path === ''\n ? prop\n : !Number.isNaN(Number.parseInt(prop))\n ? `${path}[${prop}]`\n : `${path}.${prop}`,\n )\n }\n },\n }) as T\n}\n\nconst key =\n <const Entity extends Record<string, unknown>>() =>\n <\n const Schema extends Record<string, FullKeySpec<Entity>>,\n Separator extends string = '#',\n >(\n schema: Schema,\n separator: Separator = '#' as Separator,\n ) =>\n <\n const Key extends keyof Schema,\n const Config extends Schema[Key] extends unknown[]\n ? { depth?: number; allowPartial?: boolean }\n : never,\n const Attributes extends Exact<\n Schema[Key] extends keyof Entity\n ? DistributivePick<Entity, Schema[Key] & keyof Entity>\n : CompositeKeyParams<\n Entity,\n Schema[Key],\n Config['allowPartial'] extends true\n ? 1\n : Schema[Key]['length']\n >,\n Attributes\n >,\n >(\n key: Key,\n attributes: Attributes,\n config?: Config,\n ): Schema[Key] extends keyof Entity\n ? ValueOf<Attributes>\n : CompositeKeyBuilder<\n Entity & Attributes,\n Schema[Key] extends FullKeySpec<Entity & Attributes>\n ? Schema[Key]\n : never,\n Separator,\n Exclude<Config['depth'], undefined>,\n Exclude<Config['allowPartial'], undefined>\n > => {\n let structure = schema[key] ?? []\n if (!Array.isArray(structure)) {\n return attributes[structure as keyof Attributes] as never\n }\n\n if (config?.depth !== undefined) {\n structure = structure.slice(0, config.depth) as never\n }\n const composite: string[] = []\n\n for (const keySpec of structure) {\n const [key, transform] = Array.isArray(keySpec)\n ? keySpec\n : [keySpec]\n const value = attributes[key as keyof Attributes]\n if (value !== undefined && value !== null && value !== '') {\n composite.push(key.toString().toUpperCase())\n composite.push(\n `${transform ? transform(value as never) : value}`,\n )\n } else if (config?.allowPartial) {\n break\n } else {\n throw new Error(\n `buildCompositeKey: Attribute ${key.toString()} not found in ${JSON.stringify(attributes)}`,\n )\n }\n }\n\n return composite.join(separator) as never\n }\n\nconst toEntry =\n <const Entity extends Record<string, unknown>>() =>\n <\n const Schema extends Record<string, FullKeySpec<Entity>>,\n Separator extends string = '#',\n >(\n schema: Schema,\n separator: Separator = '#' as Separator,\n ) =>\n <const ExactEntity extends Exact<Entity, ExactEntity>>(\n item: ExactEntity,\n ): ExactEntity extends infer E extends Entity\n ? Schema extends Record<string, FullKeySpec<E>>\n ? TableEntry<E, Schema, Separator>\n : never\n : never => {\n const entry = { ...item }\n\n for (const key_ in schema) {\n entry[key_] = key<Entity>()(schema, separator)(\n key_,\n item as never,\n ) as never\n }\n // console.log({ entry })\n return entry as never\n }\n\nconst fromEntry =\n <const Entity extends Record<string, unknown>>() =>\n <\n const Schema extends Record<string, FullKeySpec<Entity>>,\n Separator extends string = '#',\n >(\n schema: Schema,\n ) =>\n <const Entry extends TableEntry<Entity, Schema, Separator>>(\n entry: Entry,\n ): DistributiveOmit<Entry, keyof Schema> => {\n const item = { ...entry }\n\n for (const key_ in schema) {\n delete item[key_]\n }\n // console.log({ item })\n return item as never\n }\n\ntype TableEntryDefinition<\n Entity extends Record<string, unknown>,\n Schema extends Record<string, FullKeySpec<Entity>>,\n Separator extends string = '#',\n> = {\n toEntry: <const ExactEntity extends Exact<Entity, ExactEntity>>(\n item: ExactEntity,\n ) => ExactEntity extends infer E extends Entity\n ? Schema extends Record<string, FullKeySpec<E>>\n ? TableEntry<E, Schema, Separator>\n : never\n : never\n fromEntry: <const Entry extends TableEntry<Entity, Schema, Separator>>(\n entry: Entry,\n ) => DistributiveOmit<Entry, keyof Schema>\n key: <\n const Key extends keyof Schema,\n const Config extends Schema[Key] extends unknown[]\n ? { depth?: number; allowPartial?: boolean }\n : never,\n const Attributes extends Exact<\n Schema[Key] extends keyof Entity\n ? DistributivePick<Entity, Schema[Key] & keyof Entity>\n : CompositeKeyParams<\n Entity,\n Schema[Key],\n Config['allowPartial'] extends true\n ? 1\n : Schema[Key]['length']\n >,\n Attributes\n >,\n >(\n key: Key,\n attributes: Attributes,\n config?: Config,\n ) => Schema[Key] extends keyof Entity\n ? ValueOf<Attributes>\n : CompositeKeyBuilder<\n Entity & Attributes,\n Schema[Key] extends FullKeySpec<Entity & Attributes>\n ? Schema[Key]\n : never,\n Separator,\n Exclude<Config['depth'], undefined>,\n Exclude<Config['allowPartial'], undefined>\n >\n\n infer: TableEntry<Entity, Schema, Separator>\n path: () => TableEntry<Entity, Schema, Separator>\n}\n\nexport const tableEntry =\n <const Entity extends Record<string, unknown>>() =>\n <\n const Schema extends Record<string, FullKeySpec<Entity>>,\n Separator extends string = '#',\n >(\n schema: Schema,\n separator: Separator = '#' as Separator,\n ): TableEntryDefinition<Entity, Schema, Separator> => {\n return {\n toEntry: toEntry<Entity>()(schema, separator) as never,\n fromEntry: fromEntry<Entity>()(schema),\n key: key<Entity>()(schema, separator),\n infer: chainableNoOpProxy as TableEntry<Entity, Schema, Separator>,\n path: () =>\n createPathProxy<TableEntry<Entity, Schema, Separator>>(),\n }\n }\n"],"mappings":";AAsOA,IAAM,qBAA8B,IAAI,MAAM,MAAM,oBAAoB;AAAA,EACpE,KAAK,MAAM;AACf,CAAC;AAED,IAAM,kBAAkB,CAAI,OAAO,OAAU;AACzC,SAAO,IAAI,MAAM,MAAM;AAAA,EAAC,GAAG;AAAA,IACvB,KAAK,CAAC,QAAQ,MAAM,aAAa;AAC7B,UAAI,OAAO,SAAS,UAAU;AAC1B,YAAI,SAAS,YAAY;AACrB,iBAAO,MAAM;AAAA,QACjB;AAEA,eAAO;AAAA,UACH,SAAS,KACH,OACA,CAAC,OAAO,MAAM,OAAO,SAAS,IAAI,CAAC,IACjC,GAAG,IAAI,IAAI,IAAI,MACf,GAAG,IAAI,IAAI,IAAI;AAAA,QAC3B;AAAA,MACJ;AAAA,IACJ;AAAA,EACJ,CAAC;AACL;AAEA,IAAM,MACF,MACA,CAII,QACA,YAAuB,QAE3B,CAkBIA,MACA,YACA,WAWO;AACP,MAAI,YAAY,OAAOA,IAAG,KAAK,CAAC;AAChC,MAAI,CAAC,MAAM,QAAQ,SAAS,GAAG;AAC3B,WAAO,WAAW,SAA6B;AAAA,EACnD;AAEA,MAAI,QAAQ,UAAU,QAAW;AAC7B,gBAAY,UAAU,MAAM,GAAG,OAA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
package/package.json
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rotorise",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "Supercharge your DynamoDB with Rotorise!",
|
|
5
|
-
"main": "
|
|
5
|
+
"main": "dist/Rotorise.js",
|
|
6
|
+
"types": "dist/Rotorise.d.ts",
|
|
7
|
+
"module": "dist/Rotorise.mjs",
|
|
8
|
+
"type": "module",
|
|
6
9
|
"keywords": [
|
|
7
10
|
"AWS",
|
|
8
11
|
"Dynamodb",
|
|
@@ -18,8 +21,9 @@
|
|
|
18
21
|
},
|
|
19
22
|
"homepage": "https://github.com/josher8a/rotorise",
|
|
20
23
|
"scripts": {
|
|
21
|
-
"build": "
|
|
22
|
-
"test": "tsc --noEmit && jest
|
|
24
|
+
"build": "tsup",
|
|
25
|
+
"test": "tsc --noEmit && jest",
|
|
26
|
+
"format": "biome format --write ./src"
|
|
23
27
|
},
|
|
24
28
|
"author": {
|
|
25
29
|
"name": "Joshua Hernandez",
|
|
@@ -28,12 +32,13 @@
|
|
|
28
32
|
"license": "Apache-2.0",
|
|
29
33
|
"devDependencies": {
|
|
30
34
|
"@types/jest": "^29.2.2",
|
|
31
|
-
"@types/node": "^18.
|
|
35
|
+
"@types/node": "^18.19.34",
|
|
36
|
+
"@biomejs/biome": "1.8.0",
|
|
37
|
+
"@swc/jest": "^0.2.36",
|
|
32
38
|
"jest": "^29.3.1",
|
|
33
|
-
"
|
|
34
|
-
"
|
|
39
|
+
"typescript": "^5.4.5",
|
|
40
|
+
"tsup": "^8.1.0"
|
|
35
41
|
},
|
|
36
42
|
"dependencies": {
|
|
37
|
-
"type-fest": "^4.18.3"
|
|
38
43
|
}
|
|
39
44
|
}
|
package/dist/Rotorise.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Rotorise.d.ts","sourceRoot":"","sources":["../src/Rotorise.ts"],"names":[],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AC,UAAU,CAAC,CAAA;IAEzB,KAAK,EAAE,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,CAAC,CAAA;IAC5C,IAAI,EAAE,MAAM,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,CAAC,CAAA;CACpD,CAAA;AAED,eAAO,MAAM,UAAU,yJAMP,MAAM,cACH,SAAS,KACpB,qBAAsB,MAAM,EAAE,MAAM,EAAE,SAAS,CASlD,CAAA"}
|
package/dist/typeUtils.d.ts
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
export type ValueOf<T> = T[keyof T];
|
|
2
|
-
export type Pretty<T> = T extends unknown ? {
|
|
3
|
-
[K in keyof T]: T[K];
|
|
4
|
-
} & unknown : never;
|
|
5
|
-
export type PrettyDeep<T> = T extends unknown ? {
|
|
6
|
-
[K in keyof T]: T[K] extends Record<string, unknown> ? PrettyDeep<T[K]> : T[K];
|
|
7
|
-
} : never;
|
|
8
|
-
export type Equal<T, U> = (<G>() => G extends T ? 1 : 2) extends <G>() => G extends U ? 1 : 2 ? true : false;
|
|
9
|
-
export type isTrue<T extends true> = T;
|
|
10
|
-
export type SliceFromStart<T extends unknown[], End extends number, Target extends unknown[] = []> = T['length'] | End extends 0 ? [] : Target['length'] extends End ? Target : T extends [infer A, ...infer R] ? SliceFromStart<R, End, [...Target, A]> : never;
|
|
11
|
-
export type Fn<T> = T extends (dep: infer D) => infer F ? {
|
|
12
|
-
arg: D;
|
|
13
|
-
return: F;
|
|
14
|
-
} : never;
|
|
15
|
-
export type UnionToIntersection<U> = (U extends unknown ? (k: U) => void : never) extends (k: infer I) => void ? I : never;
|
|
16
|
-
export type NonEmptyArray<T> = [T, ...T[]];
|
|
17
|
-
export type DistributivePick<T, K extends keyof T> = T extends unknown ? Pick<T, K> : never;
|
|
18
|
-
export type DistributiveJoin<T, U> = T extends unknown ? U extends unknown ? T & U : never : never;
|
|
19
|
-
export type DistributiveOmit<T, K extends keyof T> = T extends unknown ? Omit<T, K> : never;
|
|
20
|
-
export type Validate<T> = {
|
|
21
|
-
parse: (value: unknown) => T;
|
|
22
|
-
};
|
|
23
|
-
//# sourceMappingURL=typeUtils.d.ts.map
|
package/dist/typeUtils.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"typeUtils.d.ts","sourceRoot":"","sources":["../src/typeUtils.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,CAAA;AAEnC,MAAM,MAAM,MAAM,CAAC,CAAC,IAAI,CAAC,SAAS,OAAO,GACnC;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAE,GAAG,OAAO,GAClC,KAAK,CAAA;AACX,MAAM,MAAM,UAAU,CAAC,CAAC,IAAI,CAAC,SAAS,OAAO,GACvC;KACK,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC9C,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAChB,CAAC,CAAC,CAAC,CAAC;CACb,GACD,KAAK,CAAA;AAEX,MAAM,MAAM,KAAK,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,SAAS,CAC7D,CAAC,OACE,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,CAAC,GACpB,IAAI,GACJ,KAAK,CAAA;AACX,MAAM,MAAM,MAAM,CAAC,CAAC,SAAS,IAAI,IAAI,CAAC,CAAA;AAEtC,MAAM,MAAM,cAAc,CACtB,CAAC,SAAS,OAAO,EAAE,EACnB,GAAG,SAAS,MAAM,EAClB,MAAM,SAAS,OAAO,EAAE,GAAG,EAAE,IAC7B,CAAC,CAAC,QAAQ,CAAC,GAAG,GAAG,SAAS,CAAC,GACz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KAAK,EAAE,OAAO,KAAK,CAAC,CAAA;CAC/B,CAAA"}
|
package/dist/typeUtils.js
DELETED
package/dist/typeUtils.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"typeUtils.js","sourceRoot":"","sources":["../src/typeUtils.ts"],"names":[],"mappings":""}
|