Skip to content

Commit be61d36

Browse files
authored
Modernize tn1150 for Node.js 24
Modernizes tn1150 for Node.js 24, replaces unorm with built-in normalization, keeps TN1150 compare behavior covered by tests, and adds green Node 24 CI.
1 parent 6b71a58 commit be61d36

7 files changed

Lines changed: 2186 additions & 47 deletions

File tree

.github/workflows/build.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: build
2+
3+
on:
4+
push:
5+
pull_request:
6+
branches:
7+
- main
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
13+
name: build node v24 ubuntu-latest
14+
15+
steps:
16+
- name: checkout
17+
uses: actions/checkout@v6
18+
19+
- name: setup node 24
20+
uses: actions/setup-node@v6
21+
with:
22+
node-version: 24
23+
24+
- name: npm ci
25+
run: npm ci
26+
27+
- name: npm test
28+
run: npm test

index.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export function compare(lhs: string, rhs: string): number;
2+
export function normalize(text: string): string;

index.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@
1414
*
1515
*/
1616

17-
var unorm = require('unorm')
18-
1917
var lowerCaseMap = new Map([
2018
[0x0000, 0xffff],
2119
[0x0041, 0x0061],
@@ -376,4 +374,8 @@ function HFSPlusFastUnicodeCompare (str1, str2) {
376374
}
377375

378376
exports.compare = HFSPlusFastUnicodeCompare
379-
exports.normalize = unorm.nfd
377+
exports.normalize = normalize
378+
379+
function normalize (text) {
380+
return text.normalize('NFD')
381+
}

0 commit comments

Comments
 (0)