@forklaunch/core 0.7.3 → 0.7.4
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/lib/__test__/index.d.mts
CHANGED
@@ -2,7 +2,13 @@ import { IdiomaticSchema, Schema } from '@forklaunch/validator';
|
|
2
2
|
import { TypeboxSchemaValidator } from '@forklaunch/validator/typebox';
|
3
3
|
import { ZodSchemaValidator } from '@forklaunch/validator/zod';
|
4
4
|
|
5
|
-
declare function testSchemaEquality<Z extends IdiomaticSchema<ZodSchemaValidator>, T extends IdiomaticSchema<TypeboxSchemaValidator>>(zodSchema: Z, typeBoxSchema: T, testData: Schema<Z, ZodSchemaValidator>):
|
5
|
+
declare function testSchemaEquality<Z extends IdiomaticSchema<ZodSchemaValidator>, T extends IdiomaticSchema<TypeboxSchemaValidator>>(zodSchema: Z, typeBoxSchema: T, testData: Schema<Z, ZodSchemaValidator>): EqualityWithoutFunction<T, Z>;
|
6
|
+
type InjectiveWithoutFunction<O, T> = {
|
7
|
+
[K in keyof O]: K extends keyof T ? O[K] extends object ? T[K] extends object ? InjectiveWithoutFunction<O[K], T[K]> : false : O[K] extends (...args: never[]) => unknown ? T[K] extends (...args: never[]) => unknown ? true : false : O[K] extends T[K] ? T[K] extends O[K] ? true : false : false : false;
|
8
|
+
} extends infer R ? R extends {
|
9
|
+
[K in keyof R]: true;
|
10
|
+
} ? true : false : false;
|
11
|
+
type EqualityWithoutFunction<T extends IdiomaticSchema<TypeboxSchemaValidator>, Z extends IdiomaticSchema<ZodSchemaValidator>> = Schema<T, TypeboxSchemaValidator> extends infer TypeboxSchema ? Schema<Z, ZodSchemaValidator> extends infer ZodSchema ? InjectiveWithoutFunction<TypeboxSchema, ZodSchema> extends InjectiveWithoutFunction<ZodSchema, TypeboxSchema> ? true : false : false : false;
|
6
12
|
declare enum DummyEnum {
|
7
13
|
A = "A",
|
8
14
|
B = "B"
|
package/lib/__test__/index.d.ts
CHANGED
@@ -2,7 +2,13 @@ import { IdiomaticSchema, Schema } from '@forklaunch/validator';
|
|
2
2
|
import { TypeboxSchemaValidator } from '@forklaunch/validator/typebox';
|
3
3
|
import { ZodSchemaValidator } from '@forklaunch/validator/zod';
|
4
4
|
|
5
|
-
declare function testSchemaEquality<Z extends IdiomaticSchema<ZodSchemaValidator>, T extends IdiomaticSchema<TypeboxSchemaValidator>>(zodSchema: Z, typeBoxSchema: T, testData: Schema<Z, ZodSchemaValidator>):
|
5
|
+
declare function testSchemaEquality<Z extends IdiomaticSchema<ZodSchemaValidator>, T extends IdiomaticSchema<TypeboxSchemaValidator>>(zodSchema: Z, typeBoxSchema: T, testData: Schema<Z, ZodSchemaValidator>): EqualityWithoutFunction<T, Z>;
|
6
|
+
type InjectiveWithoutFunction<O, T> = {
|
7
|
+
[K in keyof O]: K extends keyof T ? O[K] extends object ? T[K] extends object ? InjectiveWithoutFunction<O[K], T[K]> : false : O[K] extends (...args: never[]) => unknown ? T[K] extends (...args: never[]) => unknown ? true : false : O[K] extends T[K] ? T[K] extends O[K] ? true : false : false : false;
|
8
|
+
} extends infer R ? R extends {
|
9
|
+
[K in keyof R]: true;
|
10
|
+
} ? true : false : false;
|
11
|
+
type EqualityWithoutFunction<T extends IdiomaticSchema<TypeboxSchemaValidator>, Z extends IdiomaticSchema<ZodSchemaValidator>> = Schema<T, TypeboxSchemaValidator> extends infer TypeboxSchema ? Schema<Z, ZodSchemaValidator> extends infer ZodSchema ? InjectiveWithoutFunction<TypeboxSchema, ZodSchema> extends InjectiveWithoutFunction<ZodSchema, TypeboxSchema> ? true : false : false : false;
|
6
12
|
declare enum DummyEnum {
|
7
13
|
A = "A",
|
8
14
|
B = "B"
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../__test__/index.ts","../../__test__/utils/schemaEquality.ts"],"sourcesContent":["export * from './utils/schemaEquality';\n","import { sortObjectKeys } from '@forklaunch/common';\nimport { IdiomaticSchema } from '@forklaunch/validator';\n\nimport { Schema } from '@forklaunch/validator';\nimport {\n TypeboxSchemaValidator,\n parse as typeboxParse\n} from '@forklaunch/validator/typebox';\nimport {\n ZodSchemaValidator,\n parse as zodParse\n} from '@forklaunch/validator/zod';\n\nexport function testSchemaEquality<\n Z extends IdiomaticSchema<ZodSchemaValidator>,\n T extends IdiomaticSchema<TypeboxSchemaValidator>\n>(zodSchema: Z, typeBoxSchema: T, testData: Schema<Z, ZodSchemaValidator>) {\n const zodParseResult = zodParse(zodSchema, testData);\n const typeboxParseResult = typeboxParse(typeBoxSchema, testData);\n\n const isEqual =\n JSON.stringify(\n zodParseResult.ok\n ? sortObjectKeys(\n zodParseResult.value as unknown as Record<string, unknown>\n )\n : '-1'\n ) ===\n JSON.stringify(\n typeboxParseResult.ok ? sortObjectKeys(typeboxParseResult.value) : '1'\n );\n\n return isEqual as
|
1
|
+
{"version":3,"sources":["../../__test__/index.ts","../../__test__/utils/schemaEquality.ts"],"sourcesContent":["export * from './utils/schemaEquality';\n","import { sortObjectKeys } from '@forklaunch/common';\nimport { IdiomaticSchema } from '@forklaunch/validator';\n\nimport { Schema } from '@forklaunch/validator';\nimport {\n TypeboxSchemaValidator,\n parse as typeboxParse\n} from '@forklaunch/validator/typebox';\nimport {\n ZodSchemaValidator,\n parse as zodParse\n} from '@forklaunch/validator/zod';\n\nexport function testSchemaEquality<\n Z extends IdiomaticSchema<ZodSchemaValidator>,\n T extends IdiomaticSchema<TypeboxSchemaValidator>\n>(zodSchema: Z, typeBoxSchema: T, testData: Schema<Z, ZodSchemaValidator>) {\n const zodParseResult = zodParse(zodSchema, testData);\n const typeboxParseResult = typeboxParse(typeBoxSchema, testData);\n\n const isEqual =\n JSON.stringify(\n zodParseResult.ok\n ? sortObjectKeys(\n zodParseResult.value as unknown as Record<string, unknown>\n )\n : '-1'\n ) ===\n JSON.stringify(\n typeboxParseResult.ok ? sortObjectKeys(typeboxParseResult.value) : '1'\n );\n\n return isEqual as EqualityWithoutFunction<T, Z>;\n}\n\ntype InjectiveWithoutFunction<O, T> = {\n [K in keyof O]: K extends keyof T\n ? O[K] extends object\n ? T[K] extends object\n ? InjectiveWithoutFunction<O[K], T[K]>\n : false\n : O[K] extends (...args: never[]) => unknown\n ? T[K] extends (...args: never[]) => unknown\n ? true\n : false\n : O[K] extends T[K]\n ? T[K] extends O[K]\n ? true\n : false\n : false\n : false;\n} extends infer R\n ? R extends {\n [K in keyof R]: true;\n }\n ? true\n : false\n : false;\n\ntype EqualityWithoutFunction<\n T extends IdiomaticSchema<TypeboxSchemaValidator>,\n Z extends IdiomaticSchema<ZodSchemaValidator>\n> =\n Schema<T, TypeboxSchemaValidator> extends infer TypeboxSchema\n ? Schema<Z, ZodSchemaValidator> extends infer ZodSchema\n ? InjectiveWithoutFunction<\n TypeboxSchema,\n ZodSchema\n > extends InjectiveWithoutFunction<ZodSchema, TypeboxSchema>\n ? true\n : false\n : false\n : false;\n\nexport enum DummyEnum {\n A = 'A',\n B = 'B'\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,oBAA+B;AAI/B,qBAGO;AACP,iBAGO;AAEA,SAAS,mBAGd,WAAc,eAAkB,UAAyC;AACzE,QAAM,qBAAiB,WAAAA,OAAS,WAAW,QAAQ;AACnD,QAAM,yBAAqB,eAAAC,OAAa,eAAe,QAAQ;AAE/D,QAAM,UACJ,KAAK;AAAA,IACH,eAAe,SACX;AAAA,MACE,eAAe;AAAA,IACjB,IACA;AAAA,EACN,MACA,KAAK;AAAA,IACH,mBAAmB,SAAK,8BAAe,mBAAmB,KAAK,IAAI;AAAA,EACrE;AAEF,SAAO;AACT;AAyCO,IAAK,YAAL,kBAAKC,eAAL;AACL,EAAAA,WAAA,OAAI;AACJ,EAAAA,WAAA,OAAI;AAFM,SAAAA;AAAA,GAAA;","names":["zodParse","typeboxParse","DummyEnum"]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../__test__/utils/schemaEquality.ts"],"sourcesContent":["import { sortObjectKeys } from '@forklaunch/common';\nimport { IdiomaticSchema } from '@forklaunch/validator';\n\nimport { Schema } from '@forklaunch/validator';\nimport {\n TypeboxSchemaValidator,\n parse as typeboxParse\n} from '@forklaunch/validator/typebox';\nimport {\n ZodSchemaValidator,\n parse as zodParse\n} from '@forklaunch/validator/zod';\n\nexport function testSchemaEquality<\n Z extends IdiomaticSchema<ZodSchemaValidator>,\n T extends IdiomaticSchema<TypeboxSchemaValidator>\n>(zodSchema: Z, typeBoxSchema: T, testData: Schema<Z, ZodSchemaValidator>) {\n const zodParseResult = zodParse(zodSchema, testData);\n const typeboxParseResult = typeboxParse(typeBoxSchema, testData);\n\n const isEqual =\n JSON.stringify(\n zodParseResult.ok\n ? sortObjectKeys(\n zodParseResult.value as unknown as Record<string, unknown>\n )\n : '-1'\n ) ===\n JSON.stringify(\n typeboxParseResult.ok ? sortObjectKeys(typeboxParseResult.value) : '1'\n );\n\n return isEqual as
|
1
|
+
{"version":3,"sources":["../../__test__/utils/schemaEquality.ts"],"sourcesContent":["import { sortObjectKeys } from '@forklaunch/common';\nimport { IdiomaticSchema } from '@forklaunch/validator';\n\nimport { Schema } from '@forklaunch/validator';\nimport {\n TypeboxSchemaValidator,\n parse as typeboxParse\n} from '@forklaunch/validator/typebox';\nimport {\n ZodSchemaValidator,\n parse as zodParse\n} from '@forklaunch/validator/zod';\n\nexport function testSchemaEquality<\n Z extends IdiomaticSchema<ZodSchemaValidator>,\n T extends IdiomaticSchema<TypeboxSchemaValidator>\n>(zodSchema: Z, typeBoxSchema: T, testData: Schema<Z, ZodSchemaValidator>) {\n const zodParseResult = zodParse(zodSchema, testData);\n const typeboxParseResult = typeboxParse(typeBoxSchema, testData);\n\n const isEqual =\n JSON.stringify(\n zodParseResult.ok\n ? sortObjectKeys(\n zodParseResult.value as unknown as Record<string, unknown>\n )\n : '-1'\n ) ===\n JSON.stringify(\n typeboxParseResult.ok ? sortObjectKeys(typeboxParseResult.value) : '1'\n );\n\n return isEqual as EqualityWithoutFunction<T, Z>;\n}\n\ntype InjectiveWithoutFunction<O, T> = {\n [K in keyof O]: K extends keyof T\n ? O[K] extends object\n ? T[K] extends object\n ? InjectiveWithoutFunction<O[K], T[K]>\n : false\n : O[K] extends (...args: never[]) => unknown\n ? T[K] extends (...args: never[]) => unknown\n ? true\n : false\n : O[K] extends T[K]\n ? T[K] extends O[K]\n ? true\n : false\n : false\n : false;\n} extends infer R\n ? R extends {\n [K in keyof R]: true;\n }\n ? true\n : false\n : false;\n\ntype EqualityWithoutFunction<\n T extends IdiomaticSchema<TypeboxSchemaValidator>,\n Z extends IdiomaticSchema<ZodSchemaValidator>\n> =\n Schema<T, TypeboxSchemaValidator> extends infer TypeboxSchema\n ? Schema<Z, ZodSchemaValidator> extends infer ZodSchema\n ? InjectiveWithoutFunction<\n TypeboxSchema,\n ZodSchema\n > extends InjectiveWithoutFunction<ZodSchema, TypeboxSchema>\n ? true\n : false\n : false\n : false;\n\nexport enum DummyEnum {\n A = 'A',\n B = 'B'\n}\n"],"mappings":";AAAA,SAAS,sBAAsB;AAI/B;AAAA,EAEE,SAAS;AAAA,OACJ;AACP;AAAA,EAEE,SAAS;AAAA,OACJ;AAEA,SAAS,mBAGd,WAAc,eAAkB,UAAyC;AACzE,QAAM,iBAAiB,SAAS,WAAW,QAAQ;AACnD,QAAM,qBAAqB,aAAa,eAAe,QAAQ;AAE/D,QAAM,UACJ,KAAK;AAAA,IACH,eAAe,KACX;AAAA,MACE,eAAe;AAAA,IACjB,IACA;AAAA,EACN,MACA,KAAK;AAAA,IACH,mBAAmB,KAAK,eAAe,mBAAmB,KAAK,IAAI;AAAA,EACrE;AAEF,SAAO;AACT;AAyCO,IAAK,YAAL,kBAAKA,eAAL;AACL,EAAAA,WAAA,OAAI;AACJ,EAAAA,WAAA,OAAI;AAFM,SAAAA;AAAA,GAAA;","names":["DummyEnum"]}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@forklaunch/core",
|
3
|
-
"version": "0.7.
|
3
|
+
"version": "0.7.4",
|
4
4
|
"description": "forklaunch-js core package. Contains useful building blocks.",
|
5
5
|
"homepage": "https://github.com/forklaunch/forklaunch-js#readme",
|
6
6
|
"bugs": {
|
@@ -90,11 +90,11 @@
|
|
90
90
|
"pino-pretty": "^13.0.0",
|
91
91
|
"redis": "^4.7.0",
|
92
92
|
"uuid": "^11.1.0",
|
93
|
-
"@forklaunch/common": "0.2.
|
94
|
-
"@forklaunch/validator": "0.5.
|
93
|
+
"@forklaunch/common": "0.2.11",
|
94
|
+
"@forklaunch/validator": "0.5.4"
|
95
95
|
},
|
96
96
|
"devDependencies": {
|
97
|
-
"@eslint/js": "^9.
|
97
|
+
"@eslint/js": "^9.25.0",
|
98
98
|
"@scalar/express-api-reference": "^0.6.8",
|
99
99
|
"@types/cors": "^2.8.17",
|
100
100
|
"@types/jest": "^29.5.14",
|
@@ -107,7 +107,7 @@
|
|
107
107
|
"ts-jest": "^29.3.2",
|
108
108
|
"ts-node": "^10.9.2",
|
109
109
|
"tsup": "^8.4.0",
|
110
|
-
"typedoc": "^0.28.
|
110
|
+
"typedoc": "^0.28.3",
|
111
111
|
"typescript": "^5.8.3",
|
112
112
|
"typescript-eslint": "^8.30.1"
|
113
113
|
},
|