diff --git a/.github/funding.yml b/.github/funding.yml deleted file mode 100644 index 5bc8a3d..0000000 --- a/.github/funding.yml +++ /dev/null @@ -1,4 +0,0 @@ -github: sindresorhus -open_collective: sindresorhus -tidelift: npm/escape-string-regexp -custom: https://sindresorhus.com/donate diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d36e1a8..087b412 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -13,8 +13,8 @@ jobs: - 14 - 12 steps: - - uses: actions/checkout@v2 - - uses: actions/setup-node@v2 + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 with: node-version: ${{ matrix.node-version }} - run: npm install diff --git a/package.json b/package.json index 9390a6b..168e9a6 100644 --- a/package.json +++ b/package.json @@ -12,6 +12,8 @@ }, "type": "module", "exports": "./index.js", + "types": "./index.d.ts", + "sideEffects": false, "engines": { "node": ">=12" }, diff --git a/readme.md b/readme.md index 839df6e..8b7890f 100644 --- a/readme.md +++ b/readme.md @@ -2,10 +2,13 @@ > Escape RegExp special characters +> [!TIP] +> This is now available natively as [`RegExp.escape()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/escape). + ## Install -``` -$ npm install escape-string-regexp +```sh +npm install escape-string-regexp ``` ## Usage @@ -21,14 +24,4 @@ new RegExp(escapedString); You can also use this to escape a string that is inserted into the middle of a regex, for example, into a character class. ---- - -