@aidc-toolkit/dev 1.0.23-beta → 1.0.25-beta
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/README.md +28 -3
- package/dist/index.cjs +192 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +8 -0
- package/dist/index.d.ts +8 -18
- package/dist/index.js +137 -1
- package/dist/index.js.map +1 -1
- package/eslint.config.ts +1 -1
- package/package.json +9 -21
- package/src/index.ts +2 -1
- package/src/tsup-config-template.ts +15 -0
- package/tsconfig.json +2 -0
- package/tsup.config.ts +3 -0
- package/typedoc.json +3 -1
- package/config/publish.json +0 -82
- package/dist/eslint-config-template.d.ts +0 -2
- package/dist/eslint-config-template.d.ts.map +0 -1
- package/dist/eslint-config-template.js +0 -118
- package/dist/eslint-config-template.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/src/publish/configuration.ts +0 -318
- package/src/publish/logger.ts +0 -45
- package/src/publish/publish-alpha.ts +0 -171
- package/src/publish/publish-beta.ts +0 -361
- package/src/publish/publish.ts +0 -875
- package/src/publish/type-helper.ts +0 -74
- package/tsconfig-build-dev-local.json +0 -9
- package/tsconfig-build-dev.json +0 -9
- package/tsconfig-build-local.json +0 -11
- package/tsconfig-build.json +0 -11
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Create an object with omitted or picked entries.
|
|
3
|
-
*
|
|
4
|
-
* @param omitting
|
|
5
|
-
* True if omitting.
|
|
6
|
-
*
|
|
7
|
-
* @param o
|
|
8
|
-
* Object.
|
|
9
|
-
*
|
|
10
|
-
* @param keys
|
|
11
|
-
* Keys to omit or pick.
|
|
12
|
-
*
|
|
13
|
-
* @returns
|
|
14
|
-
* Edited object.
|
|
15
|
-
*/
|
|
16
|
-
function omitOrPick<Omitting extends boolean, T extends object, K extends keyof T>(omitting: Omitting, o: T, ...keys: K[]): Omitting extends true ? Omit<T, K> : Pick<T, K> {
|
|
17
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion -- Key and value types are known.
|
|
18
|
-
return Object.fromEntries(Object.entries(o).filter(([key]) => keys.includes(key as K) !== omitting)) as ReturnType<typeof omitOrPick<Omitting, T, K>>;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* Create an object with omitted entries.
|
|
23
|
-
*
|
|
24
|
-
* @param o
|
|
25
|
-
* Object.
|
|
26
|
-
*
|
|
27
|
-
* @param keys
|
|
28
|
-
* Keys to omit.
|
|
29
|
-
*
|
|
30
|
-
* @returns
|
|
31
|
-
* Edited object.
|
|
32
|
-
*/
|
|
33
|
-
export function omit<T extends object, K extends keyof T>(o: T, ...keys: K[]): Omit<T, K> {
|
|
34
|
-
return omitOrPick(true, o, ...keys);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* Create an object with picked entries.
|
|
39
|
-
*
|
|
40
|
-
* @param o
|
|
41
|
-
* Object.
|
|
42
|
-
*
|
|
43
|
-
* @param keys
|
|
44
|
-
* Keys to pick.
|
|
45
|
-
*
|
|
46
|
-
* @returns
|
|
47
|
-
* Edited object.
|
|
48
|
-
*/
|
|
49
|
-
export function pick<T extends object, K extends keyof T>(o: T, ...keys: K[]): Pick<T, K> {
|
|
50
|
-
return omitOrPick(false, o, ...keys);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* Cast a property as a more narrow type.
|
|
55
|
-
*
|
|
56
|
-
* @param o
|
|
57
|
-
* Object.
|
|
58
|
-
*
|
|
59
|
-
* @param key
|
|
60
|
-
* Key of property to cast.
|
|
61
|
-
*
|
|
62
|
-
* @returns
|
|
63
|
-
* Single-key object with property cast as desired type.
|
|
64
|
-
*/
|
|
65
|
-
export function propertyAs<TAsType extends T[K], T extends object, K extends keyof T>(o: T, key: K): Readonly<Omit<T, K> extends T ? Partial<Record<K, TAsType>> : Record<K, TAsType>> {
|
|
66
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion -- Type is determined by condition.
|
|
67
|
-
return (key in o ?
|
|
68
|
-
{
|
|
69
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion -- Force cast.
|
|
70
|
-
[key]: o[key] as TAsType
|
|
71
|
-
} :
|
|
72
|
-
{}
|
|
73
|
-
) as ReturnType<typeof propertyAs<TAsType, T, K>>;
|
|
74
|
-
}
|
package/tsconfig-build-dev.json
DELETED