@sitecore-content-sdk/core 2.1.1 → 2.1.2-canary.20260707071213

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.
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.mergeURLSearchParams = exports.escapeNonSpecialQuestionMarks = exports.areURLSearchParamsEqual = exports.isRegexOrUrl = exports.getAllowedOriginsFromEnv = exports.getEnforcedCorsHeaders = exports.isTimeoutError = exports.resolveUrl = exports.SITECORE_EXPERIENCE_EDGE_HOSTNAME_ENV = exports.SITECORE_EDGE_PLATFORM_HOSTNAME_ENV = exports.resolveExperienceEdgeUrl = exports.resolveEdgeUrlForStaticFiles = exports.resolveEdgeUrl = exports.isServer = exports.normalizeUrl = exports.setCache = exports.getCacheAndClean = exports.getCache = exports.hasCache = void 0;
6
+ exports.mergeURLSearchParams = exports.escapeRegExp = exports.escapeNonSpecialQuestionMarks = exports.areURLSearchParamsEqual = exports.isRegexOrUrl = exports.getAllowedOriginsFromEnv = exports.getEnforcedCorsHeaders = exports.isTimeoutError = exports.resolveUrl = exports.SITECORE_EXPERIENCE_EDGE_HOSTNAME_ENV = exports.SITECORE_EDGE_PLATFORM_HOSTNAME_ENV = exports.resolveExperienceEdgeUrl = exports.resolveEdgeUrlForStaticFiles = exports.resolveEdgeUrl = exports.isServer = exports.normalizeUrl = exports.setCache = exports.getCacheAndClean = exports.getCache = exports.hasCache = void 0;
7
7
  var globalCache_1 = require("./globalCache");
8
8
  Object.defineProperty(exports, "hasCache", { enumerable: true, get: function () { return globalCache_1.hasCache; } });
9
9
  Object.defineProperty(exports, "getCache", { enumerable: true, get: function () { return globalCache_1.getCache; } });
