@infra-blocks/zod-utils 0.3.0-alpha.0 → 0.4.0-alpha.0
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 +150 -10
- package/lib/cjs/geojson/base.d.ts +8 -0
- package/lib/cjs/geojson/base.js +9 -0
- package/lib/cjs/geojson/base.js.map +1 -0
- package/lib/cjs/geojson/bounding-box.d.ts +5 -0
- package/lib/cjs/geojson/bounding-box.js +27 -0
- package/lib/cjs/geojson/bounding-box.js.map +1 -0
- package/lib/cjs/geojson/coordinate.d.ts +5 -0
- package/lib/cjs/geojson/coordinate.js +16 -0
- package/lib/cjs/geojson/coordinate.js.map +1 -0
- package/lib/cjs/geojson/feature-collection.d.ts +657 -0
- package/lib/cjs/geojson/feature-collection.js +15 -0
- package/lib/cjs/geojson/feature-collection.js.map +1 -0
- package/lib/cjs/geojson/feature.d.ts +397 -0
- package/lib/cjs/geojson/feature.js +18 -0
- package/lib/cjs/geojson/feature.js.map +1 -0
- package/lib/cjs/geojson/geojson.d.ts +1193 -0
- package/lib/cjs/geojson/geojson.js +13 -0
- package/lib/cjs/geojson/geojson.js.map +1 -0
- package/lib/cjs/geojson/geometry.d.ts +155 -0
- package/lib/cjs/geojson/geometry.js +33 -0
- package/lib/cjs/geojson/geometry.js.map +1 -0
- package/lib/cjs/geojson/index.d.ts +622 -0
- package/lib/cjs/geojson/index.js +34 -0
- package/lib/cjs/geojson/index.js.map +1 -0
- package/lib/cjs/geojson/line-string.d.ts +29 -0
- package/lib/cjs/geojson/line-string.js +15 -0
- package/lib/cjs/geojson/line-string.js.map +1 -0
- package/lib/cjs/geojson/multi-line-string.d.ts +29 -0
- package/lib/cjs/geojson/multi-line-string.js +15 -0
- package/lib/cjs/geojson/multi-line-string.js.map +1 -0
- package/lib/cjs/geojson/multi-point.d.ts +29 -0
- package/lib/cjs/geojson/multi-point.js +15 -0
- package/lib/cjs/geojson/multi-point.js.map +1 -0
- package/lib/cjs/geojson/multi-polygon.d.ts +29 -0
- package/lib/cjs/geojson/multi-polygon.js +15 -0
- package/lib/cjs/geojson/multi-polygon.js.map +1 -0
- package/lib/cjs/geojson/point.d.ts +29 -0
- package/lib/cjs/geojson/point.js +15 -0
- package/lib/cjs/geojson/point.js.map +1 -0
- package/lib/cjs/geojson/polygon.d.ts +29 -0
- package/lib/cjs/geojson/polygon.js +15 -0
- package/lib/cjs/geojson/polygon.js.map +1 -0
- package/lib/cjs/geojson/types.d.ts +12 -0
- package/lib/cjs/geojson/types.js +3 -0
- package/lib/cjs/geojson/types.js.map +1 -0
- package/lib/cjs/index.d.ts +608 -0
- package/lib/cjs/index.js +2 -0
- package/lib/cjs/index.js.map +1 -1
- package/lib/esm/geojson/base.d.ts +8 -0
- package/lib/esm/geojson/base.js +6 -0
- package/lib/esm/geojson/base.js.map +1 -0
- package/lib/esm/geojson/bounding-box.d.ts +5 -0
- package/lib/esm/geojson/bounding-box.js +23 -0
- package/lib/esm/geojson/bounding-box.js.map +1 -0
- package/lib/esm/geojson/coordinate.d.ts +5 -0
- package/lib/esm/geojson/coordinate.js +12 -0
- package/lib/esm/geojson/coordinate.js.map +1 -0
- package/lib/esm/geojson/feature-collection.d.ts +657 -0
- package/lib/esm/geojson/feature-collection.js +11 -0
- package/lib/esm/geojson/feature-collection.js.map +1 -0
- package/lib/esm/geojson/feature.d.ts +397 -0
- package/lib/esm/geojson/feature.js +14 -0
- package/lib/esm/geojson/feature.js.map +1 -0
- package/lib/esm/geojson/geojson.d.ts +1193 -0
- package/lib/esm/geojson/geojson.js +9 -0
- package/lib/esm/geojson/geojson.js.map +1 -0
- package/lib/esm/geojson/geometry.d.ts +155 -0
- package/lib/esm/geojson/geometry.js +28 -0
- package/lib/esm/geojson/geometry.js.map +1 -0
- package/lib/esm/geojson/index.d.ts +622 -0
- package/lib/esm/geojson/index.js +31 -0
- package/lib/esm/geojson/index.js.map +1 -0
- package/lib/esm/geojson/line-string.d.ts +29 -0
- package/lib/esm/geojson/line-string.js +11 -0
- package/lib/esm/geojson/line-string.js.map +1 -0
- package/lib/esm/geojson/multi-line-string.d.ts +29 -0
- package/lib/esm/geojson/multi-line-string.js +11 -0
- package/lib/esm/geojson/multi-line-string.js.map +1 -0
- package/lib/esm/geojson/multi-point.d.ts +29 -0
- package/lib/esm/geojson/multi-point.js +11 -0
- package/lib/esm/geojson/multi-point.js.map +1 -0
- package/lib/esm/geojson/multi-polygon.d.ts +29 -0
- package/lib/esm/geojson/multi-polygon.js +11 -0
- package/lib/esm/geojson/multi-polygon.js.map +1 -0
- package/lib/esm/geojson/point.d.ts +29 -0
- package/lib/esm/geojson/point.js +11 -0
- package/lib/esm/geojson/point.js.map +1 -0
- package/lib/esm/geojson/polygon.d.ts +29 -0
- package/lib/esm/geojson/polygon.js +11 -0
- package/lib/esm/geojson/polygon.js.map +1 -0
- package/lib/esm/geojson/types.d.ts +12 -0
- package/lib/esm/geojson/types.js +2 -0
- package/lib/esm/geojson/types.js.map +1 -0
- package/lib/esm/index.d.ts +608 -0
- package/lib/esm/index.js +2 -0
- package/lib/esm/index.js.map +1 -1
- package/package.json +8 -1
package/lib/cjs/index.js
CHANGED
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.zu = void 0;
|
|
4
4
|
const index_js_1 = require("./json/index.js");
|
|
5
|
+
const index_js_2 = require("./geojson/index.js");
|
|
5
6
|
const zu = {
|
|
7
|
+
geojson: index_js_2.geojson,
|
|
6
8
|
json: index_js_1.json,
|
|
7
9
|
};
|
|
8
10
|
exports.zu = zu;
|
package/lib/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AAAA,8CAAuC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AAAA,8CAAuC;AACvC,iDAA6C;AAE7C,MAAM,EAAE,GAAG;IACT,OAAO,EAAP,kBAAO;IACP,IAAI,EAAJ,eAAI;CACL,CAAC;AAEO,gBAAE"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const schemaWithBoundingBox: z.ZodObject<{
|
|
3
|
+
bbox: z.ZodOptional<z.ZodUnion<[z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber, z.ZodNumber], null>, z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber, z.ZodNumber, z.ZodNumber, z.ZodNumber], null>]>>;
|
|
4
|
+
}, "strict", z.ZodTypeAny, {
|
|
5
|
+
bbox?: [number, number, number, number] | [number, number, number, number, number, number] | undefined;
|
|
6
|
+
}, {
|
|
7
|
+
bbox?: [number, number, number, number] | [number, number, number, number, number, number] | undefined;
|
|
8
|
+
}>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base.js","sourceRoot":"","sources":["../../../src/geojson/base.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC,YAAY,CAAC;IAClD,IAAI,EAAE,WAAW,EAAE,CAAC,QAAQ,EAAE;CAC/B,CAAC,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
declare const boundingBoxSchema: z.ZodUnion<[z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber, z.ZodNumber], null>, z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber, z.ZodNumber, z.ZodNumber, z.ZodNumber], null>]>;
|
|
3
|
+
export type GeoJsonBoundingBox = z.infer<typeof boundingBoxSchema>;
|
|
4
|
+
export declare function boundingBox(): z.ZodUnion<[z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber, z.ZodNumber], null>, z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber, z.ZodNumber, z.ZodNumber, z.ZodNumber], null>]>;
|
|
5
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
const twoDimensionalBoundingBox = z.tuple([
|
|
3
|
+
z.number(),
|
|
4
|
+
z.number(),
|
|
5
|
+
z.number(),
|
|
6
|
+
z.number(),
|
|
7
|
+
]);
|
|
8
|
+
const threeDimensionalBoundingBox = z.tuple([
|
|
9
|
+
z.number(),
|
|
10
|
+
z.number(),
|
|
11
|
+
z.number(),
|
|
12
|
+
z.number(),
|
|
13
|
+
z.number(),
|
|
14
|
+
z.number(),
|
|
15
|
+
]);
|
|
16
|
+
const boundingBoxSchema = z.union([
|
|
17
|
+
twoDimensionalBoundingBox,
|
|
18
|
+
threeDimensionalBoundingBox,
|
|
19
|
+
]);
|
|
20
|
+
export function boundingBox() {
|
|
21
|
+
return boundingBoxSchema;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=bounding-box.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bounding-box.js","sourceRoot":"","sources":["../../../src/geojson/bounding-box.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC;IACxC,CAAC,CAAC,MAAM,EAAE;IACV,CAAC,CAAC,MAAM,EAAE;IACV,CAAC,CAAC,MAAM,EAAE;IACV,CAAC,CAAC,MAAM,EAAE;CACX,CAAC,CAAC;AAEH,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAAC;IAC1C,CAAC,CAAC,MAAM,EAAE;IACV,CAAC,CAAC,MAAM,EAAE;IACV,CAAC,CAAC,MAAM,EAAE;IACV,CAAC,CAAC,MAAM,EAAE;IACV,CAAC,CAAC,MAAM,EAAE;IACV,CAAC,CAAC,MAAM,EAAE;CACX,CAAC,CAAC;AAEH,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC;IAChC,yBAAyB;IACzB,2BAA2B;CAC5B,CAAC,CAAC;AAIH,MAAM,UAAU,WAAW;IACzB,OAAO,iBAAiB,CAAC;AAC3B,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
declare const schema: z.ZodUnion<[z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>, z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber], null>]>;
|
|
3
|
+
export type GeoJsonCoordinate = z.infer<typeof schema>;
|
|
4
|
+
export declare function coordinate(): z.ZodUnion<[z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>, z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber], null>]>;
|
|
5
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
const twoDimensionalCoordinate = z.tuple([z.number(), z.number()]);
|
|
3
|
+
const threeDimensionalCoordinate = z.tuple([
|
|
4
|
+
z.number(),
|
|
5
|
+
z.number(),
|
|
6
|
+
z.number(),
|
|
7
|
+
]);
|
|
8
|
+
const schema = z.union([twoDimensionalCoordinate, threeDimensionalCoordinate]);
|
|
9
|
+
export function coordinate() {
|
|
10
|
+
return schema;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=coordinate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"coordinate.js","sourceRoot":"","sources":["../../../src/geojson/coordinate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;AACnE,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC;IACzC,CAAC,CAAC,MAAM,EAAE;IACV,CAAC,CAAC,MAAM,EAAE;IACV,CAAC,CAAC,MAAM,EAAE;CACX,CAAC,CAAC;AAEH,MAAM,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,wBAAwB,EAAE,0BAA0B,CAAC,CAAC,CAAC;AAI/E,MAAM,UAAU,UAAU;IACxB,OAAO,MAAM,CAAC;AAChB,CAAC"}
|