Skip to content

Commit

Permalink
Require Node.js 18
Browse files Browse the repository at this point in the history
  • Loading branch information
sindresorhus committed Aug 31, 2023
1 parent 65bb025 commit 865c604
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 13 deletions.
3 changes: 3 additions & 0 deletions .github/security.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Security Policy

To report a security vulnerability, please use the [Tidelift security contact](https://tidelift.com/security). Tidelift will coordinate the fix and disclosure.
9 changes: 4 additions & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,11 @@ jobs:
fail-fast: false
matrix:
node-version:
- 16
- 14
- 12
- 20
- 18
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- run: npm install
Expand Down
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ export default function titleize(string) {
throw new TypeError('Expected a string');
}

return string.toLowerCase().replace(/(?:^|\s|-)\S/g, x => x.toUpperCase());
return string.toLowerCase().replaceAll(/(?:^|\s|-)\S/g, x => x.toUpperCase());
}
13 changes: 8 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,12 @@
"url": "https://sindresorhus.com"
},
"type": "module",
"exports": "./index.js",
"exports": {
"types": "./index.d.ts",
"default": "./index.js"
},
"engines": {
"node": ">=12"
"node": ">=18"
},
"scripts": {
"test": "xo && ava && tsd"
Expand All @@ -35,8 +38,8 @@
"convert"
],
"devDependencies": {
"ava": "^3.15.0",
"tsd": "^0.14.0",
"xo": "^0.39.1"
"ava": "^5.3.1",
"tsd": "^0.29.0",
"xo": "^0.56.0"
}
}
4 changes: 2 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
## Install

```
$ npm install titleize
```sh
npm install titleize
```

## Usage
Expand Down

0 comments on commit 865c604

Please sign in to comment.