Skip to content

Commit

Permalink
Use named export for LocationConflation
Browse files Browse the repository at this point in the history
but preserve 'default' export for legacy consumers
(see #68)
  • Loading branch information
bhousel committed Sep 18, 2023
1 parent f4c509f commit 23b2e72
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 10 deletions.
4 changes: 3 additions & 1 deletion index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import precision from 'geojson-precision';
import prettyStringify from '@aitodotai/json-stringify-pretty-compact';


export default class {
export class LocationConflation {

// constructor
//
Expand Down Expand Up @@ -369,3 +369,5 @@ function _sortLocations(a, b) {
: (aRank < bRank) ? -1
: a.id.localeCompare(b.id);
}

export default LocationConflation;
6 changes: 3 additions & 3 deletions test/resolveLocation.test.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { test } from 'tap';
import LocationConflation from '../index.mjs';
import { LocationConflation } from '../index.mjs';

import features from './fixtures/features.json' assert {type: 'json'};
const loco = new LocationConflation(features);
const locoNS = new LocationConflation(features).strict(false);

const locoNS = new LocationConflation(features);
locoNS.strict = false;

test('resolveLocation', t => {

Expand Down
5 changes: 3 additions & 2 deletions test/resolveLocationSet.test.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { test } from 'tap';
import LocationConflation from '../index.mjs';
import { LocationConflation } from '../index.mjs';

import features from './fixtures/features.json' assert {type: 'json'};
const loco = new LocationConflation(features);
const locoNS = new LocationConflation(features).strict(false);
const locoNS = new LocationConflation(features);
locoNS.strict = false;


test('resolveLocationSet', t => {
Expand Down
5 changes: 3 additions & 2 deletions test/validateLocation.test.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { test } from 'tap';
import LocationConflation from '../index.mjs';
import { LocationConflation } from '../index.mjs';

import features from './fixtures/features.json' assert {type: 'json'};
const loco = new LocationConflation(features);
const locoNS = new LocationConflation(features).strict(false);
const locoNS = new LocationConflation(features);
locoNS.strict = false;


test('validateLocation', t => {
Expand Down
5 changes: 3 additions & 2 deletions test/validateLocationSet.test.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { test } from 'tap';
import LocationConflation from '../index.mjs';
import { LocationConflation } from '../index.mjs';

import features from './fixtures/features.json' assert {type: 'json'};
const loco = new LocationConflation(features);
const locoNS = new LocationConflation(features).strict(false);
const locoNS = new LocationConflation(features);
locoNS.strict = false;


test('validateLocationSet', t => {
Expand Down

0 comments on commit 23b2e72

Please sign in to comment.