@bessemer/cornerstone 0.5.70 → 0.5.71
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/range.d.ts +2 -2
- package/dist/range.d.ts.map +1 -1
- package/dist/range.js.map +1 -1
- package/package.json +1 -1
package/dist/range.d.ts
CHANGED
@@ -2,9 +2,9 @@ import Zod, { ZodType } from 'zod';
|
|
2
2
|
import { TaggedType } from '@bessemer/cornerstone/types';
|
3
3
|
export type Bounds<T> = TaggedType<[T | null, T | null], 'Bounds'>;
|
4
4
|
export type BoundsInput<T> = [lower: T | null, upper?: T | null] | Bounds<T>;
|
5
|
-
export declare const schema: <T extends ZodType>(type: T) => ZodType<Bounds<Zod.infer<T>>>;
|
5
|
+
export declare const schema: <T extends ZodType>(type: T) => ZodType<Bounds<Zod.infer<T>>, Bounds<Zod.infer<T>>>;
|
6
6
|
export type NumericBounds = Bounds<number>;
|
7
|
-
export declare const NumericSchema: Zod.ZodType<Bounds<number>,
|
7
|
+
export declare const NumericSchema: Zod.ZodType<Bounds<number>, Bounds<number>, Zod.core.$ZodTypeInternals<Bounds<number>, Bounds<number>>>;
|
8
8
|
export type FiniteBounds<T> = [T, T];
|
9
9
|
export type FiniteNumericBounds = FiniteBounds<number>;
|
10
10
|
export declare const of: <T>(bounds: BoundsInput<T>) => Bounds<T>;
|
package/dist/range.d.ts.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"range.d.ts","sourceRoot":"","sources":["../src/range.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,EAAE,EAAE,OAAO,EAAE,MAAM,KAAK,CAAA;AAClC,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAA;AAIxD,MAAM,MAAM,MAAM,CAAC,CAAC,IAAI,UAAU,CAAC,CAAC,CAAC,GAAG,IAAI,EAAE,CAAC,GAAG,IAAI,CAAC,EAAE,QAAQ,CAAC,CAAA;AAClE,MAAM,MAAM,WAAW,C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,GAAI,CAAC,EAAE,QAAQ,WAAW,CAAC,CAAC,CAAC,KAAG,MAAM,CAAC,CAAC,CAMtD,CAAA"}
|
package/dist/range.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../src/range.ts"],"sourcesContent":["import Zod, { ZodType } from 'zod'\nimport { TaggedType } from '@bessemer/cornerstone/types'\nimport { isUndefined } from '@bessemer/cornerstone/object'\n\n// JOHN bounds are still a mess! what about finite bounds ???\nexport type Bounds<T> = TaggedType<[T | null, T | null], 'Bounds'>\nexport type BoundsInput<T> = [lower: T | null, upper?: T | null] | Bounds<T>\n\nexport const schema = <T extends ZodType>(type: T): ZodType<Bounds<Zod.infer<T>>> => {\n return Zod.tuple([type.nullable(), type.nullable()]) as any\n}\n\nexport type NumericBounds = Bounds<number>\nexport const NumericSchema = schema(Zod.number())\n\nexport type FiniteBounds<T> = [T, T]\nexport type FiniteNumericBounds = FiniteBounds<number>\n\nexport const of = <T>(bounds: BoundsInput<T>): Bounds<T> => {\n if (isUndefined(bounds[1])) {\n return [bounds[0], null] as Bounds<T>\n }\n\n return bounds as Bounds<T>\n}\n"],"mappings":";AAAA,OAAO,SAAsB;AAE7B,SAAS,mBAAmB;AAMrB,IAAM,SAAS,CAAoB,
|
1
|
+
{"version":3,"sources":["../src/range.ts"],"sourcesContent":["import Zod, { ZodType } from 'zod'\nimport { TaggedType } from '@bessemer/cornerstone/types'\nimport { isUndefined } from '@bessemer/cornerstone/object'\n\n// JOHN bounds are still a mess! what about finite bounds ???\nexport type Bounds<T> = TaggedType<[T | null, T | null], 'Bounds'>\nexport type BoundsInput<T> = [lower: T | null, upper?: T | null] | Bounds<T>\n\nexport const schema = <T extends ZodType>(type: T): ZodType<Bounds<Zod.infer<T>>, Bounds<Zod.infer<T>>> => {\n return Zod.tuple([type.nullable(), type.nullable()]) as any\n}\n\nexport type NumericBounds = Bounds<number>\nexport const NumericSchema = schema(Zod.number())\n\nexport type FiniteBounds<T> = [T, T]\nexport type FiniteNumericBounds = FiniteBounds<number>\n\nexport const of = <T>(bounds: BoundsInput<T>): Bounds<T> => {\n if (isUndefined(bounds[1])) {\n return [bounds[0], null] as Bounds<T>\n }\n\n return bounds as Bounds<T>\n}\n"],"mappings":";AAAA,OAAO,SAAsB;AAE7B,SAAS,mBAAmB;AAMrB,IAAM,SAAS,CAAoB,SAAiE;AACzG,SAAO,IAAI,MAAM,CAAC,KAAK,SAAS,GAAG,KAAK,SAAS,CAAC,CAAC;AACrD;AAGO,IAAM,gBAAgB,OAAO,IAAI,OAAO,CAAC;AAKzC,IAAM,KAAK,CAAI,WAAsC;AAC1D,MAAI,YAAY,OAAO,CAAC,CAAC,GAAG;AAC1B,WAAO,CAAC,OAAO,CAAC,GAAG,IAAI;AAAA,EACzB;AAEA,SAAO;AACT;","names":[]}
|