@hanivanrizky/nestjs-browser-action 0.11.0 → 0.12.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.
@@ -1,6 +1,8 @@
1
1
  export * from './delay.util';
2
2
  export * from './dom.util';
3
3
  export * from './logger.util';
4
+ export * from './path.util';
5
+ export * from './regex.util';
4
6
  export * from './string.util';
5
7
  export * from './truncate-log.util';
6
8
  export * from './cloak.loader';
@@ -17,6 +17,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./delay.util"), exports);
18
18
  __exportStar(require("./dom.util"), exports);
19
19
  __exportStar(require("./logger.util"), exports);
20
+ __exportStar(require("./path.util"), exports);
21
+ __exportStar(require("./regex.util"), exports);
20
22
  __exportStar(require("./string.util"), exports);
21
23
  __exportStar(require("./truncate-log.util"), exports);
22
24
  __exportStar(require("./cloak.loader"), exports);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAA6B;AAC7B,6CAA2B;AAC3B,gDAA8B;AAC9B,gDAA8B;AAC9B,sDAAoC;AACpC,iDAA+B"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAA6B;AAC7B,6CAA2B;AAC3B,gDAA8B;AAC9B,8CAA4B;AAC5B,+CAA6B;AAC7B,gDAA8B;AAC9B,sDAAoC;AACpC,iDAA+B"}
@@ -0,0 +1 @@
1
+ export declare function sanitizeScreenshotPath(input: string): string;
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.sanitizeScreenshotPath = sanitizeScreenshotPath;
4
+ function sanitizeScreenshotPath(input) {
5
+ const normalized = input
6
+ .replace(/\\/g, '/')
7
+ .replace(/\.\.\//g, '')
8
+ .replace(/\.\.\\/g, '');
9
+ if (normalized.startsWith('/')) {
10
+ throw new Error('Absolute paths are not allowed for screenshots');
11
+ }
12
+ return normalized;
13
+ }
14
+ //# sourceMappingURL=path.util.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"path.util.js","sourceRoot":"","sources":["../../src/utils/path.util.ts"],"names":[],"mappings":";;AAaA,wDASC;AATD,SAAgB,sBAAsB,CAAC,KAAa;IAClD,MAAM,UAAU,GAAG,KAAK;SACrB,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC;SACnB,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC;SACtB,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC;IAC1B,IAAI,UAAU,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;QAC/B,MAAM,IAAI,KAAK,CAAC,gDAAgD,CAAC,CAAC;IACpE,CAAC;IACD,OAAO,UAAU,CAAC;AACpB,CAAC"}
@@ -0,0 +1 @@
1
+ export declare function isSafeRegex(pattern: string): boolean;
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isSafeRegex = isSafeRegex;
4
+ function isSafeRegex(pattern) {
5
+ const dangerous = /\([^)]*[+*]\)[+*]/;
6
+ return !dangerous.test(pattern);
7
+ }
8
+ //# sourceMappingURL=regex.util.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"regex.util.js","sourceRoot":"","sources":["../../src/utils/regex.util.ts"],"names":[],"mappings":";;AAcA,kCAIC;AAJD,SAAgB,WAAW,CAAC,OAAe;IAEzC,MAAM,SAAS,GAAG,mBAAmB,CAAC;IACtC,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;AAClC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hanivanrizky/nestjs-browser-action",
3
- "version": "0.11.0",
3
+ "version": "0.12.0",
4
4
  "description": "Stealth browser automation module for NestJS (CloakBrowser + puppeteer-core)",
5
5
  "author": "Hanivan Rizky S <hanivan20@gmail.com> (https://www.hanivan.my.id)",
6
6
  "license": "MIT",