@nhtio/encoder 0.1.0-master-daa8452a → 1.20251202.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/{exceptions-CC6nR1KV.mjs → exceptions-DQ5GL4Nv.mjs} +2 -2
- package/{exceptions-CC6nR1KV.mjs.map → exceptions-DQ5GL4Nv.mjs.map} +1 -1
- package/{exceptions-3R5pkYQq.js → exceptions-DR7_jiDe.js} +2 -2
- package/{exceptions-3R5pkYQq.js.map → exceptions-DR7_jiDe.js.map} +1 -1
- package/exceptions.cjs +1 -1
- package/exceptions.mjs +1 -1
- package/index.cjs +5 -5
- package/index.cjs.map +1 -1
- package/index.mjs +5 -5
- package/index.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -157,7 +157,7 @@ class E_INCOMPATIBLE_VERSION extends BaseException {
|
|
|
157
157
|
* @param version - The incompatible version string from the encoded data.
|
|
158
158
|
*/
|
|
159
159
|
constructor(version) {
|
|
160
|
-
const message = `Encoded data version ${version} is not compatible with the current version ${"
|
|
160
|
+
const message = `Encoded data version ${version} is not compatible with the current version ${"1.20251202.0"}.`;
|
|
161
161
|
super(message, {
|
|
162
162
|
code: E_INCOMPATIBLE_VERSION.code,
|
|
163
163
|
status: E_INCOMPATIBLE_VERSION.status
|
|
@@ -174,4 +174,4 @@ export {
|
|
|
174
174
|
E_INVALID_VERSION as e,
|
|
175
175
|
E_INCOMPATIBLE_VERSION as f
|
|
176
176
|
};
|
|
177
|
-
//# sourceMappingURL=exceptions-
|
|
177
|
+
//# sourceMappingURL=exceptions-DQ5GL4Nv.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exceptions-
|
|
1
|
+
{"version":3,"file":"exceptions-DQ5GL4Nv.mjs","sources":["../src/private/exceptions.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/naming-convention */\n\nexport interface ErrorOptions {\n cause?: unknown\n}\n\n/**\n * Base exception class that extends the native Error class.\n * Provides a foundation for all custom exceptions with additional metadata\n * like error codes, status codes, and help descriptions.\n */\nexport class BaseException extends Error {\n /**\n * Define the error metadata as static properties to avoid\n * setting them repeatedly on the error instance\n */\n declare static help?: string\n declare static code?: string\n declare static status?: number\n declare static message?: string\n\n /**\n * Name of the class that raised the exception.\n */\n name: string\n\n /**\n * Optional help description for the error. You can use it to define additional\n * human readable information for the error.\n */\n declare help?: string\n\n /**\n * A machine readable error code. This will allow the error handling logic\n * to narrow down exceptions based upon the error code.\n */\n declare code?: string\n\n /**\n * A status code for the error. Usually helpful when converting errors\n * to HTTP responses.\n */\n status: number\n\n /**\n * Creates a new BaseException instance.\n *\n * @param message - The error message. If not provided, uses the static message from the constructor.\n * @param options - Additional options including error cause, code, and status.\n */\n constructor(message?: string, options?: ErrorOptions & { code?: string; status?: number }) {\n super(message, options)\n\n const ErrorConstructor = this.constructor as typeof BaseException\n\n this.name = ErrorConstructor.name\n this.message = message || ErrorConstructor.message || ''\n this.status = options?.status || ErrorConstructor.status || 500\n\n const code = options?.code || ErrorConstructor.code\n if (code !== undefined) {\n this.code = code\n }\n\n const help = ErrorConstructor.help\n if (help !== undefined) {\n this.help = help\n }\n\n Error.captureStackTrace(this, ErrorConstructor)\n }\n\n /**\n * Returns the constructor name for the Symbol.toStringTag property.\n *\n * @returns The name of the exception class.\n */\n get [Symbol.toStringTag]() {\n return this.constructor.name\n }\n\n /**\n * Returns a string representation of the exception.\n * Includes the error code in brackets if available.\n *\n * @returns A formatted string representation of the exception.\n */\n toString() {\n if (this.code) {\n return `${this.name} [${this.code}]: ${this.message}`\n }\n return `${this.name}: ${this.message}`\n }\n}\n\n/**\n * Exception thrown when a value cannot be encoded.\n * This indicates that the value type is not supported by the encoder.\n */\nexport class E_UNENCODABLE_VALUE extends BaseException {\n static status = 500\n static code = 'E_UNENCODABLE_VALUE'\n\n /**\n * Creates a new E_UNENCODABLE_VALUE exception.\n *\n * @param value - The value that could not be encoded.\n */\n constructor(value: unknown) {\n const message = `Value of type ${typeof value} (${String(value)}) is not encodable.`\n super(message, {\n code: E_UNENCODABLE_VALUE.code,\n status: E_UNENCODABLE_VALUE.status,\n })\n }\n}\n\n/**\n * Exception thrown when encoding fails due to an underlying error.\n * This wraps the original error as the cause for better error tracing.\n */\nexport class E_ENCODING_FAILED extends BaseException {\n static status = 500\n static code = 'E_ENCODING_FAILED'\n\n /**\n * Creates a new E_ENCODING_FAILED exception.\n *\n * @param value - The value that failed to encode.\n * @param cause - The underlying error that caused the encoding to fail.\n */\n constructor(value: unknown, cause: unknown) {\n const message = `Value of type ${typeof value} (${String(value)}) is not encodable.`\n super(message, {\n code: E_ENCODING_FAILED.code,\n status: E_ENCODING_FAILED.status,\n cause,\n })\n }\n}\n\n/**\n * Exception thrown when a circular reference is detected during encoding.\n * Circular references cannot be encoded and must be avoided.\n */\nexport class E_CIRCULAR_REFERENCE extends BaseException {\n static status = 500\n static code = 'E_CIRCULAR_REFERENCE'\n\n /**\n * Creates a new E_CIRCULAR_REFERENCE exception.\n */\n constructor() {\n const message = `Circular reference detected.`\n super(message, {\n code: E_CIRCULAR_REFERENCE.code,\n status: E_CIRCULAR_REFERENCE.status,\n })\n }\n}\n\n/**\n * Exception thrown when a value with an unknown or unsupported type cannot be decoded.\n */\nexport class E_UNDECODABLE_VALUE extends BaseException {\n static status = 500\n static code = 'E_UNDECODABLE_VALUE'\n\n /**\n * Creates a new E_UNDECODABLE_VALUE exception.\n *\n * @param type - The type string that could not be decoded.\n */\n constructor(type: string) {\n const message = `Value of type ${type} cannot be decoded.`\n super(message, {\n code: E_UNDECODABLE_VALUE.code,\n status: E_UNDECODABLE_VALUE.status,\n })\n }\n}\n\n/**\n * Exception thrown when attempting to decode a value that is not a valid encoded value.\n * This indicates the input string is not in the expected encoded format.\n */\nexport class E_NOT_AN_ENCODED_VALUE extends BaseException {\n static status = 500\n static code = 'E_NOT_AN_ENCODED_VALUE'\n\n /**\n * Creates a new E_NOT_AN_ENCODED_VALUE exception.\n *\n * @param value - The string value that is not a valid encoded value.\n */\n constructor(value: string) {\n const message = `Value \"${value}\" is not a valid encoded value.`\n super(message, {\n code: E_NOT_AN_ENCODED_VALUE.code,\n status: E_NOT_AN_ENCODED_VALUE.status,\n })\n }\n}\n\n/**\n * Exception thrown when an invalid version string is encountered.\n */\nexport class E_INVALID_VERSION extends BaseException {\n static status = 500\n static code = 'E_INVALID_VERSION'\n\n /**\n * Creates a new E_INVALID_VERSION exception.\n *\n * @param version - The invalid version string.\n */\n constructor(version: string) {\n const message = `Invalid version \"${version}\"`\n super(message, {\n code: E_INVALID_VERSION.code,\n status: E_INVALID_VERSION.status,\n })\n }\n}\n\n/**\n * Exception thrown when attempting to decode data encoded with an incompatible version.\n * This typically occurs when the encoded data is from a newer version than the decoder supports.\n */\nexport class E_INCOMPATIBLE_VERSION extends BaseException {\n static status = 500\n static code = 'E_INCOMPATIBLE_VERSION'\n static help =\n 'This error indicates that the encoded value is from a version which is newer than the version of the decoder.'\n\n /**\n * Creates a new E_INCOMPATIBLE_VERSION exception.\n *\n * @param version - The incompatible version string from the encoded data.\n */\n constructor(version: string) {\n const message = `Encoded data version ${version} is not compatible with the current version ${__VERSION__}.`\n super(message, {\n code: E_INCOMPATIBLE_VERSION.code,\n status: E_INCOMPATIBLE_VERSION.status,\n })\n }\n}\n"],"names":[],"mappings":"AAWO,MAAM,sBAAsB,MAAM;AAAA;AAAA;AAAA;AAAA,EAavC;AAAA;AAAA;AAAA;AAAA;AAAA,EAkBA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQA,YAAY,SAAkB,SAA6D;AACzF,UAAM,SAAS,OAAO;AAEtB,UAAM,mBAAmB,KAAK;AAE9B,SAAK,OAAO,iBAAiB;AAC7B,SAAK,UAAU,WAAW,iBAAiB,WAAW;AACtD,SAAK,SAAS,SAAS,UAAU,iBAAiB,UAAU;AAE5D,UAAM,OAAO,SAAS,QAAQ,iBAAiB;AAC/C,QAAI,SAAS,QAAW;AACtB,WAAK,OAAO;AAAA,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ATIBLE_VERSION extends BaseException {
|
|
|
158
158
|
* @param version - The incompatible version string from the encoded data.
|
|
159
159
|
*/
|
|
160
160
|
constructor(version) {
|
|
161
|
-
const message = `Encoded data version ${version} is not compatible with the current version ${"
|
|
161
|
+
const message = `Encoded data version ${version} is not compatible with the current version ${"1.20251202.0"}.`;
|
|
162
162
|
super(message, {
|
|
163
163
|
code: E_INCOMPATIBLE_VERSION.code,
|
|
164
164
|
status: E_INCOMPATIBLE_VERSION.status
|
|
@@ -173,4 +173,4 @@ exports.E_INVALID_VERSION = E_INVALID_VERSION;
|
|
|
173
173
|
exports.E_NOT_AN_ENCODED_VALUE = E_NOT_AN_ENCODED_VALUE;
|
|
174
174
|
exports.E_UNDECODABLE_VALUE = E_UNDECODABLE_VALUE;
|
|
175
175
|
exports.E_UNENCODABLE_VALUE = E_UNENCODABLE_VALUE;
|
|
176
|
-
//# sourceMappingURL=exceptions-
|
|
176
|
+
//# sourceMappingURL=exceptions-DR7_jiDe.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exceptions-
|
|
1
|
+
{"version":3,"file":"exceptions-DR7_jiDe.js","sources":["../src/private/exceptions.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/naming-convention */\n\nexport interface ErrorOptions {\n cause?: unknown\n}\n\n/**\n * Base exception class that extends the native Error class.\n * Provides a foundation for all custom exceptions with additional metadata\n * like error codes, status codes, and help descriptions.\n */\nexport class BaseException extends Error {\n /**\n * Define the error metadata as static properties to avoid\n * setting them repeatedly on the error instance\n */\n declare static help?: string\n declare static code?: string\n declare static status?: number\n declare static message?: string\n\n /**\n * Name of the class that raised the exception.\n */\n name: string\n\n /**\n * Optional help description for the error. You can use it to define additional\n * human readable information for the error.\n */\n declare help?: string\n\n /**\n * A machine readable error code. This will allow the error handling logic\n * to narrow down exceptions based upon the error code.\n */\n declare code?: string\n\n /**\n * A status code for the error. Usually helpful when converting errors\n * to HTTP responses.\n */\n status: number\n\n /**\n * Creates a new BaseException instance.\n *\n * @param message - The error message. If not provided, uses the static message from the constructor.\n * @param options - Additional options including error cause, code, and status.\n */\n constructor(message?: string, options?: ErrorOptions & { code?: string; status?: number }) {\n super(message, options)\n\n const ErrorConstructor = this.constructor as typeof BaseException\n\n this.name = ErrorConstructor.name\n this.message = message || ErrorConstructor.message || ''\n this.status = options?.status || ErrorConstructor.status || 500\n\n const code = options?.code || ErrorConstructor.code\n if (code !== undefined) {\n this.code = code\n }\n\n const help = ErrorConstructor.help\n if (help !== undefined) {\n this.help = help\n }\n\n Error.captureStackTrace(this, ErrorConstructor)\n }\n\n /**\n * Returns the constructor name for the Symbol.toStringTag property.\n *\n * @returns The name of the exception class.\n */\n get [Symbol.toStringTag]() {\n return this.constructor.name\n }\n\n /**\n * Returns a string representation of the exception.\n * Includes the error code in brackets if available.\n *\n * @returns A formatted string representation of the exception.\n */\n toString() {\n if (this.code) {\n return `${this.name} [${this.code}]: ${this.message}`\n }\n return `${this.name}: ${this.message}`\n }\n}\n\n/**\n * Exception thrown when a value cannot be encoded.\n * This indicates that the value type is not supported by the encoder.\n */\nexport class E_UNENCODABLE_VALUE extends BaseException {\n static status = 500\n static code = 'E_UNENCODABLE_VALUE'\n\n /**\n * Creates a new E_UNENCODABLE_VALUE exception.\n *\n * @param value - The value that could not be encoded.\n */\n constructor(value: unknown) {\n const message = `Value of type ${typeof value} (${String(value)}) is not encodable.`\n super(message, {\n code: E_UNENCODABLE_VALUE.code,\n status: E_UNENCODABLE_VALUE.status,\n })\n }\n}\n\n/**\n * Exception thrown when encoding fails due to an underlying error.\n * This wraps the original error as the cause for better error tracing.\n */\nexport class E_ENCODING_FAILED extends BaseException {\n static status = 500\n static code = 'E_ENCODING_FAILED'\n\n /**\n * Creates a new E_ENCODING_FAILED exception.\n *\n * @param value - The value that failed to encode.\n * @param cause - The underlying error that caused the encoding to fail.\n */\n constructor(value: unknown, cause: unknown) {\n const message = `Value of type ${typeof value} (${String(value)}) is not encodable.`\n super(message, {\n code: E_ENCODING_FAILED.code,\n status: E_ENCODING_FAILED.status,\n cause,\n })\n }\n}\n\n/**\n * Exception thrown when a circular reference is detected during encoding.\n * Circular references cannot be encoded and must be avoided.\n */\nexport class E_CIRCULAR_REFERENCE extends BaseException {\n static status = 500\n static code = 'E_CIRCULAR_REFERENCE'\n\n /**\n * Creates a new E_CIRCULAR_REFERENCE exception.\n */\n constructor() {\n const message = `Circular reference detected.`\n super(message, {\n code: E_CIRCULAR_REFERENCE.code,\n status: E_CIRCULAR_REFERENCE.status,\n })\n }\n}\n\n/**\n * Exception thrown when a value with an unknown or unsupported type cannot be decoded.\n */\nexport class E_UNDECODABLE_VALUE extends BaseException {\n static status = 500\n static code = 'E_UNDECODABLE_VALUE'\n\n /**\n * Creates a new E_UNDECODABLE_VALUE exception.\n *\n * @param type - The type string that could not be decoded.\n */\n constructor(type: string) {\n const message = `Value of type ${type} cannot be decoded.`\n super(message, {\n code: E_UNDECODABLE_VALUE.code,\n status: E_UNDECODABLE_VALUE.status,\n })\n }\n}\n\n/**\n * Exception thrown when attempting to decode a value that is not a valid encoded value.\n * This indicates the input string is not in the expected encoded format.\n */\nexport class E_NOT_AN_ENCODED_VALUE extends BaseException {\n static status = 500\n static code = 'E_NOT_AN_ENCODED_VALUE'\n\n /**\n * Creates a new E_NOT_AN_ENCODED_VALUE exception.\n *\n * @param value - The string value that is not a valid encoded value.\n */\n constructor(value: string) {\n const message = `Value \"${value}\" is not a valid encoded value.`\n super(message, {\n code: E_NOT_AN_ENCODED_VALUE.code,\n status: E_NOT_AN_ENCODED_VALUE.status,\n })\n }\n}\n\n/**\n * Exception thrown when an invalid version string is encountered.\n */\nexport class E_INVALID_VERSION extends BaseException {\n static status = 500\n static code = 'E_INVALID_VERSION'\n\n /**\n * Creates a new E_INVALID_VERSION exception.\n *\n * @param version - The invalid version string.\n */\n constructor(version: string) {\n const message = `Invalid version \"${version}\"`\n super(message, {\n code: E_INVALID_VERSION.code,\n status: E_INVALID_VERSION.status,\n })\n }\n}\n\n/**\n * Exception thrown when attempting to decode data encoded with an incompatible version.\n * This typically occurs when the encoded data is from a newer version than the decoder supports.\n */\nexport class E_INCOMPATIBLE_VERSION extends BaseException {\n static status = 500\n static code = 'E_INCOMPATIBLE_VERSION'\n static help =\n 'This error indicates that the encoded value is from a version which is newer than the version of the decoder.'\n\n /**\n * Creates a new E_INCOMPATIBLE_VERSION exception.\n *\n * @param version - The incompatible version string from the encoded data.\n */\n constructor(version: string) {\n const message = `Encoded data version ${version} is not compatible with the current version ${__VERSION__}.`\n super(message, {\n code: E_INCOMPATIBLE_VERSION.code,\n status: E_INCOMPATIBLE_VERSION.status,\n })\n }\n}\n"],"names":[],"mappings":";AAWO,MAAM,sBAAsB,MAAM;AAAA;AAAA;AAAA;AAAA,EAavC;AAAA;AAAA;AAAA;AAAA;AAAA,EAkBA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQA,YAAY,SAAkB,SAA6D;AACzF,UAAM,SAAS,OAAO;AAEtB,UAAM,mBAAmB,KAAK;AAE9B,SAAK,OAAO,iBAAiB;AAC7B,SAAK,UAAU,WAAW,iBAAiB,WAAW;AACtD,SAAK,SAAS,SAAS,UAAU,iBAAiB,UAAU;AAE5D,UAAM,OAAO,SAAS,QAAQ,iBAAiB;AAC/C,QAAI,SAAS,QAAW;AACtB,WAAK,OAAO;AAAA,IACd;AAEA,UAAM,OAAO,iBAAiB;AAC9B,QAAI,SAAS,QAAW;AACtB,WAAK,OAAO;AAAA,IACd;AAEA,UAAM,kBAAkB,MAAM,gBAAgB;AAAA,EAChD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,KAAK,OAAO,WAAW,IAAI;AACzB,WAAO,KAAK,YAAY;AAAA,EAC1B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQA,WAAW;AACT,QAAI,KAAK,MAAM;AACb,aAAO,GAAG,KAAK,IAAI,KAAK,KAAK,IAAI,MAAM,KAAK,OAAO;AAAA,IACrD;AAC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AAO,SAAS;AAAA,EAChB,OAAO,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOd,YAAY,OAAe;AACzB,UAAM,UAAU,UAAU,KAAK;AAC/B,UAAM,SAAS;AAAA,MACb,MAAM,uBAAuB;AAAA,MAC7B,QAAQ,uBAAuB;AAAA,IAAA,CAChC;AAAA,EACH;AACF;AAKO,MAAM,0BAA0B,cAAc;AAAA,EACnD,OAAO,SAAS;AAAA,EAChB,OAAO,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOd,YAAY,SAAiB;AAC3B,UAAM,UAAU,oBAAoB,OAAO;AAC3C,UAAM,SAAS;AAAA,MACb,MAAM,kBAAkB;AAAA,MACxB,QAAQ,kBAAkB;AAAA,IAAA,CAC3B;AAAA,EACH;AACF;AAMO,MAAM,+BAA+B,cAAc;AAAA,EACxD,OAAO,SAAS;AAAA,EAChB,OAAO,OAAO;AAAA,EACd,OAAO,OACL;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOF,YAAY,SAAiB;AAC3B,UAAM,UAAU,wBAAwB,OAAO,+CAA+C,cAAW;AACzG,UAAM,SAAS;AAAA,MACb,MAAM,uBAAuB;AAAA,MAC7B,QAAQ,uBAAuB;AAAA,IAAA,CAChC;AAAA,EACH;AACF;;;;;;;;;"}
|
package/exceptions.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const exceptions = require("./exceptions-
|
|
3
|
+
const exceptions = require("./exceptions-DR7_jiDe.js");
|
|
4
4
|
exports.E_CIRCULAR_REFERENCE = exceptions.E_CIRCULAR_REFERENCE;
|
|
5
5
|
exports.E_ENCODING_FAILED = exceptions.E_ENCODING_FAILED;
|
|
6
6
|
exports.E_INCOMPATIBLE_VERSION = exceptions.E_INCOMPATIBLE_VERSION;
|
package/exceptions.mjs
CHANGED
package/index.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const function_serializer = require("./function_serializer-DrKXtRs5.js");
|
|
4
|
-
const exceptions = require("./exceptions-
|
|
4
|
+
const exceptions = require("./exceptions-DR7_jiDe.js");
|
|
5
5
|
var re = { exports: {} };
|
|
6
6
|
var constants;
|
|
7
7
|
var hasRequiredConstants;
|
|
@@ -3224,11 +3224,11 @@ const { parse: $parse, stringify: $stringify } = JSON;
|
|
|
3224
3224
|
const options = { json: true, lossy: true };
|
|
3225
3225
|
const parse = (str) => deserialize($parse(str));
|
|
3226
3226
|
const stringify = (any) => $stringify(serialize(any, options));
|
|
3227
|
-
const version = "
|
|
3227
|
+
const version = "1.20251202.0";
|
|
3228
3228
|
const encode = (what) => {
|
|
3229
3229
|
const structured = toStructuredData(what);
|
|
3230
3230
|
const serialized = serialize(structured, { lossy: true, json: true });
|
|
3231
|
-
const json = stringify({ version: "
|
|
3231
|
+
const json = stringify({ version: "1.20251202.0", serialized });
|
|
3232
3232
|
return utoa(json);
|
|
3233
3233
|
};
|
|
3234
3234
|
const decode = (base64) => {
|
|
@@ -3239,11 +3239,11 @@ const decode = (base64) => {
|
|
|
3239
3239
|
throw new exceptions.E_NOT_AN_ENCODED_VALUE(base64);
|
|
3240
3240
|
}
|
|
3241
3241
|
const { version: payloadVersion, serialized } = parsed;
|
|
3242
|
-
if (semverExports.valid("
|
|
3242
|
+
if (semverExports.valid("1.20251202.0")) {
|
|
3243
3243
|
if (!semverExports.valid(semverExports.coerce(payloadVersion))) {
|
|
3244
3244
|
throw new exceptions.E_INVALID_VERSION(payloadVersion);
|
|
3245
3245
|
}
|
|
3246
|
-
if (semverExports.gt(semverExports.coerce(payloadVersion), "
|
|
3246
|
+
if (semverExports.gt(semverExports.coerce(payloadVersion), "1.20251202.0")) {
|
|
3247
3247
|
throw new exceptions.E_INCOMPATIBLE_VERSION(payloadVersion);
|
|
3248
3248
|
}
|
|
3249
3249
|
}
|