@tileflow/static 0.1.0-alpha.1 → 0.1.0-alpha.11

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.
Files changed (2) hide show
  1. package/dist/index.js +9 -1
  2. package/package.json +3 -1
package/dist/index.js CHANGED
@@ -70,8 +70,16 @@ var markerOverlaySchema = z.object({
70
70
  strokeWidth: z.number().finite().min(0).max(16).default(2),
71
71
  type: z.literal("marker")
72
72
  });
73
+ var polygonRingSchema = z.array(coordinateSchema).min(4).max(staticSceneLimits.maxPathCoordinates).refine(
74
+ (ring) => {
75
+ const first = ring[0];
76
+ const last = ring[ring.length - 1];
77
+ return Boolean(first && last && first[0] === last[0] && first[1] === last[1]);
78
+ },
79
+ { message: "Polygon rings must end at their starting coordinate" }
80
+ );
73
81
  var polygonOverlaySchema = z.object({
74
- coordinates: z.array(z.array(coordinateSchema).min(4).max(staticSceneLimits.maxPathCoordinates)).min(1).max(16),
82
+ coordinates: z.array(polygonRingSchema).min(1).max(16),
75
83
  fill: colorSchema.default("#C6A15B"),
76
84
  id: z.string().trim().min(1).max(64).optional(),
77
85
  opacity: z.number().finite().min(0).max(1).default(0.28),
package/package.json CHANGED
@@ -1,8 +1,9 @@
1
1
  {
2
2
  "name": "@tileflow/static",
3
- "version": "0.1.0-alpha.1",
3
+ "version": "0.1.0-alpha.11",
4
4
  "description": "Static map request schemas and helpers for Tileflow.",
5
5
  "type": "module",
6
+ "sideEffects": false,
6
7
  "homepage": "https://tileflow.dev",
7
8
  "repository": {
8
9
  "type": "git",
@@ -39,6 +40,7 @@
39
40
  },
40
41
  "scripts": {
41
42
  "build": "tsup src/index.ts --format esm --dts --clean",
43
+ "verify": "tsx --test test/*.test.ts",
42
44
  "typecheck": "tsc -p tsconfig.json --noEmit",
43
45
  "lint": "tsc -p tsconfig.json --noEmit"
44
46
  }