tiny-escape 1.0.2 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +3 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
'use strict';function r(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}exports.escapeRegExp=r;//# sourceMappingURL=index.cjs.map
|
|
2
|
-
//# sourceMappingURL=index.cjs.map
|
|
1
|
+
'use strict';Object.defineProperty(exports,'__esModule',{value:true});function r(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}var t=r;exports.default=t;exports.escapeRegExp=r;//# sourceMappingURL=index.cjs.map
|
|
2
|
+
//# sourceMappingURL=index.cjs.map
|
|
3
|
+
module.exports=Object.assign(exports.default,exports);delete module.exports.default;
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"names":["escapeRegExp","string"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"names":["escapeRegExp","string","index_default"],"mappings":"sEAAO,SAASA,CAAAA,CAAaC,CAAAA,CAAwB,CACnD,GAAI,OAAOA,GAAW,QAAA,CACpB,MAAM,IAAI,SAAA,CAAU,mBAAmB,CAAA,CAGzC,OAAOA,CAAAA,CAAO,OAAA,CAAQ,qBAAA,CAAuB,MAAM,CAAA,CAAE,OAAA,CAAQ,KAAM,OAAO,CAC5E,CAEA,IAAOC,CAAAA,CAAQF","file":"index.cjs","sourcesContent":["export function escapeRegExp(string: string): string {\n if (typeof string !== \"string\") {\n throw new TypeError(\"Expected a string\");\n }\n\n return string.replace(/[|\\\\{}()[\\]^$+*?.]/g, \"\\\\$&\").replace(/-/g, \"\\\\x2d\");\n}\n\nexport default escapeRegExp;\n"]}
|
package/dist/index.d.cts
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
function r(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}export{r as escapeRegExp};//# sourceMappingURL=index.js.map
|
|
1
|
+
function r(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}var t=r;export{t as default,r as escapeRegExp};//# sourceMappingURL=index.js.map
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"names":["escapeRegExp","string"],"mappings":"AAAO,SAASA,CAAAA,CAAaC,
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"names":["escapeRegExp","string","index_default"],"mappings":"AAAO,SAASA,CAAAA,CAAaC,CAAAA,CAAwB,CACnD,GAAI,OAAOA,GAAW,QAAA,CACpB,MAAM,IAAI,SAAA,CAAU,mBAAmB,CAAA,CAGzC,OAAOA,CAAAA,CAAO,OAAA,CAAQ,qBAAA,CAAuB,MAAM,CAAA,CAAE,OAAA,CAAQ,KAAM,OAAO,CAC5E,CAEA,IAAOC,CAAAA,CAAQF","file":"index.js","sourcesContent":["export function escapeRegExp(string: string): string {\n if (typeof string !== \"string\") {\n throw new TypeError(\"Expected a string\");\n }\n\n return string.replace(/[|\\\\{}()[\\]^$+*?.]/g, \"\\\\$&\").replace(/-/g, \"\\\\x2d\");\n}\n\nexport default escapeRegExp;\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tiny-escape",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "Escape special characters for use in regular expressions. Like escape-string-regexp, ships ESM + CJS.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"dist"
|
|
23
23
|
],
|
|
24
24
|
"scripts": {
|
|
25
|
-
"build": "tsup",
|
|
25
|
+
"build": "tsup && node -e \"let f=require('fs'),p='dist/index.cjs',c=f.readFileSync(p,'utf8');c+='\\nmodule.exports=Object.assign(exports.default,exports);delete module.exports.default;';f.writeFileSync(p,c)\"",
|
|
26
26
|
"typecheck": "tsc --noEmit",
|
|
27
27
|
"test": "vitest run",
|
|
28
28
|
"test:watch": "vitest",
|