@midscene/shared 0.19.0 → 0.19.1-beta-20250613042051.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.
@@ -14,7 +14,7 @@ declare function getGlobalScope(): GlobalScope;
14
14
  declare function setIsMcp(value: boolean): void;
15
15
  declare function logMsg(...message: Parameters<typeof console.log>): void;
16
16
  declare function repeat(times: number, fn: (index: number) => Promise<void>): Promise<void>;
17
- declare const escapeHtml: (html: string) => string;
18
- declare const antiEscapeHtml: (html: string) => string;
17
+ declare const escapeScriptTag: (html: string) => string;
18
+ declare const antiEscapeScriptTag: (html: string) => string;
19
19
 
20
- export { antiEscapeHtml, assert, escapeHtml, generateHashId, getGlobalScope, ifInBrowser, logMsg, repeat, setIsMcp, uuid };
20
+ export { antiEscapeScriptTag, assert, escapeScriptTag, generateHashId, getGlobalScope, ifInBrowser, logMsg, repeat, setIsMcp, uuid };
package/dist/es/utils.js CHANGED
@@ -66,18 +66,18 @@ var REGEXP_LT = /</g;
66
66
  var REGEXP_GT = />/g;
67
67
  var REGEXP_LT_ESCAPE = "__midscene_lt__";
68
68
  var REGEXP_GT_ESCAPE = "__midscene_gt__";
69
- var escapeHtml = (html) => {
69
+ var escapeScriptTag = (html) => {
70
70
  return html.replace(REGEXP_LT, REGEXP_LT_ESCAPE).replace(REGEXP_GT, REGEXP_GT_ESCAPE);
71
71
  };
72
- var antiEscapeHtml = (html) => {
72
+ var antiEscapeScriptTag = (html) => {
73
73
  const REGEXP_LT2 = new RegExp(REGEXP_LT_ESCAPE, "g");
74
74
  const REGEXP_GT2 = new RegExp(REGEXP_GT_ESCAPE, "g");
75
75
  return html.replace(REGEXP_LT2, "<").replace(REGEXP_GT2, ">");
76
76
  };
77
77
  export {
78
- antiEscapeHtml,
78
+ antiEscapeScriptTag,
79
79
  assert,
80
- escapeHtml,
80
+ escapeScriptTag,
81
81
  generateHashId,
82
82
  getGlobalScope,
83
83
  ifInBrowser,
@@ -14,7 +14,7 @@ declare function getGlobalScope(): GlobalScope;
14
14
  declare function setIsMcp(value: boolean): void;
15
15
  declare function logMsg(...message: Parameters<typeof console.log>): void;
16
16
  declare function repeat(times: number, fn: (index: number) => Promise<void>): Promise<void>;
17
- declare const escapeHtml: (html: string) => string;
18
- declare const antiEscapeHtml: (html: string) => string;
17
+ declare const escapeScriptTag: (html: string) => string;
18
+ declare const antiEscapeScriptTag: (html: string) => string;
19
19
 
20
- export { antiEscapeHtml, assert, escapeHtml, generateHashId, getGlobalScope, ifInBrowser, logMsg, repeat, setIsMcp, uuid };
20
+ export { antiEscapeScriptTag, assert, escapeScriptTag, generateHashId, getGlobalScope, ifInBrowser, logMsg, repeat, setIsMcp, uuid };
package/dist/lib/utils.js CHANGED
@@ -20,9 +20,9 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
20
20
  // src/utils.ts
21
21
  var utils_exports = {};
22
22
  __export(utils_exports, {
23
- antiEscapeHtml: () => antiEscapeHtml,
23
+ antiEscapeScriptTag: () => antiEscapeScriptTag,
24
24
  assert: () => assert,
25
- escapeHtml: () => escapeHtml,
25
+ escapeScriptTag: () => escapeScriptTag,
26
26
  generateHashId: () => generateHashId,
27
27
  getGlobalScope: () => getGlobalScope,
28
28
  ifInBrowser: () => ifInBrowser,
@@ -99,19 +99,19 @@ var REGEXP_LT = /</g;
99
99
  var REGEXP_GT = />/g;
100
100
  var REGEXP_LT_ESCAPE = "__midscene_lt__";
101
101
  var REGEXP_GT_ESCAPE = "__midscene_gt__";
102
- var escapeHtml = (html) => {
102
+ var escapeScriptTag = (html) => {
103
103
  return html.replace(REGEXP_LT, REGEXP_LT_ESCAPE).replace(REGEXP_GT, REGEXP_GT_ESCAPE);
104
104
  };
105
- var antiEscapeHtml = (html) => {
105
+ var antiEscapeScriptTag = (html) => {
106
106
  const REGEXP_LT2 = new RegExp(REGEXP_LT_ESCAPE, "g");
107
107
  const REGEXP_GT2 = new RegExp(REGEXP_GT_ESCAPE, "g");
108
108
  return html.replace(REGEXP_LT2, "<").replace(REGEXP_GT2, ">");
109
109
  };
110
110
  // Annotate the CommonJS export names for ESM import in node:
111
111
  0 && (module.exports = {
112
- antiEscapeHtml,
112
+ antiEscapeScriptTag,
113
113
  assert,
114
- escapeHtml,
114
+ escapeScriptTag,
115
115
  generateHashId,
116
116
  getGlobalScope,
117
117
  ifInBrowser,
@@ -14,7 +14,7 @@ declare function getGlobalScope(): GlobalScope;
14
14
  declare function setIsMcp(value: boolean): void;
15
15
  declare function logMsg(...message: Parameters<typeof console.log>): void;
16
16
  declare function repeat(times: number, fn: (index: number) => Promise<void>): Promise<void>;
17
- declare const escapeHtml: (html: string) => string;
18
- declare const antiEscapeHtml: (html: string) => string;
17
+ declare const escapeScriptTag: (html: string) => string;
18
+ declare const antiEscapeScriptTag: (html: string) => string;
19
19
 
20
- export { antiEscapeHtml, assert, escapeHtml, generateHashId, getGlobalScope, ifInBrowser, logMsg, repeat, setIsMcp, uuid };
20
+ export { antiEscapeScriptTag, assert, escapeScriptTag, generateHashId, getGlobalScope, ifInBrowser, logMsg, repeat, setIsMcp, uuid };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@midscene/shared",
3
- "version": "0.19.0",
3
+ "version": "0.19.1-beta-20250613042051.0",
4
4
  "repository": "https://github.com/web-infra-dev/midscene",
5
5
  "homepage": "https://midscenejs.com/",
6
6
  "types": "./dist/types/index.d.ts",
package/src/utils.ts CHANGED
@@ -102,13 +102,13 @@ const REGEXP_GT = />/g;
102
102
  const REGEXP_LT_ESCAPE = '__midscene_lt__';
103
103
  const REGEXP_GT_ESCAPE = '__midscene_gt__';
104
104
 
105
- export const escapeHtml = (html: string) => {
105
+ export const escapeScriptTag = (html: string) => {
106
106
  return html
107
107
  .replace(REGEXP_LT, REGEXP_LT_ESCAPE)
108
108
  .replace(REGEXP_GT, REGEXP_GT_ESCAPE);
109
109
  };
110
110
 
111
- export const antiEscapeHtml = (html: string) => {
111
+ export const antiEscapeScriptTag = (html: string) => {
112
112
  const REGEXP_LT = new RegExp(REGEXP_LT_ESCAPE, 'g');
113
113
  const REGEXP_GT = new RegExp(REGEXP_GT_ESCAPE, 'g');
114
114