Skip to content

Commit

Permalink
Adding NPM release github workflow. Updates to README and LICENSE.
Browse files Browse the repository at this point in the history
  • Loading branch information
smallsaucepan committed Jun 14, 2024
1 parent f3d3b48 commit 2ff667a
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 8 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/npm-publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: npm-publish
on:
release:
types: [published]

jobs:
npm-publish:
name: npm-publish
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: "20.x"
registry-url: "https://registry.npmjs.org"

- run: npm whoami
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- run: npm ci

- run: npm run build

- run: npm test

- run: npm publish --provenance --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
The MIT License (MIT)

Copyright (c) 2014 Gagan Bansal
Copyright 2024 James Beard

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand All @@ -19,4 +20,3 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

20 changes: 13 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@

Check two valid geojson geometries for equality.

## installation
This library is a fork of geojson-equality by Gagan Bansal (@gagan-bansal), ported to Typescript by Samir Shar (@solarissmoke). Published and maintained going forward by James Beard (@smallsaucepan).

## Installation

```
npm install geojson-equality-ts
```

## usage
## Usage

Use as either a class or function.

Expand Down Expand Up @@ -69,7 +71,9 @@ const g3 = {
eq.compare(g1, g3); // returns false
```

- **precision** number as floating points precision required. Defualt is **17**
## Options

**precision** _number_ floating point precision required. Defualt is **17**.

```javascript
const g1 = { type: "Point", coordinates: [30.2, 10] };
Expand All @@ -80,7 +84,7 @@ geojsonEquality(g1, g2, { precision: 3 }); // returns false
geojsonEquality(g1, g2, { precision: 1 }); // returns true
```

- **direction** true | false, direction of LineString or Polygon (orientation) is ignored if false. Default is **false**.
**direction** _boolean_ direction of LineString or Polygon (orientation) is ignored if false. Default is **false**.

```javascript
const g1 = {
Expand All @@ -105,15 +109,15 @@ geojsonEquality(g1, g2, { direction: false }); // returns true
geojsonEquality(g1, g2, { direction: true }); // returns false
```

- **objectComparator** **Temporarily disabled** function, custom function for use in comparing Feature properties. Default is a shallow comparison.
**objectComparator** _function_ custom function for use in comparing Feature properties. Default is a shallow comparison. **Temporarily disabled**

```javascript
// using lodash isEqual to deep comparison
const isEqual = require("lodash/lang/isEqual");
const eq = new GeojsonEquality({ objectComparator: isEqual });
```

## developing
## Developing

Once you run

Expand All @@ -127,6 +131,8 @@ to create build

`npm run build`

## license
PRs are welcome.

## License

This project is licensed under the terms of the MIT license.

0 comments on commit 2ff667a

Please sign in to comment.