diff --git a/package-lock.json b/package-lock.json index cf3d06d..82badbe 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,7 +12,7 @@ "dependencies": { "@ehmpathy/error-fns": "1.3.7", "domain-glossaries": "1.0.0", - "domain-objects": "0.24.2", + "domain-glossary-geocode": "1.0.1", "type-fns": "1.19.0", "zipcodes": "8.0.0" }, @@ -8481,6 +8481,18 @@ "node": ">=8.0.0" } }, + "node_modules/domain-glossary-geocode": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/domain-glossary-geocode/-/domain-glossary-geocode-1.0.1.tgz", + "integrity": "sha512-4l86EcpYFdbSaldXGWWkmgY5NNg1g1jvKQoxDmMNXytSLt+lmFnCWGNNrcHd5RhK2jNtsnsBlAlsez2pABc27Q==", + "hasInstallScript": true, + "dependencies": { + "domain-objects": "0.24.2" + }, + "engines": { + "node": ">=8.0.0" + } + }, "node_modules/domain-objects": { "version": "0.24.2", "resolved": "https://registry.npmjs.org/domain-objects/-/domain-objects-0.24.2.tgz", diff --git a/package.json b/package.json index 53925a7..e342e42 100644 --- a/package.json +++ b/package.json @@ -50,7 +50,7 @@ "dependencies": { "@ehmpathy/error-fns": "1.3.7", "domain-glossaries": "1.0.0", - "domain-objects": "0.24.2", + "domain-glossary-geocode": "1.0.1", "type-fns": "1.19.0", "zipcodes": "8.0.0" }, diff --git a/readme.md b/readme.md index 9e3c4b2..0de579a 100644 --- a/readme.md +++ b/readme.md @@ -12,7 +12,7 @@ enable static-type checks for postcodes - `isPostcode` declare useful procedures to operate on postcodes -- e.g., `getGeocodeOfPostcode` +- e.g., `getCentroidOfPostcode` # install @@ -42,6 +42,6 @@ const postcode: Postcode = isPostcode.assure('33127'); ### get the geocode of a postcode ```ts -const centroid: Geocode = getGeocodeOfPostcode('33127') +const centroid: Geocode = getCentroidOfPostcode('33127') ``` diff --git a/src/domain/Geocode.ts b/src/domain/Geocode.ts deleted file mode 100644 index 7143bd4..0000000 --- a/src/domain/Geocode.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { DomainLiteral } from 'domain-objects'; - -// todo: spinout into own glossary: domain-glossary-geocode - -export interface Geocode { - latitude: number; - longitude: number; -} - -export class Geocode extends DomainLiteral implements Geocode {} diff --git a/src/getCendroidOfPostcode.ts b/src/getCentroidOfPostcode.ts similarity index 90% rename from src/getCendroidOfPostcode.ts rename to src/getCentroidOfPostcode.ts index 911d335..f8f9f56 100644 --- a/src/getCendroidOfPostcode.ts +++ b/src/getCentroidOfPostcode.ts @@ -1,7 +1,7 @@ import { UnexpectedCodePathError } from '@ehmpathy/error-fns'; +import { Geocode } from 'domain-glossary-geocode'; import zipcodes from 'zipcodes'; -import { Geocode } from './domain/Geocode'; import { Postcode } from './domain/Postcode'; export const getCentroidOfPostcode = (input: Postcode): Geocode => { diff --git a/src/index.ts b/src/index.ts new file mode 100644 index 0000000..7645eeb --- /dev/null +++ b/src/index.ts @@ -0,0 +1,2 @@ +export * from './domain/Postcode'; +export * from './getCentroidOfPostcode';