@gershy/util-slash-escape 0.0.2 → 0.0.3

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/cmp/cjs/main.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- import '../sideEffects.js';
2
1
  import '@gershy/clearing';
3
2
  declare const _default: (str: string, escapeChars: string) => string;
4
3
  export default _default;
package/cmp/cjs/main.js CHANGED
@@ -1,11 +1,30 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- require("@gershy/clearing");
4
- exports.default = (str, escapeChars) => {
5
- if (!escapeChars[cl.has]('\\'))
6
- escapeChars += '\\';
7
- // The regex to construct must have "\" and "]" escaped:
8
- const escChars = escapeChars.replace(/([\\\]])/g, '\\$1');
9
- const reg = new RegExp(`([${escChars}])`, 'g');
10
- return str.replace(reg, '\\$1');
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var main_exports = {};
20
+ __export(main_exports, {
21
+ default: () => main_default
22
+ });
23
+ module.exports = __toCommonJS(main_exports);
24
+ var import_clearing = require("@gershy/clearing");
25
+ var main_default = (str, escapeChars) => {
26
+ if (!escapeChars[cl.has]("\\")) escapeChars += "\\";
27
+ const escChars = escapeChars.replace(/([\\\]])/g, "\\$1");
28
+ const reg = new RegExp(`([${escChars}])`, "g");
29
+ return str.replace(reg, "\\$1");
11
30
  };
@@ -1,4 +1,3 @@
1
- import '../sideEffects.js';
2
1
  import '@gershy/clearing';
3
2
  declare const _default: (str: string, escapeChars: string) => string;
4
3
  export default _default;
@@ -0,0 +1,10 @@
1
+ import "@gershy/clearing";
2
+ var main_default = (str, escapeChars) => {
3
+ if (!escapeChars[cl.has]("\\")) escapeChars += "\\";
4
+ const escChars = escapeChars.replace(/([\\\]])/g, "\\$1");
5
+ const reg = new RegExp(`([${escChars}])`, "g");
6
+ return str.replace(reg, "\\$1");
7
+ };
8
+ export {
9
+ main_default as default
10
+ };
@@ -0,0 +1,2 @@
1
+ declare global {}
2
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gershy/util-slash-escape",
3
- "version": "0.0.2",
3
+ "version": "0.0.3",
4
4
  "description": "TODO",
5
5
  "keywords": [
6
6
  "TODO"
@@ -16,7 +16,7 @@
16
16
  "homepage": "https://github.com/gershyNpm/utilSlashEscape#readme",
17
17
  "license": "ISC",
18
18
  "peerDependencies": {
19
- "@gershy/clearing": "^0.0.36"
19
+ "@gershy/clearing": "^0.0.41"
20
20
  },
21
21
  "devDependencies": {
22
22
  "@types/node": "^24.10.1",
@@ -32,7 +32,7 @@
32
32
  "types": "./cmp/mjs/main.d.ts",
33
33
  "exports": {
34
34
  ".": {
35
- "import": "./cmp/mjs/main.js",
35
+ "import": "./cmp/esm/main.js",
36
36
  "require": "./cmp/cjs/main.js"
37
37
  }
38
38
  },
package/cmp/mjs/main.js DELETED
@@ -1,9 +0,0 @@
1
- import '@gershy/clearing';
2
- export default (str, escapeChars) => {
3
- if (!escapeChars[cl.has]('\\'))
4
- escapeChars += '\\';
5
- // The regex to construct must have "\" and "]" escaped:
6
- const escChars = escapeChars.replace(/([\\\]])/g, '\\$1');
7
- const reg = new RegExp(`([${escChars}])`, 'g');
8
- return str.replace(reg, '\\$1');
9
- };
File without changes
File without changes