Skip to content

Commit

Permalink
safely access copy (#69)
Browse files Browse the repository at this point in the history
* safely access copy

* Update package.json

* add node 20 to unit tests

* upgrade github actions
  • Loading branch information
RayStroud authored May 21, 2024
1 parent 982cf21 commit ec6df2d
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 14 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/cd-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ jobs:
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: npm install
run: npm install
- name: Upload built artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: artifacts
path: src/
Expand All @@ -25,14 +25,14 @@ jobs:
name: publish to github packages
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Download built artifact
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: artifacts
path: src
- name: Setup Node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
registry-url: 'https://npm.pkg.github.com'
Expand All @@ -47,14 +47,14 @@ jobs:
name: publish to npm
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Download built artifact
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: artifacts
path: src
- name: Setup Node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
registry-url: 'https://registry.npmjs.org'
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/ci-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ jobs:
strategy:
matrix:
os: [windows-latest, macos-latest, ubuntu-latest]
node-version: ['16', '18']
node-version: ['16', '18', '20']
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@amaabca/sensitive-param-filter",
"version": "1.2.8",
"version": "1.2.9",
"description": "A package for filtering sensitive data (parameters, keys) from a variety of JS objects",
"main": "src/index.js",
"author": "Alberta Motor Association",
Expand Down
5 changes: 3 additions & 2 deletions src/sensitiveParamFilter.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,9 @@ class SensitiveParamFilter {
return input
}
const id = input[circularReferenceKey]
if (id || id === 0) {
return this.examinedObjects[id].copy
const copy = this.examinedObjects && this.examinedObjects[id] && this.examinedObjects[id].copy
if (copy) {
return copy
}

if (typeof input === 'string' || input instanceof String) {
Expand Down

0 comments on commit ec6df2d

Please sign in to comment.