Skip to content

Commit

Permalink
Update CHANGELOG
Browse files Browse the repository at this point in the history
  • Loading branch information
ingalls committed Nov 8, 2023
1 parent 814687e commit 6172586
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 8 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@

## Version History

### v5.1.0

- :tada: Add optional config parameter with `map` feature for modifying features with full `Geometry` context

### v5.0.0

- :tada: Support the `format` tag in the Schema for Dates
Expand Down
Empty file modified dist/cli.js
100755 → 100644
Empty file.
10 changes: 8 additions & 2 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 12 additions & 2 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,15 +89,20 @@ export default class EsriDump extends EventEmitter {
}
}

async fetch() {
async fetch(config?: {
map?: (g: Geometry, f: Feature) => Feature
}) {
if (!config) config = {};
const metadata = await this.#fetchMeta();

try {
const geom = new Geometry(this.url, metadata);
geom.fetch(this.config);

geom.on('feature', (feature: Feature) => {
this.emit('feature', rewind(feature));
feature = rewind(feature) as Feature;
if (config.map) feature = config.map(geom, feature);
this.emit('feature', feature);
}).on('error', (error: Err) => {
this.emit('error', error);
}).on('done', () => {
Expand Down Expand Up @@ -160,3 +165,8 @@ export default class EsriDump extends EventEmitter {
return metadata;
}
}

export {
Geometry
}

6 changes: 3 additions & 3 deletions test/schema.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ test('FeatureServer Schema', async (t) => {
objectid: { type: 'number' },
rotation: { type: 'integer' },
description: { type: 'string', maxLength: 75 },
eventdate: { type: 'string', maxLength: 8 },
eventdate: { type: 'string', format: 'date-time', maxLength: 8 },
eventtype: { type: 'integer' },
created_user: { type: 'string', maxLength: 255 },
created_date: { type: 'string', maxLength: 8 },
created_date: { type: 'string', format: 'date-time', maxLength: 8 },
last_edited_user: { type: 'string', maxLength: 255 },
last_edited_date: { type: 'string', maxLength: 8 }
last_edited_date: { type: 'string', format: 'date-time', maxLength: 8 }
}
});

Expand Down

0 comments on commit 6172586

Please sign in to comment.