Skip to content
This repository was archived by the owner on Jan 2, 2024. It is now read-only.

Commit df42e51

Browse files
committed
feat: define Primitive (incl. Glob and Spatial ops), Range, Literal, Clause and all operator types as io-ts codecs for greater type safety.
These types can now be validated using the provided decoders by the client. BREAKING CHANGE: `Primitive` is now always an object, with an explicit type for its enclosed value. BREAKING CHANGE: `Range<T>` limited to range-able types only - namely numbers, strings, and dates and carries the type of its bounds (`valueType`). BREAKING CHANGE: `Spatial` is no longer a generic type, but instead has `op` and `geom` properties inside its `value`. BREAKING CHANGE: All composite query elements are now made of object Primitives and no longer include JavaScript primitives. BREAKING CHANGE: `Clause` type now enforces that its child terms have a single primitive type. BREAKING CHANGE: `Glob` literals only allowed for strings and dates. BREAKING CHANGE: Bare `TermValue`s are no longer `Clause`s. A new type `QueryElement` is the union of `Clause` and all `TermValue` types.
1 parent 1059032 commit df42e51

File tree

8 files changed

+869
-216
lines changed

8 files changed

+869
-216
lines changed

package.json

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
"clean.tests": "rm -rf *.lcov .nyc_output *.log coverage",
4646
"test:postinstall": "yarn clean && yarn build && yarn test-impl --grep='#e2e' --invert",
4747
"test": "yarn clean && yarn build && yarn test-impl",
48-
"test-impl": "nyc --reporter=text --reporter=lcov mocha",
48+
"test-impl": "nyc --reporter=lcov --reporter=text mocha",
4949
"test-impl-lcov": "nyc --reporter=lcov mocha",
5050
"test-coverage": "yarn test && yarn report-coverage",
5151
"report-coverage": "nyc report --reporter=json && codecov -F unit -f coverage/*.json",
@@ -99,23 +99,27 @@
9999
"spec": "./build/test/**/test-*.js"
100100
},
101101
"dependencies": {
102-
"terraformer-wkt-parser": "^1.2.0"
102+
"@holvonix-misc/geojson-iots": "^3.0.1",
103+
"fp-ts": "^2.0.4",
104+
"io-ts": "^2.0.1",
105+
"io-ts-types": "^0.5.0",
106+
"monocle-ts": "^2.0.0",
107+
"wkx": "^0.4.8"
103108
},
104109
"devDependencies": {
105110
"@holvonix-open/release-config-js": "^1.0.3",
106-
"@types/geojson": "^7946.0.7",
107111
"@types/mocha": "^5.2.5",
108112
"@types/nock": "^10.0.3",
109-
"@types/node": "^12.6.1",
113+
"@types/node": "^12.7.1",
110114
"chokidar-cli": "^2.0.0",
111115
"codecov": "^3.4.0",
112116
"concurrently": "^4.1.1",
113117
"gts": "^1.0.0",
118+
"io-ts-fuzzer": "^3.0.5",
114119
"mocha": "^6.1.4",
115120
"nock": "^10.0.6",
116121
"nyc": "^14.1.1",
117122
"source-map-support": "^0.5.12",
118-
"terraformer": "https://github.com/holvonix-open/terraformer#typesafety",
119123
"ts-mocha": "^6.0.0",
120124
"typescript": "~3.5.0"
121125
}

0 commit comments

Comments
 (0)