@bessemer/cornerstone 0.5.65 → 0.5.67

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 CHANGED
@@ -2,7 +2,7 @@ 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>(type: ZodType<T>) => ZodType<Bounds<T>>;
5
+ export declare const schema: <T extends ZodType>(type: T) => ZodType<Bounds<Zod.infer<T>>>;
6
6
  export type NumericBounds = Bounds<number>;
7
7
  export declare const NumericSchema: Zod.ZodType<Bounds<number>, unknown, Zod.core.$ZodTypeInternals<Bounds<number>, unknown>>;
8
8
  export type FiniteBounds<T> = [T, T];
@@ -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,CAAC,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,GAAG,IAAI,EAAE,KAAK,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAAA;AAE5E,eAAO,MAAM,MAAM,GAAI,CAAC,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,KAAG,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAE7D,CAAA;AAED,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC,MAAM,CAAC,CAAA;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AAC,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>(type: ZodType<T>): ZodType<Bounds<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,CAAI,SAAyC;AACjE,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":[]}
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,SAA2C;AACnF,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":[]}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@bessemer/cornerstone",
3
3
  "type": "module",
4
- "version": "0.5.65",
4
+ "version": "0.5.67",
5
5
  "module": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
7
7
  "sideEffects": false,
@@ -38,4 +38,4 @@
38
38
  "files": [
39
39
  "dist"
40
40
  ]
41
- }
41
+ }