@pgpm/geotypes 0.15.3 → 0.15.5
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/Makefile
CHANGED
package/README.md
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
<img height="20" src="https://github.com/constructive-io/pgpm-modules/actions/workflows/ci.yml/badge.svg" />
|
|
10
10
|
</a>
|
|
11
11
|
<a href="https://github.com/constructive-io/pgpm-modules/blob/main/LICENSE"><img height="20" src="https://img.shields.io/badge/license-MIT-blue.svg"/></a>
|
|
12
|
-
<a href="https://www.npmjs.com/package/@pgpm/geotypes"><img height="20" src="https://img.shields.io/github/package-json/v/constructive-io/pgpm-modules?filename=packages%
|
|
12
|
+
<a href="https://www.npmjs.com/package/@pgpm/geotypes"><img height="20" src="https://img.shields.io/github/package-json/v/constructive-io/pgpm-modules?filename=packages%2Fgeotypes%2Fpackage.json"/></a>
|
|
13
13
|
</p>
|
|
14
14
|
|
|
15
15
|
Geographic data types and spatial functions for PostgreSQL.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pgpm/geotypes",
|
|
3
|
-
"version": "0.15.
|
|
3
|
+
"version": "0.15.5",
|
|
4
4
|
"description": "Geographic data types and spatial functions for PostgreSQL",
|
|
5
5
|
"author": "Dan Lynch <pyramation@gmail.com>",
|
|
6
6
|
"contributors": [
|
|
@@ -21,11 +21,11 @@
|
|
|
21
21
|
"test:watch": "jest --watch"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@pgpm/types": "0.15.
|
|
25
|
-
"@pgpm/verify": "0.15.
|
|
24
|
+
"@pgpm/types": "0.15.5",
|
|
25
|
+
"@pgpm/verify": "0.15.5"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
|
-
"pgpm": "^1.
|
|
28
|
+
"pgpm": "^1.3.0"
|
|
29
29
|
},
|
|
30
30
|
"repository": {
|
|
31
31
|
"type": "git",
|
|
@@ -35,5 +35,5 @@
|
|
|
35
35
|
"bugs": {
|
|
36
36
|
"url": "https://github.com/constructive-io/pgpm-modules/issues"
|
|
37
37
|
},
|
|
38
|
-
"gitHead": "
|
|
38
|
+
"gitHead": "f6bbdfb20760e308b02968038b6f54191a9fd527"
|
|
39
39
|
}
|
package/pgpm-geo-types.control
CHANGED
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { getConnections, PgTestClient } from 'pgsql-test';
|
|
2
|
-
|
|
3
|
-
jest.setTimeout(15000);
|
|
4
|
-
|
|
5
|
-
let pg: PgTestClient;
|
|
6
|
-
let teardown: () => Promise<void>;
|
|
7
|
-
|
|
8
|
-
beforeAll(async () => {
|
|
9
|
-
({ pg, teardown } = await getConnections());
|
|
10
|
-
|
|
11
|
-
await pg.any(`
|
|
12
|
-
CREATE TABLE places (
|
|
13
|
-
id serial PRIMARY KEY,
|
|
14
|
-
loc geolocation,
|
|
15
|
-
area geopolygon
|
|
16
|
-
);
|
|
17
|
-
`);
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
afterAll(async () => {
|
|
21
|
-
await teardown();
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
describe('places table (geotypes)', () => {
|
|
25
|
-
it('inserts valid point and polygon', async () => {
|
|
26
|
-
await expect(pg.any(`
|
|
27
|
-
INSERT INTO places (loc, area)
|
|
28
|
-
VALUES (
|
|
29
|
-
ST_SetSRID(ST_MakePoint(-122.4194, 37.7749), 4326),
|
|
30
|
-
ST_SetSRID(
|
|
31
|
-
ST_GeomFromText('POLYGON((-122.5 37.7, -122.4 37.7, -122.4 37.8, -122.5 37.8, -122.5 37.7))'),
|
|
32
|
-
4326
|
|
33
|
-
)
|
|
34
|
-
);
|
|
35
|
-
`)).resolves.not.toThrow();
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
it('fails if point SRID is incorrect', async () => {
|
|
39
|
-
await expect(pg.any(`
|
|
40
|
-
INSERT INTO places (loc)
|
|
41
|
-
VALUES (
|
|
42
|
-
ST_SetSRID(ST_MakePoint(-122.4194, 37.7749), 3857)
|
|
43
|
-
);
|
|
44
|
-
`)).rejects.toThrow();
|
|
45
|
-
});
|
|
46
|
-
|
|
47
|
-
it('fails if polygon is invalid', async () => {
|
|
48
|
-
await expect(pg.any(`
|
|
49
|
-
INSERT INTO places (area)
|
|
50
|
-
VALUES (
|
|
51
|
-
ST_SetSRID(ST_GeomFromText('POLYGON((0 0, 1 1, 2 2))'), 4326)
|
|
52
|
-
);
|
|
53
|
-
`)).rejects.toThrow();
|
|
54
|
-
});
|
|
55
|
-
});
|
package/jest.config.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/** @type {import('ts-jest').JestConfigWithTsJest} */
|
|
2
|
-
module.exports = {
|
|
3
|
-
preset: 'ts-jest',
|
|
4
|
-
testEnvironment: 'node',
|
|
5
|
-
|
|
6
|
-
// Match both __tests__ and colocated test files
|
|
7
|
-
testMatch: ['**/?(*.)+(test|spec).{ts,tsx,js,jsx}'],
|
|
8
|
-
|
|
9
|
-
// Ignore build artifacts and type declarations
|
|
10
|
-
testPathIgnorePatterns: ['/dist/', '\\.d\\.ts$'],
|
|
11
|
-
modulePathIgnorePatterns: ['<rootDir>/dist/'],
|
|
12
|
-
watchPathIgnorePatterns: ['/dist/'],
|
|
13
|
-
|
|
14
|
-
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
|
|
15
|
-
};
|
|
File without changes
|