monopolyline 0.0.2 → 0.0.3

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 CHANGED
@@ -58,6 +58,9 @@ export type FieldType = 'decimal' | 'integer';
58
58
  export type Schema =
59
59
  | { type: 'object'; fields: Record<string, FieldType> }
60
60
  | { type: 'tuple'; fields: FieldType[] };
61
+
62
+ // The library also provides default schemas for basic lat/lng
63
+ import { DEFAULT_SCHEMA, DEFAULT_TUPLE_SCHEMA } from 'monopolyline';
61
64
  ```
62
65
 
63
66
  ### Object Schema
package/index.ts CHANGED
@@ -4,6 +4,19 @@ export type Schema =
4
4
  | { type: 'object'; fields: Record<string, FieldType> }
5
5
  | { type: 'tuple'; fields: FieldType[] };
6
6
 
7
+ export const DEFAULT_SCHEMA: Schema = {
8
+ type: 'object',
9
+ fields: {
10
+ lat: 'decimal',
11
+ lng: 'decimal'
12
+ }
13
+ };
14
+
15
+ export const DEFAULT_TUPLE_SCHEMA: Schema = {
16
+ type: 'tuple',
17
+ fields: ['decimal', 'decimal']
18
+ };
19
+
7
20
  export interface Point {
8
21
  lat: number;
9
22
  lng: number;
Binary file
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "monopolyline",
3
- "version": "0.0.2",
3
+ "version": "0.0.3",
4
4
  "description": "An extended Google Polyline encoder/decoder supporting timestamps, accuracy, and sparse data strategies.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -20,4 +20,4 @@
20
20
  "typescript": "^5.0.0",
21
21
  "bun-types": "latest"
22
22
  }
23
- }
23
+ }