Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
root = true

[*]
charset = utf-8
end_of_line = lf
indent_size = 2
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true
quote_type = single
2 changes: 0 additions & 2 deletions .eslintignore

This file was deleted.

11 changes: 0 additions & 11 deletions .eslintrc.yml

This file was deleted.

99 changes: 16 additions & 83 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,93 +1,26 @@
name: ci

name: CI
on:
push:
branches:
- master
paths-ignore:
- '*.md'
pull_request:
paths-ignore:
- '*.md'

- push
- pull_request
permissions:
contents: read

jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6

- name: Install Node.js
uses: actions/setup-node@v6
with:
node-version: 'lts/*'

- name: Install Node.js dependencies
run: npm install --ignore-scripts --include=dev

- name: Lint code
run: npm run lint

test:
name: Test - Node.js ${{ matrix.node-version }}
test:
name: Node.js ${{ matrix.node-version }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
# Node.js release schedule: https://nodejs.org/en/about/releases/
node-version: [18, 19, 20, 21, 22, 23, 24, 25]
steps:
- uses: actions/checkout@v6

- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node-version }}

- name: Install Node.js dependencies
run: npm install

- name: Output Node and NPM versions
run: |
echo "Node.js version: $(node -v)"
echo "NPM version: $(npm -v)"

- name: Run tests
run: npm run test-ci

- name: Upload code coverage
uses: actions/upload-artifact@v5
with:
name: coverage-node-${{ matrix.node-version }}
path: ./coverage/lcov.info
retention-days: 1

coverage:
name: Coverage
needs: test
runs-on: ubuntu-latest
permissions:
contents: read
checks: write
matrix:
node-version:
- 18
- '*'
steps:
- uses: actions/checkout@v6

- name: Install lcov
run: sudo apt-get -y install lcov

- name: Collect coverage reports
uses: actions/download-artifact@v6
- uses: actions/setup-node@v6
with:
path: ./coverage
pattern: coverage-node-*

- name: Merge coverage reports
run: find ./coverage -name lcov.info -exec printf '-a %q\n' {} \; | xargs lcov -o ./lcov.info

- name: Upload coverage report
uses: coverallsapp/github-action@v2
node-version: ${{ matrix.node-version }}
- run: npm install
- run: npm test
- uses: codecov/codecov-action@v5
with:
file: ./lcov.info
name: Node.js ${{ matrix.node-version }}
token: ${{ secrets.CODECOV_TOKEN }}
10 changes: 5 additions & 5 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"
name: 'CodeQL'

on:
push:
branches: ["master"]
branches: ['master']
pull_request:
# The branches below must be a subset of the branches above
branches: ["master"]
branches: ['master']
schedule:
- cron: "0 0 * * 1"
- cron: '0 0 * * 1'

permissions:
contents: read
Expand Down Expand Up @@ -63,4 +63,4 @@ jobs:
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v4
with:
category: "/language:javascript"
category: '/language:javascript'
12 changes: 6 additions & 6 deletions .github/workflows/scorecard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:
schedule:
- cron: '16 21 * * 1'
push:
branches: [ "master" ]
branches: ['master']

# Declare default permissions as read only.
permissions: read-all
Expand All @@ -31,12 +31,12 @@ jobs:
# actions: read

steps:
- name: "Checkout code"
- name: 'Checkout code'
uses: actions/checkout@v6
with:
persist-credentials: false

- name: "Run analysis"
- name: 'Run analysis'
uses: ossf/scorecard-action@v2.4.3
with:
results_file: results.sarif
Expand All @@ -58,15 +58,15 @@ jobs:

# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
# format to the repository Actions tab.
- name: "Upload artifact"
- name: 'Upload artifact'
uses: actions/upload-artifact@v6
with:
name: SARIF file
path: results.sarif
retention-days: 5

# Upload the results to GitHub's code scanning dashboard.
- name: "Upload to code-scanning"
- name: 'Upload to code-scanning'
uses: github/codeql-action/upload-sarif@v4
with:
sarif_file: results.sarif
sarif_file: results.sarif
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@ coverage/
node_modules/
npm-debug.log
package-lock.json
dist/
*.tsbuildinfo
81 changes: 33 additions & 48 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,77 +1,62 @@
unreleased
=================
# unreleased

* refactor: use simplified `basename` function and remove dependency on `node:path`
- refactor: use simplified `basename` function and remove dependency on `node:path`

1.0.1 / 2025-11-18
=================
# 1.0.1 / 2025-11-18

* Updated `engines` field to Node@18 or higher (fixed reference, see 1.0.0)
* Remove dependency `safe-buffer`
- Updated `engines` field to Node@18 or higher (fixed reference, see 1.0.0)
- Remove dependency `safe-buffer`

1.0.0 / 2024-08-31
==================
# 1.0.0 / 2024-08-31

* drop node <18
* allow utf8 as alias for utf-8
- drop node <18
- allow utf8 as alias for utf-8

0.5.4 / 2021-12-10
==================
# 0.5.4 / 2021-12-10

* deps: safe-buffer@5.2.1
- deps: safe-buffer@5.2.1

0.5.3 / 2018-12-17
==================
# 0.5.3 / 2018-12-17

* Use `safe-buffer` for improved Buffer API
- Use `safe-buffer` for improved Buffer API

0.5.2 / 2016-12-08
==================
# 0.5.2 / 2016-12-08

* Fix `parse` to accept any linear whitespace character
- Fix `parse` to accept any linear whitespace character

0.5.1 / 2016-01-17
==================
# 0.5.1 / 2016-01-17

* perf: enable strict mode
- perf: enable strict mode

0.5.0 / 2014-10-11
==================
# 0.5.0 / 2014-10-11

* Add `parse` function
- Add `parse` function

0.4.0 / 2014-09-21
==================
# 0.4.0 / 2014-09-21

* Expand non-Unicode `filename` to the full ISO-8859-1 charset
- Expand non-Unicode `filename` to the full ISO-8859-1 charset

0.3.0 / 2014-09-20
==================
# 0.3.0 / 2014-09-20

* Add `fallback` option
* Add `type` option
- Add `fallback` option
- Add `type` option

0.2.0 / 2014-09-19
==================
# 0.2.0 / 2014-09-19

* Reduce ambiguity of file names with hex escape in buggy browsers
- Reduce ambiguity of file names with hex escape in buggy browsers

0.1.2 / 2014-09-19
==================
# 0.1.2 / 2014-09-19

* Fix periodic invalid Unicode filename header
- Fix periodic invalid Unicode filename header

0.1.1 / 2014-09-19
==================
# 0.1.1 / 2014-09-19

* Fix invalid characters appearing in `filename*` parameter
- Fix invalid characters appearing in `filename*` parameter

0.1.0 / 2014-09-18
==================
# 0.1.0 / 2014-09-18

* Make the `filename` argument optional
- Make the `filename` argument optional

0.0.0 / 2014-09-18
==================
# 0.0.0 / 2014-09-18

* Initial release
- Initial release
Loading