Skip to content

Commit

Permalink
Update CHANGELOG
Browse files Browse the repository at this point in the history
  • Loading branch information
ingalls committed Oct 11, 2023
1 parent 264f16f commit bfb01b8
Show file tree
Hide file tree
Showing 7 changed files with 244 additions and 178 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@

## Version History

### v4.4.0

- :bug: Cleaner error messages in the CLI
- :tada: Set `feature.id` as the OID field
- :bug: Fix double `f=json` when fetching metadata causing a failure

### v4.3.2

- :bug: Don't throw on metadata.fields not being present
Expand Down
4 changes: 2 additions & 2 deletions cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ const esri = new EsriDump(url, {

if (argv._[2] === 'fetch') {
esri.on('error', (err) => {
throw err;
console.error(err);
}).on('feature', (feature) => {
console.log(JSON.stringify(feature));
});
Expand All @@ -63,7 +63,7 @@ if (argv._[2] === 'fetch') {
console.log(JSON.stringify(await esri.schema(), null, 4));
} else if (argv._[2] === 'discover') {
esri.on('error', (err) => {
throw err;
console.error(err);
}).on('service', (service) => {
console.log(JSON.stringify(service));
}).on('layer', (layer) => {
Expand Down
1 change: 0 additions & 1 deletion index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@ export default class EsriDump extends EventEmitter {

async #fetchMeta() {
const url = new URL(this.url);
url.searchParams.append('f', 'json');

if (process.env.DEBUG) console.error(String(url));
const res = await Fetch(this.config, url);
Expand Down
1 change: 0 additions & 1 deletion lib/discovery.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import EventEmitter from 'node:events';
import Fetch from './fetch.js';
import { Feature } from 'geojson';
import { EsriDumpConfig } from '../index.js';
import Schema from './schema.js';

Expand Down
3 changes: 3 additions & 0 deletions lib/geometry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,12 +184,14 @@ export default class Geometry extends EventEmitter {
toGeoJSON(esrifeature: any): Feature {
if (this.geomType === 'esriGeometryPolygon') {
return {
id: esrifeature.attributes[this.oidField],
type: 'Feature',
properties: esrifeature.attributes,
geometry: rings2geojson(esrifeature.geometry.rings)
};
} else if (this.geomType === 'esriGeometryPolyline') {
return {
id: esrifeature.attributes[this.oidField],
type: 'Feature',
properties: esrifeature.attributes,
geometry: {
Expand All @@ -199,6 +201,7 @@ export default class Geometry extends EventEmitter {
};
} else if (this.geomType === 'esriGeometryPoint') {
return {
id: esrifeature.attributes[this.oidField],
type: 'Feature',
properties: esrifeature.attributes,
geometry: {
Expand Down
1 change: 0 additions & 1 deletion lib/schema.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import Err from '@openaddresses/batch-error';
import {
JSONSchema6,
JSONSchema6TypeName
Expand Down
406 changes: 233 additions & 173 deletions package-lock.json

Large diffs are not rendered by default.

0 comments on commit bfb01b8

Please sign in to comment.