@wemap/osm 3.1.21 → 3.2.1

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/index.js CHANGED
@@ -1,8 +1,8 @@
1
- import OsmModel from './src/model/OsmModel';
2
- import OsmNetwork from './src/network/OsmNetwork';
3
- import OsmParser from './src/model/OsmParser';
4
- import OsmRouter from './src/network/OsmRouter';
5
- import OsrmUtils from './src/osrm/OsrmUtils';
1
+ import OsmModel from './src/model/OsmModel.js';
2
+ import OsmNetwork from './src/network/OsmNetwork.js';
3
+ import OsmParser from './src/model/OsmParser.js';
4
+ import OsmRouter from './src/network/OsmRouter.js';
5
+ import OsrmUtils from './src/osrm/OsrmUtils.js';
6
6
 
7
7
  export {
8
8
  OsmModel,
package/package.json CHANGED
@@ -11,14 +11,13 @@
11
11
  "directory": "packages/osm"
12
12
  },
13
13
  "name": "@wemap/osm",
14
- "version": "3.1.21",
14
+ "version": "3.2.1",
15
15
  "bugs": {
16
16
  "url": "https://github.com/wemap/wemap-modules-js/issues"
17
17
  },
18
18
  "homepage": "https://github.com/wemap/wemap-modules-js#readme",
19
- "scripts": {
20
- "test": "mocha -r esm \"src/**/*.spec.js\""
21
- },
19
+ "scripts": {},
20
+ "type": "module",
22
21
  "keywords": [
23
22
  "utils",
24
23
  "osm",
@@ -26,11 +25,11 @@
26
25
  ],
27
26
  "license": "ISC",
28
27
  "dependencies": {
29
- "@wemap/geo": "^3.1.21",
30
- "@wemap/graph": "^3.1.21",
31
- "@wemap/logger": "^3.0.0",
32
- "@wemap/maths": "^3.1.15",
28
+ "@wemap/geo": "^3.2.1",
29
+ "@wemap/graph": "^3.2.1",
30
+ "@wemap/logger": "^3.2.1",
31
+ "@wemap/maths": "^3.2.1",
33
32
  "sax": "^1.2.4"
34
33
  },
35
- "gitHead": "17f72afdcf6098bf90d3dffc2cf0b15f9284d4d4"
34
+ "gitHead": "0d430815358a23068c8473b2c310b2945667b2c1"
36
35
  }
@@ -1,6 +1,8 @@
1
- import { expect } from 'chai';
1
+ import chai from 'chai';
2
2
 
3
- import OsmElement from './OsmElement';
3
+ import OsmElement from './OsmElement.js';
4
+
5
+ const { expect } = chai;
4
6
 
