Skip to content

Commit

Permalink
format and bump node version to pass auto test (#12)
Browse files Browse the repository at this point in the history
* fix security issues in dependency with npm audit fix

* added: isValid()

* case insensitive. remove redundant import.

* case insensitive. remove redundant import.

* Make isValid more efficient

* format to pass prettier check

* bump node test version as <14 is no longer supported

Co-authored-by: Perry Mitchell <perrymitchell@live.com>
  • Loading branch information
bluet and perry-mitchell committed Dec 31, 2022
1 parent 52de42c commit 726cd37
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Expand Up @@ -7,7 +7,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [10.x, 12.x, 14.x, 16.x]
node-version: [14.x, 16.x, 18.x]
steps:
- uses: actions/checkout@v2
- name: Node.js specs ${{ matrix.node-version }}
Expand All @@ -24,6 +24,6 @@ jobs:
- name: Formatting
uses: actions/setup-node@v1
with:
node-version: 14.x
node-version: 18.x
- run: npm ci
- run: npm run test:format
5 changes: 4 additions & 1 deletion source/ulid.ts
Expand Up @@ -246,6 +246,9 @@ export function isValid(id: string): boolean {
return (
typeof id === "string" &&
id.length === TIME_LEN + RANDOM_LEN &&
id.toUpperCase().split("").every(char => ENCODING.indexOf(char) !== -1)
id
.toUpperCase()
.split("")
.every(char => ENCODING.indexOf(char) !== -1)
);
}

0 comments on commit 726cd37

Please sign in to comment.