@@ -28,4 +28,5 @@ Object.defineProperty(exports, "getAllowedOriginsFromEnv", { enumerable: true, g
28
28
  Object.defineProperty(exports, "isRegexOrUrl", { enumerable: true, get: function () { return utils_1.isRegexOrUrl; } });
29
29
  Object.defineProperty(exports, "areURLSearchParamsEqual", { enumerable: true, get: function () { return utils_1.areURLSearchParamsEqual; } });
30
30
  Object.defineProperty(exports, "escapeNonSpecialQuestionMarks", { enumerable: true, get: function () { return utils_1.escapeNonSpecialQuestionMarks; } });
31
+ Object.defineProperty(exports, "escapeRegExp", { enumerable: true, get: function () { return utils_1.escapeRegExp; } });
31
32
  Object.defineProperty(exports, "mergeURLSearchParams", { enumerable: true, get: function () { return utils_1.mergeURLSearchParams; } });
@@ -5,6 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.mergeURLSearchParams = exports.escapeNonSpecialQuestionMarks = exports.areURLSearchParamsEqual = exports.isRegexOrUrl = exports.getEnforcedCorsHeaders = exports.getAllowedOriginsFromEnv = exports.isTimeoutError = void 0;
7
7
  exports.resolveUrl = resolveUrl;
8
+ exports.escapeRegExp = escapeRegExp;
8
9
  const is_server_1 = __importDefault(require("./is-server"));
9
10
  /**
10
11
  * note: encodeURIComponent is available via browser (window) or natively in node.js
@@ -174,6 +175,15 @@ const escapeNonSpecialQuestionMarks = (input) => {
174
175
  return input.replace(/\?/g, '\\?');
175
176
  };
176
177
  exports.escapeNonSpecialQuestionMarks = escapeNonSpecialQuestionMarks;
178
+ /**
179
+ * Escapes a string so it can be safely embedded in a RegExp as a literal.
180
+ * @param {string} input - The string to escape
181
+ * @returns {string} The escaped string safe for RegExp construction
182
+ * @internal
183
+ */
184
+ function escapeRegExp(input) {
185
+ return input.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
186
+ }
177
187
  /**
178
188
  * Merges two URLSearchParams objects. If both objects contain the same key, the value from the second object overrides the first.
179
189
  * @param {URLSearchParams} params1 - The first set of URL search parameters.
@@ -3,4 +3,4 @@ export { hasCache, getCache, getCacheAndClean, setCache } from './globalCache';
3
3
  export { normalizeUrl } from './normalize-url';
4
4
  export { default as isServer } from './is-server';
5
5
  export { resolveEdgeUrl, resolveEdgeUrlForStaticFiles, resolveExperienceEdgeUrl, SITECORE_EDGE_PLATFORM_HOSTNAME_ENV, SITECORE_EXPERIENCE_EDGE_HOSTNAME_ENV, } from './resolve-edge-url';
6
- export { resolveUrl, isTimeoutError, getEnforcedCorsHeaders, getAllowedOriginsFromEnv, isRegexOrUrl, areURLSearchParamsEqual, escapeNonSpecialQuestionMarks, mergeURLSearchParams, } from './utils';
6
+ export { resolveUrl, isTimeoutError, getEnforcedCorsHeaders, getAllowedOriginsFromEnv, isRegexOrUrl, areURLSearchParamsEqual, escapeNonSpecialQuestionMarks, escapeRegExp, mergeURLSearchParams, } from './utils';
@@ -161,6 +161,15 @@ export const escapeNonSpecialQuestionMarks = (input) => {
161
161
  // For non-regex strings, escape literal "?" characters
162
162
  return input.replace(/\?/g, '\\?');
163
163
  };
164
+ /**
165
+ * Escapes a string so it can be safely embedded in a RegExp as a literal.
166
+ * @param {string} input - The string to escape
167
+ * @returns {string} The escaped string safe for RegExp construction
168
+ * @internal
169
+ */
170
+ export function escapeRegExp(input) {
171
+ return input.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
172
+ }
164
173
  /**
165
174
  * Merges two URLSearchParams objects. If both objects contain the same key, the value from the second object overrides the first.
166
175
  * @param {URLSearchParams} params1 - The first set of URL search parameters.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sitecore-content-sdk/core",
3
- "version": "2.1.1",
3
+ "version": "2.1.2-canary.20260707071213",
4
4
  "main": "dist/cjs/index.js",
5
5
  "module": "dist/esm/index.js",
6
6
  "sideEffects": false,
@@ -2,5 +2,5 @@ export { hasCache, getCache, getCacheAndClean, setCache } from './globalCache';
2
2
  export { normalizeUrl } from './normalize-url';
3
3
  export { default as isServer } from './is-server';
4
4
  export { resolveEdgeUrl, resolveEdgeUrlForStaticFiles, resolveExperienceEdgeUrl, SITECORE_EDGE_PLATFORM_HOSTNAME_ENV, SITECORE_EXPERIENCE_EDGE_HOSTNAME_ENV, } from './resolve-edge-url';
5
- export { resolveUrl, isTimeoutError, getEnforcedCorsHeaders, EnhancedOmit, getAllowedOriginsFromEnv, isRegexOrUrl, areURLSearchParamsEqual, escapeNonSpecialQuestionMarks, mergeURLSearchParams, } from './utils';
5
+ export { resolveUrl, isTimeoutError, getEnforcedCorsHeaders, EnhancedOmit, getAllowedOriginsFromEnv, isRegexOrUrl, areURLSearchParamsEqual, escapeNonSpecialQuestionMarks, escapeRegExp, mergeURLSearchParams, } from './utils';
6
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAE/E,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EACL,cAAc,EACd,4BAA4B,EAC5B,wBAAwB,EACxB,mCAAmC,EACnC,qCAAqC,GACtC,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,UAAU,EACV,cAAc,EACd,sBAAsB,EACtB,YAAY,EACZ,wBAAwB,EACxB,YAAY,EACZ,uBAAuB,EACvB,6BAA6B,EAC7B,oBAAoB,GACrB,MAAM,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAE/E,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EACL,cAAc,EACd,4BAA4B,EAC5B,wBAAwB,EACxB,mCAAmC,EACnC,qCAAqC,GACtC,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,UAAU,EACV,cAAc,EACd,sBAAsB,EACtB,YAAY,EACZ,wBAAwB,EACxB,YAAY,EACZ,uBAAuB,EACvB,6BAA6B,EAC7B,YAAY,EACZ,oBAAoB,GACrB,MAAM,SAAS,CAAC"}
@@ -73,6 +73,13 @@ export declare const areURLSearchParamsEqual: (params1: URLSearchParams, params2
73
73
  * @public
74
74
  */
75
75
  export declare const escapeNonSpecialQuestionMarks: (input: string) => string;
76
+ /**
77
+ * Escapes a string so it can be safely embedded in a RegExp as a literal.
78
+ * @param {string} input - The string to escape
79
+ * @returns {string} The escaped string safe for RegExp construction
80
+ * @internal
81
+ */
82
+ export declare function escapeRegExp(input: string): string;
76
83
  /**
77
84
  * Merges two URLSearchParams objects. If both objects contain the same key, the value from the second object overrides the first.
78
85
  * @param {URLSearchParams} params1 - The first set of URL search parameters.
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/tools/utils.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,MAAM,CAAC;AAC3C,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAGlD;;;;GAIG;AAEH,MAAM,MAAM,YAAY,CAAC,CAAC,EAAE,CAAC,SAAS,WAAW,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,IAAI,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAE,CAAC;AAe/F;;;;;;;;GAQG;AACH,wBAAgB,UAAU,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,GAAE,mBAAwB,GAAG,MAAM,CAsBpF;AAED;;;;;GAKG;AACH,eAAO,MAAM,cAAc,GAAI,OAAO,OAAO,YAE5C,CAAC;AAWF;;;;GAIG;AACH,eAAO,MAAM,wBAA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