5
7
  describe('OsmElement', () => {
6
8
 
@@ -1,14 +1,16 @@
1
- import { expect } from 'chai';
1
+ import chai from 'chai';
2
2
 
3
3
  import { Coordinates } from '@wemap/geo';
4
4
  import Logger from '@wemap/logger';
5
5
 
6
- import OsmModel from './OsmModel';
7
- import OsmNode from './OsmNode';
8
- import OsmWay from './OsmWay';
6
+ import OsmModel from './OsmModel.js';
7
+ import OsmNode from './OsmNode.js';
8
+ import OsmWay from './OsmWay.js';
9
9
 
10
10
  Logger.enable(false);
11
11
 
12
+ const { expect } = chai;
13
+
12
14
  describe('OsmModel', () => {
13
15
 
14
16
  const nodes = [
@@ -1,4 +1,4 @@
1
- import OsmElement from './OsmElement';
1
+ import OsmElement from './OsmElement.js';
2
2
 
3
3
  class OsmNode extends OsmElement {
4
4
 
@@ -1,8 +1,10 @@
1
- import { expect } from 'chai';
1
+ import chai from 'chai';
2
2
 
3
3
  import { Coordinates } from '@wemap/geo';
4
4
 
5
- import OsmNode from './OsmNode';
5
+ import OsmNode from './OsmNode.js';
6
+
7
+ const { expect } = chai;
6
8
 
7
9
  describe('OsmNode', () => {
8
10
 
@@ -5,9 +5,9 @@ import {
5
5
  Level, Coordinates
6
6
  } from '@wemap/geo';
7
7
 
8
- import OsmModel from './OsmModel';
9
- import OsmNode from './OsmNode';
10
- import OsmWay from './OsmWay';
8
+ import OsmModel from './OsmModel.js';
9
+ import OsmNode from './OsmNode.js';
10
+ import OsmWay from './OsmWay.js';
11
11
 
12
12
  class OsmParser {
13
13
 
@@ -1,10 +1,14 @@
1
- import { expect } from 'chai';
1
+ import chai from 'chai';
2
2
  import fs from 'fs';
3
3
  import path from 'path';
4
+ import { fileURLToPath } from 'url';
4
5
 
5
6
  import { Level } from '@wemap/geo';
6
7
 
7
- import OsmParser from './OsmParser';
8
+ import OsmParser from './OsmParser.js';
9
+
10
+ const { expect } = chai;
11
+ const __dirname = path.dirname(fileURLToPath(import.meta.url));
8
12
 
9
13
  describe('OsmParser', () => {
10
14
 
@@ -1,4 +1,4 @@
1
- import OsmElement from './OsmElement';
1
+ import OsmElement from './OsmElement.js';
2
2
 
3
3
  class OsmWay extends OsmElement {
4
4
 
@@ -1,7 +1,9 @@
1
1
  /* eslint-disable max-statements */
2
- import { expect } from 'chai';
2
+ import chai from 'chai';
3
3
 
4
- import OsmWay from './OsmWay';
4
+ import OsmWay from './OsmWay.js';
5
+
6
+ const { expect } = chai;
5
7
 
6
8
  describe('OsmNode', () => {
7
9
 
@@ -1,10 +1,14 @@
1
1
  /* eslint-disable max-statements */
2
- import { expect } from 'chai';
2
+ import chai from 'chai';
3
3
  import fs from 'fs';
4
4
  import path from 'path';
5
+ import { fileURLToPath } from 'url';
5
6
 
6
- import OsmParser from '../model/OsmParser';
7
- import OsmNetwork from './OsmNetwork';
7
+ import OsmParser from '../model/OsmParser.js';
8
+ import OsmNetwork from './OsmNetwork.js';
9
+
10
+ const { expect } = chai;
11
+ const __dirname = path.dirname(fileURLToPath(import.meta.url));
8
12
 
9
13
 
10
14
  const loadFile = fileName => {
@@ -1,16 +1,20 @@
1
1
  /* eslint-disable max-statements */
2
- import { expect } from 'chai';
2
+ import chai from 'chai';
3
3
  import fs from 'fs';
4
4
  import path from 'path';
5
+ import { fileURLToPath } from 'url';
5
6
 
6
7
  import {
7
8
  Level, Coordinates
8
9
  } from '@wemap/geo';
9
10
  import { Node } from '@wemap/graph';
10
11
 
11
- import OsmParser from '../model/OsmParser';
12
- import OsmRouter from './OsmRouter';
13
- import OsmNetwork from './OsmNetwork';
12
+ import OsmParser from '../model/OsmParser.js';
13
+ import OsmRouter from './OsmRouter.js';
14
+ import OsmNetwork from './OsmNetwork.js';
15
+
16
+ const { expect } = chai;
17
+ const __dirname = path.dirname(fileURLToPath(import.meta.url));
14
18
 
15
19
  const itineraryStart = new Coordinates(43.6092754, 3.8842306, null, new Level(2));
16
20
  const itineraryEnd = new Coordinates(43.6092602, 3.8842669, null, new Level(1));
@@ -9,8 +9,8 @@ import {
9
9
  rad2deg, Utils as MathUtils, diffAngle, deg2rad
10
10
  } from '@wemap/maths';
11
11
 
12
- import OsmNode from '../model/OsmNode';
13
- import OsmWay from '../model/OsmWay';
12
+ import OsmNode from '../model/OsmNode.js';
13
+ import OsmWay from '../model/OsmWay.js';
14
14
 
15
15
 
16
16
  class OsrmUtils {
@@ -1,19 +1,23 @@
1
1
  /* eslint-disable max-statements */
2
- import { expect } from 'chai';
2
+ import chai from 'chai';
3
3
  import fs from 'fs';
4
4
  import path from 'path';
5
+ import { fileURLToPath } from 'url';
5
6
 
6
7
  import {
7
8
  Level, Coordinates
8
9
  } from '@wemap/geo';
9
10
  import { Edge } from '@wemap/graph';
10
11
 
11
- import OsmParser from '../model/OsmParser';
12
- import OsmRouter from '../network/OsmRouter';
13
- import OsmNetwork from '../network/OsmNetwork';
14
- import OsrmUtils from './OsrmUtils';
15
- import OsmNode from '../model/OsmNode';
16
- import OsmWay from '../model/OsmWay';
12
+ import OsmParser from '../model/OsmParser.js';
13
+ import OsmRouter from '../network/OsmRouter.js';
14
+ import OsmNetwork from '../network/OsmNetwork.js';
15
+ import OsrmUtils from './OsrmUtils.js';
16
+ import OsmNode from '../model/OsmNode.js';
17
+ import OsmWay from '../model/OsmWay.js';
18
+
19
+ const { expect } = chai;
20
+ const __dirname = path.dirname(fileURLToPath(import.meta.url));
17
21
 
18
22
 
19
23
  const load = fileName => {