@transcend-io/type-utils 1.1.2 → 1.2.2
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/.yarn/sdks/eslint/package.json +10 -2
- package/.yarn/sdks/prettier/package.json +3 -2
- package/.yarn/sdks/typescript/package.json +6 -2
- package/build/apply.d.ts +0 -3
- package/build/apply.d.ts.map +1 -1
- package/build/apply.js +0 -3
- package/build/apply.js.map +1 -1
- package/build/codecTools/FixedLengthArray.d.ts +1 -2
- package/build/codecTools/FixedLengthArray.d.ts.map +1 -1
- package/build/codecTools/FixedLengthArray.js +5 -2
- package/build/codecTools/FixedLengthArray.js.map +1 -1
- package/build/codecTools/FixedLengthString.d.ts +2 -3
- package/build/codecTools/FixedLengthString.d.ts.map +1 -1
- package/build/codecTools/FixedLengthString.js +5 -2
- package/build/codecTools/FixedLengthString.js.map +1 -1
- package/build/codecTools/NonEmptyString.d.ts +2 -2
- package/build/codecTools/NonEmptyString.d.ts.map +1 -1
- package/build/codecTools/NonEmptyString.js +5 -1
- package/build/codecTools/NonEmptyString.js.map +1 -1
- package/build/codecTools/decodeCodec.d.ts +0 -1
- package/build/codecTools/decodeCodec.d.ts.map +1 -1
- package/build/codecTools/decodeCodec.js +0 -1
- package/build/codecTools/decodeCodec.js.map +1 -1
- package/build/codecTools/dictionary.d.ts +1 -2
- package/build/codecTools/dictionary.d.ts.map +1 -1
- package/build/codecTools/dictionary.js +5 -2
- package/build/codecTools/dictionary.js.map +1 -1
- package/build/codecTools/index.js +5 -1
- package/build/codecTools/index.js.map +1 -1
- package/build/codecTools/isCodecError.d.ts +0 -1
- package/build/codecTools/isCodecError.d.ts.map +1 -1
- package/build/codecTools/isCodecError.js +0 -1
- package/build/codecTools/isCodecError.js.map +1 -1
- package/build/codecTools/partialRecord.d.ts +1 -2
- package/build/codecTools/partialRecord.d.ts.map +1 -1
- package/build/codecTools/partialRecord.js +5 -2
- package/build/codecTools/partialRecord.js.map +1 -1
- package/build/codecTools/toJsonSchema.d.ts +0 -1
- package/build/codecTools/toJsonSchema.d.ts.map +1 -1
- package/build/codecTools/toJsonSchema.js +0 -1
- package/build/codecTools/toJsonSchema.js.map +1 -1
- package/build/enum.d.ts +3 -7
- package/build/enum.d.ts.map +1 -1
- package/build/enum.js +0 -4
- package/build/enum.js.map +1 -1
- package/build/enums.d.ts +1 -1
- package/build/enums.d.ts.map +1 -1
- package/build/getEntries.d.ts +0 -1
- package/build/getEntries.d.ts.map +1 -1
- package/build/getEntries.js +0 -1
- package/build/getEntries.js.map +1 -1
- package/build/getKeys.d.ts +0 -3
- package/build/getKeys.d.ts.map +1 -1
- package/build/getKeys.js +0 -3
- package/build/getKeys.js.map +1 -1
- package/build/getValues.d.ts +0 -1
- package/build/getValues.d.ts.map +1 -1
- package/build/getValues.js +0 -1
- package/build/getValues.js.map +1 -1
- package/build/gql.d.ts +1 -2
- package/build/gql.d.ts.map +1 -1
- package/build/gql.js +0 -1
- package/build/gql.js.map +1 -1
- package/build/groupBy.d.ts +0 -1
- package/build/groupBy.d.ts.map +1 -1
- package/build/groupBy.js +0 -1
- package/build/groupBy.js.map +1 -1
- package/build/index.js +5 -1
- package/build/index.js.map +1 -1
- package/build/invert.d.ts +0 -2
- package/build/invert.d.ts.map +1 -1
- package/build/invert.js +0 -2
- package/build/invert.js.map +1 -1
- package/build/tests/FixedLengthArray.test.js +5 -1
- package/build/tests/FixedLengthArray.test.js.map +1 -1
- package/build/tsbuildinfo +1 -1
- package/build/types.d.ts +29 -29
- package/build/types.d.ts.map +1 -1
- package/build/valuesOf.d.ts +0 -1
- package/build/valuesOf.d.ts.map +1 -1
- package/build/valuesOf.js +5 -2
- package/build/valuesOf.js.map +1 -1
- package/package.json +25 -25
package/build/types.d.ts
CHANGED
|
@@ -1,123 +1,123 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* An arbitrary object keyed by strings for naming consistency
|
|
3
3
|
*/
|
|
4
|
-
export
|
|
4
|
+
export type ObjByString = {
|
|
5
5
|
[key in string]: any;
|
|
6
6
|
};
|
|
7
7
|
/**
|
|
8
8
|
* An arbitrary function
|
|
9
9
|
*/
|
|
10
|
-
export
|
|
10
|
+
export type AnyFunction = (...args: any[]) => any;
|
|
11
11
|
/**
|
|
12
12
|
* An arbitrary array
|
|
13
13
|
*/
|
|
14
|
-
export
|
|
14
|
+
export type AnyArray = any[];
|
|
15
15
|
/**
|
|
16
16
|
* The type of the underlying array
|
|
17
17
|
*/
|
|
18
|
-
export
|
|
18
|
+
export type ArrType<TData extends AnyArray> = TData extends (infer DataT)[] ? DataT : never;
|
|
19
19
|
/**
|
|
20
20
|
* The type of the underlying promise
|
|
21
21
|
*/
|
|
22
|
-
export
|
|
22
|
+
export type PromiseType<TData> = TData extends Promise<infer R> ? R : TData;
|
|
23
23
|
/**
|
|
24
24
|
* The type of the underlying array
|
|
25
25
|
*/
|
|
26
|
-
export
|
|
26
|
+
export type ArrOrIdentityType<TData> = TData extends (infer DataT)[] ? DataT : TData;
|
|
27
27
|
/**
|
|
28
28
|
* Helper to create type or type[]
|
|
29
29
|
*/
|
|
30
|
-
export
|
|
30
|
+
export type OrArray<T> = T | T[];
|
|
31
31
|
/**
|
|
32
32
|
* To make the inspected type more tractable than a bunch of intersections
|
|
33
33
|
*/
|
|
34
|
-
export
|
|
34
|
+
export type Identity<T> = {
|
|
35
35
|
[K in keyof T]: T[K];
|
|
36
36
|
};
|
|
37
37
|
/**
|
|
38
38
|
* Identity but recursive
|
|
39
39
|
*/
|
|
40
|
-
export
|
|
40
|
+
export type RecursiveIdentity<T> = T extends AnyArray ? ArrType<T> extends object ? Identity<ArrType<T>>[] : T : T extends string ? T : T extends object ? {
|
|
41
41
|
[K in keyof T]: T[K] extends object ? Identity<T[K]> : T[K];
|
|
42
42
|
} : T;
|
|
43
43
|
/**
|
|
44
44
|
* Make selected object keys defined by K optional in type T
|
|
45
45
|
*/
|
|
46
|
-
export
|
|
46
|
+
export type Optionalize<T, K extends keyof T> = Identity<Omit<T, K> & Partial<T>>;
|
|
47
47
|
/**
|
|
48
48
|
* Make select arguments of a type required
|
|
49
49
|
*/
|
|
50
|
-
export
|
|
50
|
+
export type Requirize<T, K extends keyof T> = Identity<Omit<T, K> & Required<{
|
|
51
51
|
[P in K]: T[P];
|
|
52
52
|
}>>;
|
|
53
53
|
/**
|
|
54
54
|
* Convert keys of a type to strings
|
|
55
55
|
*/
|
|
56
|
-
export
|
|
56
|
+
export type Stringify<T, K extends keyof T> = Omit<T, K> & {
|
|
57
57
|
[P in keyof T]: string;
|
|
58
58
|
};
|
|
59
59
|
/**
|
|
60
60
|
* Extract string keys from an object
|
|
61
61
|
*/
|
|
62
|
-
export
|
|
62
|
+
export type StringKeys<TObj extends ObjByString> = Extract<keyof TObj, string>;
|
|
63
63
|
/**
|
|
64
64
|
* Extract associated values of string keys
|
|
65
65
|
*/
|
|
66
|
-
export
|
|
66
|
+
export type StringValues<TObj extends ObjByString> = TObj[keyof TObj];
|
|
67
67
|
/**
|
|
68
68
|
* String keys without extends enforcement
|
|
69
69
|
*/
|
|
70
|
-
export
|
|
70
|
+
export type StringKeysSafe<T> = T extends ObjByString ? StringKeys<T> : undefined;
|
|
71
71
|
/**
|
|
72
72
|
* Extract the sub types of an object, based on some condition.
|
|
73
73
|
*
|
|
74
74
|
* In other words, given an object with mixed value types, filter the key-value pairs to only
|
|
75
75
|
* contain values that extend `Condition`
|
|
76
76
|
*/
|
|
77
|
-
export
|
|
77
|
+
export type SubType<Base, Condition> = Pick<Base, {
|
|
78
78
|
[Key in keyof Base]: Base[Key] extends Condition ? Key : never;
|
|
79
79
|
}[keyof Base]>;
|
|
80
80
|
/**
|
|
81
81
|
* Inverse of SubType
|
|
82
82
|
*/
|
|
83
|
-
export
|
|
83
|
+
export type SubNotType<Base, Condition> = Pick<Base, {
|
|
84
84
|
[Key in keyof Base]: Base[Key] extends Condition ? never : Key;
|
|
85
85
|
}[keyof Base]>;
|
|
86
86
|
/**
|
|
87
87
|
* Subtype but optional inputs become require
|
|
88
88
|
*/
|
|
89
|
-
export
|
|
89
|
+
export type SubTypeRequired<Base, Condition> = SubType<Required<Base>, Condition>;
|
|
90
90
|
/**
|
|
91
91
|
* Names of properties in T with types that include undefined
|
|
92
92
|
*/
|
|
93
|
-
|
|
93
|
+
type OptionalPropertyNames<T> = {
|
|
94
94
|
[K in keyof T]: undefined extends T[K] ? K : never;
|
|
95
95
|
}[keyof T];
|
|
96
96
|
/**
|
|
97
97
|
* Common properties from L and R with undefined in R[K] replaced by type in L[K]
|
|
98
98
|
*/
|
|
99
|
-
|
|
99
|
+
type SpreadProperties<L, R, K extends keyof L & keyof R> = {
|
|
100
100
|
[P in K]: L[P] | Exclude<R[P], undefined>;
|
|
101
101
|
};
|
|
102
102
|
/**
|
|
103
103
|
* Type of { ...L, ...R }, more accurate than typeof L & typeof R
|
|
104
104
|
*/
|
|
105
|
-
export
|
|
105
|
+
export type Spread<L, R> = Identity<Pick<L, Exclude<keyof L, keyof R>> & Pick<R, Exclude<keyof R, OptionalPropertyNames<R>>> & Pick<R, Exclude<OptionalPropertyNames<R>, keyof L>> & SpreadProperties<L, R, OptionalPropertyNames<R> & keyof L>>;
|
|
106
106
|
/**
|
|
107
107
|
* Soft spread
|
|
108
108
|
*/
|
|
109
|
-
export
|
|
109
|
+
export type Merge<L, R> = Identity<Pick<L, Exclude<keyof L, keyof R>> & R>;
|
|
110
110
|
/**
|
|
111
111
|
* Convert unions to intersection
|
|
112
112
|
*/
|
|
113
|
-
export
|
|
113
|
+
export type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends (k: infer I) => void ? I : never;
|
|
114
114
|
/**
|
|
115
115
|
* Loop over an object and recursively replace all values.
|
|
116
116
|
*
|
|
117
117
|
* i.e. RecursiveTypeReplace<string | number | { message: string, value: number } | () => Promise<string>, string, boolean>;
|
|
118
118
|
* Outputs: boolean | number | { message: boolean, value: number } | () => Promise<boolean>
|
|
119
119
|
*/
|
|
120
|
-
export
|
|
120
|
+
export type RecursiveTypeReplace<T, TReplace, TReplaceWith> = T extends Promise<infer R> ? Promise<RecursiveTypeReplace<R, TReplace, TReplaceWith>> : T extends (...args: infer ArgsR) => infer ReturnR ? (...args: ArgsR) => RecursiveTypeReplace<ReturnR, TReplace, TReplaceWith> : T extends RegExp ? T : Extract<T, string> extends never ? {
|
|
121
121
|
[k in keyof T]: RecursiveTypeReplace<T[k], TReplace, TReplaceWith>;
|
|
122
122
|
} : Exclude<{
|
|
123
123
|
[k in keyof T]: RecursiveTypeReplace<T[k], TReplace, TReplaceWith>;
|
|
@@ -125,19 +125,19 @@ export declare type RecursiveTypeReplace<T, TReplace, TReplaceWith> = T extends
|
|
|
125
125
|
/**
|
|
126
126
|
* Recursively replace one type in an object
|
|
127
127
|
*/
|
|
128
|
-
export
|
|
128
|
+
export type RecursiveObjectReplace<TBase, TReplaceCondition, TReplaceWith> = TBase extends TReplaceCondition ? TReplaceWith : TBase extends (infer R)[] ? RecursiveObjectReplace<R, TReplaceCondition, TReplaceWith> : TBase extends object ? {
|
|
129
129
|
[k in keyof TBase]: TBase[k] extends (infer R)[][] ? RecursiveObjectReplace<R, TReplaceCondition, TReplaceWith>[][] : TBase[k] extends (infer R)[][] | undefined ? RecursiveObjectReplace<R, TReplaceCondition, TReplaceWith>[][] | undefined : TBase[k] extends (infer R)[] ? RecursiveObjectReplace<R, TReplaceCondition, TReplaceWith>[] : TBase[k] extends (infer R)[] | undefined ? RecursiveObjectReplace<R, TReplaceCondition, TReplaceWith>[] | undefined : TBase[k] extends TReplaceCondition ? TReplaceWith : TBase[k] extends TReplaceCondition | undefined ? TReplaceWith | undefined : RecursiveObjectReplace<TBase[k], TReplaceCondition, TReplaceWith>;
|
|
130
130
|
} : TBase;
|
|
131
131
|
/**
|
|
132
132
|
* Make values nullable.
|
|
133
133
|
*/
|
|
134
|
-
export
|
|
134
|
+
export type Nullable<T> = {
|
|
135
135
|
[K in keyof T]: T[K] | null;
|
|
136
136
|
};
|
|
137
137
|
/**
|
|
138
138
|
* Deep partial of a type
|
|
139
139
|
*/
|
|
140
|
-
export
|
|
140
|
+
export type DeepPartial<T> = {
|
|
141
141
|
[P in keyof T]?: DeepPartial<T[P]>;
|
|
142
142
|
};
|
|
143
143
|
/**
|
|
@@ -145,10 +145,10 @@ export declare type DeepPartial<T> = {
|
|
|
145
145
|
*
|
|
146
146
|
* TODO: https://transcend.height.app/T-15646 - Remove once on TypeScript 4.5.
|
|
147
147
|
*/
|
|
148
|
-
export
|
|
148
|
+
export type Awaited<T> = T extends PromiseLike<infer U> ? U : T;
|
|
149
149
|
/**
|
|
150
150
|
* Utility type that passes through the interface given that its keys are exactly equal to the keys string union
|
|
151
151
|
*/
|
|
152
|
-
export
|
|
152
|
+
export type KeysStrictlyEqual<Keys extends string, Interface extends [keyof Interface] extends [Keys] ? [Keys] extends [keyof Interface] ? unknown : never : never> = Interface;
|
|
153
153
|
export {};
|
|
154
154
|
//# sourceMappingURL=types.d.ts.map
|
package/build/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG;KAAG,GAAG,IAAI,MAAM,GAAG,GAAG;CAAE,CAAC;AAEnD;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAC;AAElD;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG,GAAG,EAAE,CAAC;AAE7B;;GAEG;AACH,MAAM,MAAM,OAAO,CAAC,KAAK,SAAS,QAAQ,IAAI,KAAK,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE,GACvE,KAAK,GACL,KAAK,CAAC;AAEV;;GAEG;AACH,MAAM,MAAM,WAAW,CAAC,KAAK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AK,IACP,SAAS,CAAC"}
|
package/build/valuesOf.d.ts
CHANGED
package/build/valuesOf.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"valuesOf.d.ts","sourceRoot":"","sources":["../src/valuesOf.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,CAAC,MAAM,OAAO,CAAC;AAK3B
|
|
1
|
+
{"version":3,"file":"valuesOf.d.ts","sourceRoot":"","sources":["../src/valuesOf.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,CAAC,MAAM,OAAO,CAAC;AAK3B;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,KAAK,SAAS,MAAM,EAAE,GAAG,EAAE;KACjD,CAAC,IAAI,MAAM,GAAG,KAAK;CACrB,GAAG,CAAC,CAAC,MAAM,CAAC;KAAG,CAAC,IAAI,KAAK,GAAG,OAAO;CAAE,CAAC,CAGtC"}
|
package/build/valuesOf.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -26,7 +30,6 @@ const t = __importStar(require("io-ts"));
|
|
|
26
30
|
const invert_1 = require("./invert");
|
|
27
31
|
/**
|
|
28
32
|
* We care about the values of an enum. This does not come out of the box with io-ts so we have to invert the enum first.
|
|
29
|
-
*
|
|
30
33
|
* @param enm - The enum to invert
|
|
31
34
|
* @returns The io-ts keyof
|
|
32
35
|
*/
|
package/build/valuesOf.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"valuesOf.js","sourceRoot":"","sources":["../src/valuesOf.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"valuesOf.js","sourceRoot":"","sources":["../src/valuesOf.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,WAAW;AACX,yCAA2B;AAE3B,SAAS;AACT,qCAAkC;AAElC;;;;GAIG;AACH,SAAgB,QAAQ,CAAuB,GAE9C;IACC,8DAA8D;IAC9D,OAAO,CAAC,CAAC,KAAK,CAAC,IAAA,eAAM,EAAC,GAAG,CAAQ,CAAC,CAAC;AACrC,CAAC;AALD,4BAKC"}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"author": "Transcend Inc.",
|
|
3
3
|
"name": "@transcend-io/type-utils",
|
|
4
4
|
"description": "Small package containing useful typescript utilities.",
|
|
5
|
-
"version": "1.
|
|
5
|
+
"version": "1.2.2",
|
|
6
6
|
"homepage": "https://github.com/transcend-io/type-utils",
|
|
7
7
|
"repository": {
|
|
8
8
|
"type": "git",
|
|
@@ -17,36 +17,36 @@
|
|
|
17
17
|
"scripts": {
|
|
18
18
|
"update:sdks": "yarn set version from sources && yarn sdks base",
|
|
19
19
|
"update:deps": "yarn upgrade-interactive && yarn update:sdks",
|
|
20
|
-
"build": "yarn
|
|
21
|
-
"clean": "yarn
|
|
22
|
-
"lint": "yarn
|
|
20
|
+
"build": "yarn tsc --build",
|
|
21
|
+
"clean": "yarn tsc --build --clean",
|
|
22
|
+
"lint": "yarn eslint src --ext .ts",
|
|
23
23
|
"prepublish": "yarn build",
|
|
24
|
-
"test": "yarn
|
|
24
|
+
"test": "yarn mocha './src/**/*.test.ts'"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"fp-ts": "^2.
|
|
28
|
-
"io-ts": "^2.2.
|
|
27
|
+
"fp-ts": "^2.16.1",
|
|
28
|
+
"io-ts": "^2.2.21"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
|
-
"@types/chai": "^4.3.
|
|
32
|
-
"@types/json-schema": "^7.0.
|
|
33
|
-
"@types/mocha": "^
|
|
34
|
-
"@typescript-eslint/eslint-plugin": "^
|
|
35
|
-
"@typescript-eslint/parser": "^
|
|
36
|
-
"@yarnpkg/pnpify": "^
|
|
37
|
-
"@yarnpkg/sdks": "^
|
|
38
|
-
"chai": "^4.3.
|
|
39
|
-
"depcheck": "^1.4.
|
|
40
|
-
"eslint": "^8.
|
|
31
|
+
"@types/chai": "^4.3.11",
|
|
32
|
+
"@types/json-schema": "^7.0.15",
|
|
33
|
+
"@types/mocha": "^10.0.6",
|
|
34
|
+
"@typescript-eslint/eslint-plugin": "^6.13.2",
|
|
35
|
+
"@typescript-eslint/parser": "^6.13.2",
|
|
36
|
+
"@yarnpkg/pnpify": "^4.0.1",
|
|
37
|
+
"@yarnpkg/sdks": "^3.1.0",
|
|
38
|
+
"chai": "^4.3.10",
|
|
39
|
+
"depcheck": "^1.4.7",
|
|
40
|
+
"eslint": "^8.55.0",
|
|
41
41
|
"eslint-config-airbnb-base": "^15.0.0",
|
|
42
|
-
"eslint-import-resolver-typescript": "^
|
|
42
|
+
"eslint-import-resolver-typescript": "^3.6.1",
|
|
43
43
|
"eslint-plugin-eslint-comments": "^3.2.0",
|
|
44
|
-
"eslint-plugin-import": "2.
|
|
45
|
-
"eslint-plugin-jsdoc": "^
|
|
46
|
-
"mocha": "^
|
|
47
|
-
"prettier": "^2.
|
|
48
|
-
"ts-node": "^10.
|
|
49
|
-
"typescript": "^
|
|
44
|
+
"eslint-plugin-import": "2.29.0",
|
|
45
|
+
"eslint-plugin-jsdoc": "^46.9.0",
|
|
46
|
+
"mocha": "^10.2.0",
|
|
47
|
+
"prettier": "^2.7.1",
|
|
48
|
+
"ts-node": "^10.9.1",
|
|
49
|
+
"typescript": "^5.3.2"
|
|
50
50
|
},
|
|
51
|
-
"packageManager": "yarn@
|
|
51
|
+
"packageManager": "yarn@4.0.2"
|
|
52
52
|
}
|