@ms-cloudpack/remote-cache 0.10.21 → 0.10.23
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/dist/{AzureRemoteCacheClient-2Q6MBWDN.js → AzureRemoteCacheClient-UFUB2BJI.js} +313 -282
- package/dist/{chunk-2F4TLFG2.js → chunk-JNKRKLGF.js} +974 -2170
- package/dist/{chunk-SAK6X2DV.js → chunk-LEHUXQFL.js} +8 -8
- package/dist/{getCredential-LMSBNT2W.js → getCredential-EQJXGMRZ.js} +1 -1
- package/dist/index.js +28 -25
- package/package.json +3 -3
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
require_commonjs5,
|
|
14
14
|
require_commonjs6,
|
|
15
15
|
tslib_es6_exports
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-LEHUXQFL.js";
|
|
17
17
|
import {
|
|
18
18
|
__commonJS,
|
|
19
19
|
__name,
|
|
@@ -23,10 +23,10 @@ import {
|
|
|
23
23
|
|
|
24
24
|
// ../../node_modules/.store/@azure-core-auth-npm-1.9.0-456e72b42c/package/dist/commonjs/azureKeyCredential.js
|
|
25
25
|
var require_azureKeyCredential = __commonJS({
|
|
26
|
-
"../../node_modules/.store/@azure-core-auth-npm-1.9.0-456e72b42c/package/dist/commonjs/azureKeyCredential.js"(
|
|
26
|
+
"../../node_modules/.store/@azure-core-auth-npm-1.9.0-456e72b42c/package/dist/commonjs/azureKeyCredential.js"(exports) {
|
|
27
27
|
"use strict";
|
|
28
|
-
Object.defineProperty(
|
|
29
|
-
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
exports.AzureKeyCredential = void 0;
|
|
30
30
|
var _AzureKeyCredential = class _AzureKeyCredential {
|
|
31
31
|
/**
|
|
32
32
|
* The value of the key to be used in authentication
|
|
@@ -60,16 +60,16 @@ var require_azureKeyCredential = __commonJS({
|
|
|
60
60
|
};
|
|
61
61
|
__name(_AzureKeyCredential, "AzureKeyCredential");
|
|
62
62
|
var AzureKeyCredential = _AzureKeyCredential;
|
|
63
|
-
|
|
63
|
+
exports.AzureKeyCredential = AzureKeyCredential;
|
|
64
64
|
}
|
|
65
65
|
});
|
|
66
66
|
|
|
67
67
|
// ../../node_modules/.store/@azure-core-auth-npm-1.9.0-456e72b42c/package/dist/commonjs/keyCredential.js
|
|
68
68
|
var require_keyCredential = __commonJS({
|
|
69
|
-
"../../node_modules/.store/@azure-core-auth-npm-1.9.0-456e72b42c/package/dist/commonjs/keyCredential.js"(
|
|
69
|
+
"../../node_modules/.store/@azure-core-auth-npm-1.9.0-456e72b42c/package/dist/commonjs/keyCredential.js"(exports) {
|
|
70
70
|
"use strict";
|
|
71
|
-
Object.defineProperty(
|
|
72
|
-
|
|
71
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
72
|
+
exports.isKeyCredential = isKeyCredential;
|
|
73
73
|
var core_util_1 = require_commonjs3();
|
|
74
74
|
function isKeyCredential(credential) {
|
|
75
75
|
return (0, core_util_1.isObjectWithProperties)(credential, ["key"]) && typeof credential.key === "string";
|
|
@@ -80,11 +80,11 @@ var require_keyCredential = __commonJS({
|
|
|
80
80
|
|
|
81
81
|
// ../../node_modules/.store/@azure-core-auth-npm-1.9.0-456e72b42c/package/dist/commonjs/azureNamedKeyCredential.js
|
|
82
82
|
var require_azureNamedKeyCredential = __commonJS({
|
|
83
|
-
"../../node_modules/.store/@azure-core-auth-npm-1.9.0-456e72b42c/package/dist/commonjs/azureNamedKeyCredential.js"(
|
|
83
|
+
"../../node_modules/.store/@azure-core-auth-npm-1.9.0-456e72b42c/package/dist/commonjs/azureNamedKeyCredential.js"(exports) {
|
|
84
84
|
"use strict";
|
|
85
|
-
Object.defineProperty(
|
|
86
|
-
|
|
87
|
-
|
|
85
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
86
|
+
exports.AzureNamedKeyCredential = void 0;
|
|
87
|
+
exports.isNamedKeyCredential = isNamedKeyCredential;
|
|
88
88
|
var core_util_1 = require_commonjs3();
|
|
89
89
|
var _AzureNamedKeyCredential = class _AzureNamedKeyCredential {
|
|
90
90
|
/**
|
|
@@ -132,7 +132,7 @@ var require_azureNamedKeyCredential = __commonJS({
|
|
|
132
132
|
};
|
|
133
133
|
__name(_AzureNamedKeyCredential, "AzureNamedKeyCredential");
|
|
134
134
|
var AzureNamedKeyCredential = _AzureNamedKeyCredential;
|
|
135
|
-
|
|
135
|
+
exports.AzureNamedKeyCredential = AzureNamedKeyCredential;
|
|
136
136
|
function isNamedKeyCredential(credential) {
|
|
137
137
|
return (0, core_util_1.isObjectWithProperties)(credential, ["name", "key"]) && typeof credential.key === "string" && typeof credential.name === "string";
|
|
138
138
|
}
|
|
@@ -142,11 +142,11 @@ var require_azureNamedKeyCredential = __commonJS({
|
|
|
142
142
|
|
|
143
143
|
// ../../node_modules/.store/@azure-core-auth-npm-1.9.0-456e72b42c/package/dist/commonjs/azureSASCredential.js
|
|
144
144
|
var require_azureSASCredential = __commonJS({
|
|
145
|
-
"../../node_modules/.store/@azure-core-auth-npm-1.9.0-456e72b42c/package/dist/commonjs/azureSASCredential.js"(
|
|
145
|
+
"../../node_modules/.store/@azure-core-auth-npm-1.9.0-456e72b42c/package/dist/commonjs/azureSASCredential.js"(exports) {
|
|
146
146
|
"use strict";
|
|
147
|
-
Object.defineProperty(
|
|
148
|
-
|
|
149
|
-
|
|
147
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
148
|
+
exports.AzureSASCredential = void 0;
|
|
149
|
+
exports.isSASCredential = isSASCredential;
|
|
150
150
|
var core_util_1 = require_commonjs3();
|
|
151
151
|
var _AzureSASCredential = class _AzureSASCredential {
|
|
152
152
|
/**
|
|
@@ -184,7 +184,7 @@ var require_azureSASCredential = __commonJS({
|
|
|
184
184
|
};
|
|
185
185
|
__name(_AzureSASCredential, "AzureSASCredential");
|
|
186
186
|
var AzureSASCredential = _AzureSASCredential;
|
|
187
|
-
|
|
187
|
+
exports.AzureSASCredential = AzureSASCredential;
|
|
188
188
|
function isSASCredential(credential) {
|
|
189
189
|
return (0, core_util_1.isObjectWithProperties)(credential, ["signature"]) && typeof credential.signature === "string";
|
|
190
190
|
}
|
|
@@ -194,12 +194,12 @@ var require_azureSASCredential = __commonJS({
|
|
|
194
194
|
|
|
195
195
|
// ../../node_modules/.store/@azure-core-auth-npm-1.9.0-456e72b42c/package/dist/commonjs/tokenCredential.js
|
|
196
196
|
var require_tokenCredential = __commonJS({
|
|
197
|
-
"../../node_modules/.store/@azure-core-auth-npm-1.9.0-456e72b42c/package/dist/commonjs/tokenCredential.js"(
|
|
197
|
+
"../../node_modules/.store/@azure-core-auth-npm-1.9.0-456e72b42c/package/dist/commonjs/tokenCredential.js"(exports) {
|
|
198
198
|
"use strict";
|
|
199
|
-
Object.defineProperty(
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
199
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
200
|
+
exports.isBearerToken = isBearerToken;
|
|
201
|
+
exports.isPopToken = isPopToken;
|
|
202
|
+
exports.isTokenCredential = isTokenCredential;
|
|
203
203
|
function isBearerToken(accessToken) {
|
|
204
204
|
return !accessToken.tokenType || accessToken.tokenType === "Bearer";
|
|
205
205
|
}
|
|
@@ -218,34 +218,34 @@ var require_tokenCredential = __commonJS({
|
|
|
218
218
|
|
|
219
219
|
// ../../node_modules/.store/@azure-core-auth-npm-1.9.0-456e72b42c/package/dist/commonjs/index.js
|
|
220
220
|
var require_commonjs7 = __commonJS({
|
|
221
|
-
"../../node_modules/.store/@azure-core-auth-npm-1.9.0-456e72b42c/package/dist/commonjs/index.js"(
|
|
221
|
+
"../../node_modules/.store/@azure-core-auth-npm-1.9.0-456e72b42c/package/dist/commonjs/index.js"(exports) {
|
|
222
222
|
"use strict";
|
|
223
|
-
Object.defineProperty(
|
|
224
|
-
|
|
223
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
224
|
+
exports.isTokenCredential = exports.isSASCredential = exports.AzureSASCredential = exports.isNamedKeyCredential = exports.AzureNamedKeyCredential = exports.isKeyCredential = exports.AzureKeyCredential = void 0;
|
|
225
225
|
var azureKeyCredential_js_1 = require_azureKeyCredential();
|
|
226
|
-
Object.defineProperty(
|
|
226
|
+
Object.defineProperty(exports, "AzureKeyCredential", { enumerable: true, get: /* @__PURE__ */ __name(function() {
|
|
227
227
|
return azureKeyCredential_js_1.AzureKeyCredential;
|
|
228
228
|
}, "get") });
|
|
229
229
|
var keyCredential_js_1 = require_keyCredential();
|
|
230
|
-
Object.defineProperty(
|
|
230
|
+
Object.defineProperty(exports, "isKeyCredential", { enumerable: true, get: /* @__PURE__ */ __name(function() {
|
|
231
231
|
return keyCredential_js_1.isKeyCredential;
|
|
232
232
|
}, "get") });
|
|
233
233
|
var azureNamedKeyCredential_js_1 = require_azureNamedKeyCredential();
|
|
234
|
-
Object.defineProperty(
|
|
234
|
+
Object.defineProperty(exports, "AzureNamedKeyCredential", { enumerable: true, get: /* @__PURE__ */ __name(function() {
|
|
235
235
|
return azureNamedKeyCredential_js_1.AzureNamedKeyCredential;
|
|
236
236
|
}, "get") });
|
|
237
|
-
Object.defineProperty(
|
|
237
|
+
Object.defineProperty(exports, "isNamedKeyCredential", { enumerable: true, get: /* @__PURE__ */ __name(function() {
|
|
238
238
|
return azureNamedKeyCredential_js_1.isNamedKeyCredential;
|
|
239
239
|
}, "get") });
|
|
240
240
|
var azureSASCredential_js_1 = require_azureSASCredential();
|
|
241
|
-
Object.defineProperty(
|
|
241
|
+
Object.defineProperty(exports, "AzureSASCredential", { enumerable: true, get: /* @__PURE__ */ __name(function() {
|
|
242
242
|
return azureSASCredential_js_1.AzureSASCredential;
|
|
243
243
|
}, "get") });
|
|
244
|
-
Object.defineProperty(
|
|
244
|
+
Object.defineProperty(exports, "isSASCredential", { enumerable: true, get: /* @__PURE__ */ __name(function() {
|
|
245
245
|
return azureSASCredential_js_1.isSASCredential;
|
|
246
246
|
}, "get") });
|
|
247
247
|
var tokenCredential_js_1 = require_tokenCredential();
|
|
248
|
-
Object.defineProperty(
|
|
248
|
+
Object.defineProperty(exports, "isTokenCredential", { enumerable: true, get: /* @__PURE__ */ __name(function() {
|
|
249
249
|
return tokenCredential_js_1.isTokenCredential;
|
|
250
250
|
}, "get") });
|
|
251
251
|
}
|
|
@@ -253,16 +253,16 @@ var require_commonjs7 = __commonJS({
|
|
|
253
253
|
|
|
254
254
|
// ../../node_modules/.store/@azure-core-http-compat-npm-2.2.0-732687809f/package/dist/commonjs/policies/disableKeepAlivePolicy.js
|
|
255
255
|
var require_disableKeepAlivePolicy = __commonJS({
|
|
256
|
-
"../../node_modules/.store/@azure-core-http-compat-npm-2.2.0-732687809f/package/dist/commonjs/policies/disableKeepAlivePolicy.js"(
|
|
256
|
+
"../../node_modules/.store/@azure-core-http-compat-npm-2.2.0-732687809f/package/dist/commonjs/policies/disableKeepAlivePolicy.js"(exports) {
|
|
257
257
|
"use strict";
|
|
258
|
-
Object.defineProperty(
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
258
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
259
|
+
exports.disableKeepAlivePolicyName = void 0;
|
|
260
|
+
exports.createDisableKeepAlivePolicy = createDisableKeepAlivePolicy;
|
|
261
|
+
exports.pipelineContainsDisableKeepAlivePolicy = pipelineContainsDisableKeepAlivePolicy;
|
|
262
|
+
exports.disableKeepAlivePolicyName = "DisableKeepAlivePolicy";
|
|
263
263
|
function createDisableKeepAlivePolicy() {
|
|
264
264
|
return {
|
|
265
|
-
name:
|
|
265
|
+
name: exports.disableKeepAlivePolicyName,
|
|
266
266
|
async sendRequest(request, next) {
|
|
267
267
|
request.disableKeepAlive = true;
|
|
268
268
|
return next(request);
|
|
@@ -271,7 +271,7 @@ var require_disableKeepAlivePolicy = __commonJS({
|
|
|
271
271
|
}
|
|
272
272
|
__name(createDisableKeepAlivePolicy, "createDisableKeepAlivePolicy");
|
|
273
273
|
function pipelineContainsDisableKeepAlivePolicy(pipeline) {
|
|
274
|
-
return pipeline.getOrderedPolicies().some((policy) => policy.name ===
|
|
274
|
+
return pipeline.getOrderedPolicies().some((policy) => policy.name === exports.disableKeepAlivePolicyName);
|
|
275
275
|
}
|
|
276
276
|
__name(pipelineContainsDisableKeepAlivePolicy, "pipelineContainsDisableKeepAlivePolicy");
|
|
277
277
|
}
|
|
@@ -279,13 +279,13 @@ var require_disableKeepAlivePolicy = __commonJS({
|
|
|
279
279
|
|
|
280
280
|
// ../../node_modules/.store/@azure-core-http-compat-npm-2.2.0-732687809f/package/dist/commonjs/util.js
|
|
281
281
|
var require_util = __commonJS({
|
|
282
|
-
"../../node_modules/.store/@azure-core-http-compat-npm-2.2.0-732687809f/package/dist/commonjs/util.js"(
|
|
282
|
+
"../../node_modules/.store/@azure-core-http-compat-npm-2.2.0-732687809f/package/dist/commonjs/util.js"(exports) {
|
|
283
283
|
"use strict";
|
|
284
|
-
Object.defineProperty(
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
284
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
285
|
+
exports.HttpHeaders = void 0;
|
|
286
|
+
exports.toPipelineRequest = toPipelineRequest;
|
|
287
|
+
exports.toWebResourceLike = toWebResourceLike;
|
|
288
|
+
exports.toHttpHeadersLike = toHttpHeadersLike;
|
|
289
289
|
var core_rest_pipeline_1 = require_commonjs5();
|
|
290
290
|
var originalRequestSymbol = Symbol("Original PipelineRequest");
|
|
291
291
|
var originalClientRequestSymbol = Symbol.for("@azure/core-client original request");
|
|
@@ -524,17 +524,17 @@ var require_util = __commonJS({
|
|
|
524
524
|
};
|
|
525
525
|
__name(_HttpHeaders, "HttpHeaders");
|
|
526
526
|
var HttpHeaders = _HttpHeaders;
|
|
527
|
-
|
|
527
|
+
exports.HttpHeaders = HttpHeaders;
|
|
528
528
|
}
|
|
529
529
|
});
|
|
530
530
|
|
|
531
531
|
// ../../node_modules/.store/@azure-core-http-compat-npm-2.2.0-732687809f/package/dist/commonjs/response.js
|
|
532
532
|
var require_response = __commonJS({
|
|
533
|
-
"../../node_modules/.store/@azure-core-http-compat-npm-2.2.0-732687809f/package/dist/commonjs/response.js"(
|
|
533
|
+
"../../node_modules/.store/@azure-core-http-compat-npm-2.2.0-732687809f/package/dist/commonjs/response.js"(exports) {
|
|
534
534
|
"use strict";
|
|
535
|
-
Object.defineProperty(
|
|
536
|
-
|
|
537
|
-
|
|
535
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
536
|
+
exports.toCompatResponse = toCompatResponse;
|
|
537
|
+
exports.toPipelineResponse = toPipelineResponse;
|
|
538
538
|
var core_rest_pipeline_1 = require_commonjs5();
|
|
539
539
|
var util_js_1 = require_util();
|
|
540
540
|
var originalResponse = Symbol("Original FullOperationResponse");
|
|
@@ -587,10 +587,10 @@ var require_response = __commonJS({
|
|
|
587
587
|
|
|
588
588
|
// ../../node_modules/.store/@azure-core-http-compat-npm-2.2.0-732687809f/package/dist/commonjs/extendedClient.js
|
|
589
589
|
var require_extendedClient = __commonJS({
|
|
590
|
-
"../../node_modules/.store/@azure-core-http-compat-npm-2.2.0-732687809f/package/dist/commonjs/extendedClient.js"(
|
|
590
|
+
"../../node_modules/.store/@azure-core-http-compat-npm-2.2.0-732687809f/package/dist/commonjs/extendedClient.js"(exports) {
|
|
591
591
|
"use strict";
|
|
592
|
-
Object.defineProperty(
|
|
593
|
-
|
|
592
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
593
|
+
exports.ExtendedServiceClient = void 0;
|
|
594
594
|
var disableKeepAlivePolicy_js_1 = require_disableKeepAlivePolicy();
|
|
595
595
|
var core_rest_pipeline_1 = require_commonjs5();
|
|
596
596
|
var core_client_1 = require_commonjs6();
|
|
@@ -638,17 +638,17 @@ var require_extendedClient = __commonJS({
|
|
|
638
638
|
};
|
|
639
639
|
__name(_ExtendedServiceClient, "ExtendedServiceClient");
|
|
640
640
|
var ExtendedServiceClient = _ExtendedServiceClient;
|
|
641
|
-
|
|
641
|
+
exports.ExtendedServiceClient = ExtendedServiceClient;
|
|
642
642
|
}
|
|
643
643
|
});
|
|
644
644
|
|
|
645
645
|
// ../../node_modules/.store/@azure-core-http-compat-npm-2.2.0-732687809f/package/dist/commonjs/policies/requestPolicyFactoryPolicy.js
|
|
646
646
|
var require_requestPolicyFactoryPolicy = __commonJS({
|
|
647
|
-
"../../node_modules/.store/@azure-core-http-compat-npm-2.2.0-732687809f/package/dist/commonjs/policies/requestPolicyFactoryPolicy.js"(
|
|
647
|
+
"../../node_modules/.store/@azure-core-http-compat-npm-2.2.0-732687809f/package/dist/commonjs/policies/requestPolicyFactoryPolicy.js"(exports) {
|
|
648
648
|
"use strict";
|
|
649
|
-
Object.defineProperty(
|
|
650
|
-
|
|
651
|
-
|
|
649
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
650
|
+
exports.requestPolicyFactoryPolicyName = exports.HttpPipelineLogLevel = void 0;
|
|
651
|
+
exports.createRequestPolicyFactoryPolicy = createRequestPolicyFactoryPolicy;
|
|
652
652
|
var util_js_1 = require_util();
|
|
653
653
|
var response_js_1 = require_response();
|
|
654
654
|
var HttpPipelineLogLevel;
|
|
@@ -657,7 +657,7 @@ var require_requestPolicyFactoryPolicy = __commonJS({
|
|
|
657
657
|
HttpPipelineLogLevel2[HttpPipelineLogLevel2["INFO"] = 3] = "INFO";
|
|
658
658
|
HttpPipelineLogLevel2[HttpPipelineLogLevel2["OFF"] = 0] = "OFF";
|
|
659
659
|
HttpPipelineLogLevel2[HttpPipelineLogLevel2["WARNING"] = 2] = "WARNING";
|
|
660
|
-
})(HttpPipelineLogLevel || (
|
|
660
|
+
})(HttpPipelineLogLevel || (exports.HttpPipelineLogLevel = HttpPipelineLogLevel = {}));
|
|
661
661
|
var mockRequestPolicyOptions = {
|
|
662
662
|
log(_logLevel, _message) {
|
|
663
663
|
},
|
|
@@ -665,11 +665,11 @@ var require_requestPolicyFactoryPolicy = __commonJS({
|
|
|
665
665
|
return false;
|
|
666
666
|
}
|
|
667
667
|
};
|
|
668
|
-
|
|
668
|
+
exports.requestPolicyFactoryPolicyName = "RequestPolicyFactoryPolicy";
|
|
669
669
|
function createRequestPolicyFactoryPolicy(factories) {
|
|
670
670
|
const orderedFactories = factories.slice().reverse();
|
|
671
671
|
return {
|
|
672
|
-
name:
|
|
672
|
+
name: exports.requestPolicyFactoryPolicyName,
|
|
673
673
|
async sendRequest(request, next) {
|
|
674
674
|
let httpPipeline = {
|
|
675
675
|
async sendRequest(httpRequest) {
|
|
@@ -692,10 +692,10 @@ var require_requestPolicyFactoryPolicy = __commonJS({
|
|
|
692
692
|
|
|
693
693
|
// ../../node_modules/.store/@azure-core-http-compat-npm-2.2.0-732687809f/package/dist/commonjs/httpClientAdapter.js
|
|
694
694
|
var require_httpClientAdapter = __commonJS({
|
|
695
|
-
"../../node_modules/.store/@azure-core-http-compat-npm-2.2.0-732687809f/package/dist/commonjs/httpClientAdapter.js"(
|
|
695
|
+
"../../node_modules/.store/@azure-core-http-compat-npm-2.2.0-732687809f/package/dist/commonjs/httpClientAdapter.js"(exports) {
|
|
696
696
|
"use strict";
|
|
697
|
-
Object.defineProperty(
|
|
698
|
-
|
|
697
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
698
|
+
exports.convertHttpClient = convertHttpClient;
|
|
699
699
|
var response_js_1 = require_response();
|
|
700
700
|
var util_js_1 = require_util();
|
|
701
701
|
function convertHttpClient(requestPolicyClient) {
|
|
@@ -712,2057 +712,861 @@ var require_httpClientAdapter = __commonJS({
|
|
|
712
712
|
|
|
713
713
|
// ../../node_modules/.store/@azure-core-http-compat-npm-2.2.0-732687809f/package/dist/commonjs/index.js
|
|
714
714
|
var require_commonjs8 = __commonJS({
|
|
715
|
-
"../../node_modules/.store/@azure-core-http-compat-npm-2.2.0-732687809f/package/dist/commonjs/index.js"(
|
|
715
|
+
"../../node_modules/.store/@azure-core-http-compat-npm-2.2.0-732687809f/package/dist/commonjs/index.js"(exports) {
|
|
716
716
|
"use strict";
|
|
717
|
-
Object.defineProperty(
|
|
718
|
-
|
|
717
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
718
|
+
exports.toHttpHeadersLike = exports.convertHttpClient = exports.disableKeepAlivePolicyName = exports.HttpPipelineLogLevel = exports.createRequestPolicyFactoryPolicy = exports.requestPolicyFactoryPolicyName = exports.ExtendedServiceClient = void 0;
|
|
719
719
|
var extendedClient_js_1 = require_extendedClient();
|
|
720
|
-
Object.defineProperty(
|
|
720
|
+
Object.defineProperty(exports, "ExtendedServiceClient", { enumerable: true, get: /* @__PURE__ */ __name(function() {
|
|
721
721
|
return extendedClient_js_1.ExtendedServiceClient;
|
|
722
722
|
}, "get") });
|
|
723
723
|
var requestPolicyFactoryPolicy_js_1 = require_requestPolicyFactoryPolicy();
|
|
724
|
-
Object.defineProperty(
|
|
724
|
+
Object.defineProperty(exports, "requestPolicyFactoryPolicyName", { enumerable: true, get: /* @__PURE__ */ __name(function() {
|
|
725
725
|
return requestPolicyFactoryPolicy_js_1.requestPolicyFactoryPolicyName;
|
|
726
726
|
}, "get") });
|
|
727
|
-
Object.defineProperty(
|
|
727
|
+
Object.defineProperty(exports, "createRequestPolicyFactoryPolicy", { enumerable: true, get: /* @__PURE__ */ __name(function() {
|
|
728
728
|
return requestPolicyFactoryPolicy_js_1.createRequestPolicyFactoryPolicy;
|
|
729
729
|
}, "get") });
|
|
730
|
-
Object.defineProperty(
|
|
730
|
+
Object.defineProperty(exports, "HttpPipelineLogLevel", { enumerable: true, get: /* @__PURE__ */ __name(function() {
|
|
731
731
|
return requestPolicyFactoryPolicy_js_1.HttpPipelineLogLevel;
|
|
732
732
|
}, "get") });
|
|
733
733
|
var disableKeepAlivePolicy_js_1 = require_disableKeepAlivePolicy();
|
|
734
|
-
Object.defineProperty(
|
|
734
|
+
Object.defineProperty(exports, "disableKeepAlivePolicyName", { enumerable: true, get: /* @__PURE__ */ __name(function() {
|
|
735
735
|
return disableKeepAlivePolicy_js_1.disableKeepAlivePolicyName;
|
|
736
736
|
}, "get") });
|
|
737
737
|
var httpClientAdapter_js_1 = require_httpClientAdapter();
|
|
738
|
-
Object.defineProperty(
|
|
738
|
+
Object.defineProperty(exports, "convertHttpClient", { enumerable: true, get: /* @__PURE__ */ __name(function() {
|
|
739
739
|
return httpClientAdapter_js_1.convertHttpClient;
|
|
740
740
|
}, "get") });
|
|
741
741
|
var util_js_1 = require_util();
|
|
742
|
-
Object.defineProperty(
|
|
742
|
+
Object.defineProperty(exports, "toHttpHeadersLike", { enumerable: true, get: /* @__PURE__ */ __name(function() {
|
|
743
743
|
return util_js_1.toHttpHeadersLike;
|
|
744
744
|
}, "get") });
|
|
745
745
|
}
|
|
746
746
|
});
|
|
747
747
|
|
|
748
|
-
// ../../node_modules/.store/fast-xml-parser-npm-5.0
|
|
748
|
+
// ../../node_modules/.store/fast-xml-parser-npm-5.2.0-581e306392/package/lib/fxp.cjs
|
|
749
749
|
var require_fxp = __commonJS({
|
|
750
|
-
"../../node_modules/.store/fast-xml-parser-npm-5.0
|
|
750
|
+
"../../node_modules/.store/fast-xml-parser-npm-5.2.0-581e306392/package/lib/fxp.cjs"(exports, module) {
|
|
751
751
|
(() => {
|
|
752
752
|
"use strict";
|
|
753
|
-
var
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
const
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
let trimmedStr = str.trim();
|
|
785
|
-
|
|
786
|
-
if(options.skipLike !== undefined && options.skipLike.test(trimmedStr)) return str;
|
|
787
|
-
else if(str==="0") return 0;
|
|
788
|
-
else if (options.hex && hexRegex.test(trimmedStr)) {
|
|
789
|
-
return parse_int(trimmedStr, 16);
|
|
790
|
-
// }else if (options.oct && octRegex.test(str)) {
|
|
791
|
-
// return Number.parseInt(val, 8);
|
|
792
|
-
}else if (trimmedStr.search(/[eE]/)!== -1) { //eNotation
|
|
793
|
-
const notation = trimmedStr.match(/^([-\\+])?(0*)([0-9]*(\\.[0-9]*)?[eE][-\\+]?[0-9]+)$/);
|
|
794
|
-
// +00.123 => [ , '+', '00', '.123', ..
|
|
795
|
-
if(notation){
|
|
796
|
-
// console.log(notation)
|
|
797
|
-
if(options.leadingZeros){ //accept with leading zeros
|
|
798
|
-
trimmedStr = (notation[1] || "") + notation[3];
|
|
799
|
-
}else{
|
|
800
|
-
if(notation[2] === "0" && notation[3][0]=== "."){ //valid number
|
|
801
|
-
}else{
|
|
802
|
-
return str;
|
|
803
|
-
}
|
|
804
|
-
}
|
|
805
|
-
return options.eNotation ? Number(trimmedStr) : str;
|
|
806
|
-
}else{
|
|
807
|
-
return str;
|
|
808
|
-
}
|
|
809
|
-
// }else if (options.parseBin && binRegex.test(str)) {
|
|
810
|
-
// return Number.parseInt(val, 2);
|
|
811
|
-
}else{
|
|
812
|
-
//separate negative sign, leading zeros, and rest number
|
|
813
|
-
const match = numRegex.exec(trimmedStr);
|
|
814
|
-
// +00.123 => [ , '+', '00', '.123', ..
|
|
815
|
-
if(match){
|
|
816
|
-
const sign = match[1];
|
|
817
|
-
const leadingZeros = match[2];
|
|
818
|
-
let numTrimmedByZeros = trimZeros(match[3]); //complete num without leading zeros
|
|
819
|
-
//trim ending zeros for floating number
|
|
820
|
-
|
|
821
|
-
if(!options.leadingZeros && leadingZeros.length > 0 && sign && trimmedStr[2] !== ".") return str; //-0123
|
|
822
|
-
else if(!options.leadingZeros && leadingZeros.length > 0 && !sign && trimmedStr[1] !== ".") return str; //0123
|
|
823
|
-
else if(options.leadingZeros && leadingZeros===str) return 0; //00
|
|
824
|
-
|
|
825
|
-
else{//no leading zeros or leading zeros are allowed
|
|
826
|
-
const num = Number(trimmedStr);
|
|
827
|
-
const numStr = "" + num;
|
|
828
|
-
|
|
829
|
-
if(numStr.search(/[eE]/) !== -1){ //given number is long and parsed to eNotation
|
|
830
|
-
if(options.eNotation) return num;
|
|
831
|
-
else return str;
|
|
832
|
-
}else if(trimmedStr.indexOf(".") !== -1){ //floating number
|
|
833
|
-
if(numStr === "0" && (numTrimmedByZeros === "") ) return num; //0.0
|
|
834
|
-
else if(numStr === numTrimmedByZeros) return num; //0.456. 0.79000
|
|
835
|
-
else if( sign && numStr === "-"+numTrimmedByZeros) return num;
|
|
836
|
-
else return str;
|
|
837
|
-
}
|
|
838
|
-
|
|
839
|
-
if(leadingZeros){
|
|
840
|
-
return (numTrimmedByZeros === numStr) || (sign+numTrimmedByZeros === numStr) ? num : str
|
|
841
|
-
}else {
|
|
842
|
-
return (trimmedStr === numStr) || (trimmedStr === sign+numStr) ? num : str
|
|
843
|
-
}
|
|
844
|
-
}
|
|
845
|
-
}else{ //non-numeric string
|
|
846
|
-
return str;
|
|
847
|
-
}
|
|
848
|
-
}
|
|
849
|
-
}
|
|
850
|
-
|
|
851
|
-
/**
|
|
852
|
-
*
|
|
853
|
-
* @param {string} numStr without leading zeros
|
|
854
|
-
* @returns
|
|
855
|
-
*/
|
|
856
|
-
function trimZeros(numStr){
|
|
857
|
-
if(numStr && numStr.indexOf(".") !== -1){//float
|
|
858
|
-
numStr = numStr.replace(/0+$/, ""); //remove ending zeros
|
|
859
|
-
if(numStr === ".") numStr = "0";
|
|
860
|
-
else if(numStr[0] === ".") numStr = "0"+numStr;
|
|
861
|
-
else if(numStr[numStr.length-1] === ".") numStr = numStr.substr(0,numStr.length-1);
|
|
862
|
-
return numStr;
|
|
863
|
-
}
|
|
864
|
-
return numStr;
|
|
865
|
-
}
|
|
866
|
-
|
|
867
|
-
function parse_int(numStr, base){
|
|
868
|
-
//polyfill
|
|
869
|
-
if(parseInt) return parseInt(numStr, base);
|
|
870
|
-
else if(Number.parseInt) return Number.parseInt(numStr, base);
|
|
871
|
-
else if(window && window.parseInt) return window.parseInt(numStr, base);
|
|
872
|
-
else throw new Error("parseInt, Number.parseInt, window.parseInt are not supported")
|
|
873
|
-
}
|
|
874
|
-
|
|
875
|
-
//# sourceURL=webpack://fast-xml-parser/./node_modules/strnum/strnum.js?`);
|
|
876
|
-
}, "./node_modules/strnum/strnum.js")
|
|
877
|
-
),
|
|
878
|
-
/***/
|
|
879
|
-
"./src/fxp.js": (
|
|
880
|
-
/*!********************!*\
|
|
881
|
-
!*** ./src/fxp.js ***!
|
|
882
|
-
\********************/
|
|
883
|
-
/***/
|
|
884
|
-
/* @__PURE__ */ __name((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
|
885
|
-
eval('__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ XMLBuilder: () => (/* reexport safe */ _xmlbuilder_json2xml_js__WEBPACK_IMPORTED_MODULE_2__["default"]),\n/* harmony export */ XMLParser: () => (/* reexport safe */ _xmlparser_XMLParser_js__WEBPACK_IMPORTED_MODULE_1__["default"]),\n/* harmony export */ XMLValidator: () => (/* binding */ XMLValidator)\n/* harmony export */ });\n/* harmony import */ var _validator_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./validator.js */ "./src/validator.js");\n/* harmony import */ var _xmlparser_XMLParser_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./xmlparser/XMLParser.js */ "./src/xmlparser/XMLParser.js");\n/* harmony import */ var _xmlbuilder_json2xml_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./xmlbuilder/json2xml.js */ "./src/xmlbuilder/json2xml.js");\n\n\n\n\n\n\nconst XMLValidator = {\n validate: _validator_js__WEBPACK_IMPORTED_MODULE_0__.validate\n}\n\n\n//# sourceURL=webpack://fast-xml-parser/./src/fxp.js?');
|
|
886
|
-
}, "./src/fxp.js")
|
|
887
|
-
),
|
|
888
|
-
/***/
|
|
889
|
-
"./src/ignoreAttributes.js": (
|
|
890
|
-
/*!*********************************!*\
|
|
891
|
-
!*** ./src/ignoreAttributes.js ***!
|
|
892
|
-
\*********************************/
|
|
893
|
-
/***/
|
|
894
|
-
/* @__PURE__ */ __name((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
|
895
|
-
eval(`__webpack_require__.r(__webpack_exports__);
|
|
896
|
-
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
897
|
-
/* harmony export */ "default": () => (/* binding */ getIgnoreAttributesFn)
|
|
898
|
-
/* harmony export */ });
|
|
899
|
-
function getIgnoreAttributesFn(ignoreAttributes) {
|
|
900
|
-
if (typeof ignoreAttributes === 'function') {
|
|
901
|
-
return ignoreAttributes
|
|
902
|
-
}
|
|
903
|
-
if (Array.isArray(ignoreAttributes)) {
|
|
904
|
-
return (attrName) => {
|
|
905
|
-
for (const pattern of ignoreAttributes) {
|
|
906
|
-
if (typeof pattern === 'string' && attrName === pattern) {
|
|
907
|
-
return true
|
|
908
|
-
}
|
|
909
|
-
if (pattern instanceof RegExp && pattern.test(attrName)) {
|
|
910
|
-
return true
|
|
911
|
-
}
|
|
912
|
-
}
|
|
913
|
-
}
|
|
914
|
-
}
|
|
915
|
-
return () => false
|
|
916
|
-
}
|
|
917
|
-
|
|
918
|
-
//# sourceURL=webpack://fast-xml-parser/./src/ignoreAttributes.js?`);
|
|
919
|
-
}, "./src/ignoreAttributes.js")
|
|
920
|
-
),
|
|
921
|
-
/***/
|
|
922
|
-
"./src/util.js": (
|
|
923
|
-
/*!*********************!*\
|
|
924
|
-
!*** ./src/util.js ***!
|
|
925
|
-
\*********************/
|
|
926
|
-
/***/
|
|
927
|
-
/* @__PURE__ */ __name((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
|
928
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ getAllMatches: () => (/* binding */ getAllMatches),\n/* harmony export */ getValue: () => (/* binding */ getValue),\n/* harmony export */ isEmptyObject: () => (/* binding */ isEmptyObject),\n/* harmony export */ isExist: () => (/* binding */ isExist),\n/* harmony export */ isName: () => (/* binding */ isName),\n/* harmony export */ merge: () => (/* binding */ merge),\n/* harmony export */ nameRegexp: () => (/* binding */ nameRegexp)\n/* harmony export */ });\n\n\nconst nameStartChar = ':A-Za-z_\\\\u00C0-\\\\u00D6\\\\u00D8-\\\\u00F6\\\\u00F8-\\\\u02FF\\\\u0370-\\\\u037D\\\\u037F-\\\\u1FFF\\\\u200C-\\\\u200D\\\\u2070-\\\\u218F\\\\u2C00-\\\\u2FEF\\\\u3001-\\\\uD7FF\\\\uF900-\\\\uFDCF\\\\uFDF0-\\\\uFFFD';\nconst nameChar = nameStartChar + '\\\\-.\\\\d\\\\u00B7\\\\u0300-\\\\u036F\\\\u203F-\\\\u2040';\nconst nameRegexp = '[' + nameStartChar + '][' + nameChar + ']*';\nconst regexName = new RegExp('^' + nameRegexp + '$');\n\nfunction getAllMatches(string, regex) {\n const matches = [];\n let match = regex.exec(string);\n while (match) {\n const allmatches = [];\n allmatches.startIndex = regex.lastIndex - match[0].length;\n const len = match.length;\n for (let index = 0; index < len; index++) {\n allmatches.push(match[index]);\n }\n matches.push(allmatches);\n match = regex.exec(string);\n }\n return matches;\n}\n\nconst isName = function(string) {\n const match = regexName.exec(string);\n return !(match === null || typeof match === 'undefined');\n}\n\nfunction isExist(v) {\n return typeof v !== 'undefined';\n}\n\nfunction isEmptyObject(obj) {\n return Object.keys(obj).length === 0;\n}\n\n/**\n * Copy all the properties of a into b.\n * @param {*} target\n * @param {*} a\n */\nfunction merge(target, a, arrayMode) {\n if (a) {\n const keys = Object.keys(a); // will return an array of own properties\n const len = keys.length; //don't make it inline\n for (let i = 0; i < len; i++) {\n if (arrayMode === 'strict') {\n target[keys[i]] = [ a[keys[i]] ];\n } else {\n target[keys[i]] = a[keys[i]];\n }\n }\n }\n}\n/* exports.merge =function (b,a){\n return Object.assign(b,a);\n} */\n\nfunction getValue(v) {\n if (exports.isExist(v)) {\n return v;\n } else {\n return '';\n }\n}\n\n// const fakeCall = function(a) {return a;};\n// const fakeCallNoReturn = function() {};\n\n//# sourceURL=webpack://fast-xml-parser/./src/util.js?");
|
|
929
|
-
}, "./src/util.js")
|
|
930
|
-
),
|
|
931
|
-
/***/
|
|
932
|
-
"./src/validator.js": (
|
|
933
|
-
/*!**************************!*\
|
|
934
|
-
!*** ./src/validator.js ***!
|
|
935
|
-
\**************************/
|
|
936
|
-
/***/
|
|
937
|
-
/* @__PURE__ */ __name((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
|
938
|
-
eval(`__webpack_require__.r(__webpack_exports__);
|
|
939
|
-
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
940
|
-
/* harmony export */ validate: () => (/* binding */ validate)
|
|
941
|
-
/* harmony export */ });
|
|
942
|
-
/* harmony import */ var _util_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./util.js */ "./src/util.js");
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
const defaultOptions = {
|
|
948
|
-
allowBooleanAttributes: false, //A tag can have attributes without any value
|
|
949
|
-
unpairedTags: []
|
|
950
|
-
};
|
|
951
|
-
|
|
952
|
-
//const tagsPattern = new RegExp("<\\\\/?([\\\\w:\\\\-_\\.]+)\\\\s*\\/?>","g");
|
|
953
|
-
function validate(xmlData, options) {
|
|
954
|
-
options = Object.assign({}, defaultOptions, options);
|
|
955
|
-
|
|
956
|
-
//xmlData = xmlData.replace(/(\\r\\n|\\n|\\r)/gm,"");//make it single line
|
|
957
|
-
//xmlData = xmlData.replace(/(^\\s*<\\?xml.*?\\?>)/g,"");//Remove XML starting tag
|
|
958
|
-
//xmlData = xmlData.replace(/(<!DOCTYPE[\\s\\w\\"\\.\\/\\-\\:]+(\\[.*\\])*\\s*>)/g,"");//Remove DOCTYPE
|
|
959
|
-
const tags = [];
|
|
960
|
-
let tagFound = false;
|
|
961
|
-
|
|
962
|
-
//indicates that the root tag has been closed (aka. depth 0 has been reached)
|
|
963
|
-
let reachedRoot = false;
|
|
964
|
-
|
|
965
|
-
if (xmlData[0] === '\\ufeff') {
|
|
966
|
-
// check for byte order mark (BOM)
|
|
967
|
-
xmlData = xmlData.substr(1);
|
|
968
|
-
}
|
|
969
|
-
|
|
970
|
-
for (let i = 0; i < xmlData.length; i++) {
|
|
971
|
-
|
|
972
|
-
if (xmlData[i] === '<' && xmlData[i+1] === '?') {
|
|
973
|
-
i+=2;
|
|
974
|
-
i = readPI(xmlData,i);
|
|
975
|
-
if (i.err) return i;
|
|
976
|
-
}else if (xmlData[i] === '<') {
|
|
977
|
-
//starting of tag
|
|
978
|
-
//read until you reach to '>' avoiding any '>' in attribute value
|
|
979
|
-
let tagStartPos = i;
|
|
980
|
-
i++;
|
|
981
|
-
|
|
982
|
-
if (xmlData[i] === '!') {
|
|
983
|
-
i = readCommentAndCDATA(xmlData, i);
|
|
984
|
-
continue;
|
|
985
|
-
} else {
|
|
986
|
-
let closingTag = false;
|
|
987
|
-
if (xmlData[i] === '/') {
|
|
988
|
-
//closing tag
|
|
989
|
-
closingTag = true;
|
|
990
|
-
i++;
|
|
991
|
-
}
|
|
992
|
-
//read tagname
|
|
993
|
-
let tagName = '';
|
|
994
|
-
for (; i < xmlData.length &&
|
|
995
|
-
xmlData[i] !== '>' &&
|
|
996
|
-
xmlData[i] !== ' ' &&
|
|
997
|
-
xmlData[i] !== '\\t' &&
|
|
998
|
-
xmlData[i] !== '\\n' &&
|
|
999
|
-
xmlData[i] !== '\\r'; i++
|
|
1000
|
-
) {
|
|
1001
|
-
tagName += xmlData[i];
|
|
1002
|
-
}
|
|
1003
|
-
tagName = tagName.trim();
|
|
1004
|
-
//console.log(tagName);
|
|
1005
|
-
|
|
1006
|
-
if (tagName[tagName.length - 1] === '/') {
|
|
1007
|
-
//self closing tag without attributes
|
|
1008
|
-
tagName = tagName.substring(0, tagName.length - 1);
|
|
1009
|
-
//continue;
|
|
1010
|
-
i--;
|
|
1011
|
-
}
|
|
1012
|
-
if (!validateTagName(tagName)) {
|
|
1013
|
-
let msg;
|
|
1014
|
-
if (tagName.trim().length === 0) {
|
|
1015
|
-
msg = "Invalid space after '<'.";
|
|
1016
|
-
} else {
|
|
1017
|
-
msg = "Tag '"+tagName+"' is an invalid name.";
|
|
1018
|
-
}
|
|
1019
|
-
return getErrorObject('InvalidTag', msg, getLineNumberForPosition(xmlData, i));
|
|
1020
|
-
}
|
|
1021
|
-
|
|
1022
|
-
const result = readAttributeStr(xmlData, i);
|
|
1023
|
-
if (result === false) {
|
|
1024
|
-
return getErrorObject('InvalidAttr', "Attributes for '"+tagName+"' have open quote.", getLineNumberForPosition(xmlData, i));
|
|
1025
|
-
}
|
|
1026
|
-
let attrStr = result.value;
|
|
1027
|
-
i = result.index;
|
|
1028
|
-
|
|
1029
|
-
if (attrStr[attrStr.length - 1] === '/') {
|
|
1030
|
-
//self closing tag
|
|
1031
|
-
const attrStrStart = i - attrStr.length;
|
|
1032
|
-
attrStr = attrStr.substring(0, attrStr.length - 1);
|
|
1033
|
-
const isValid = validateAttributeString(attrStr, options);
|
|
1034
|
-
if (isValid === true) {
|
|
1035
|
-
tagFound = true;
|
|
1036
|
-
//continue; //text may presents after self closing tag
|
|
1037
|
-
} else {
|
|
1038
|
-
//the result from the nested function returns the position of the error within the attribute
|
|
1039
|
-
//in order to get the 'true' error line, we need to calculate the position where the attribute begins (i - attrStr.length) and then add the position within the attribute
|
|
1040
|
-
//this gives us the absolute index in the entire xml, which we can use to find the line at last
|
|
1041
|
-
return getErrorObject(isValid.err.code, isValid.err.msg, getLineNumberForPosition(xmlData, attrStrStart + isValid.err.line));
|
|
1042
|
-
}
|
|
1043
|
-
} else if (closingTag) {
|
|
1044
|
-
if (!result.tagClosed) {
|
|
1045
|
-
return getErrorObject('InvalidTag', "Closing tag '"+tagName+"' doesn't have proper closing.", getLineNumberForPosition(xmlData, i));
|
|
1046
|
-
} else if (attrStr.trim().length > 0) {
|
|
1047
|
-
return getErrorObject('InvalidTag', "Closing tag '"+tagName+"' can't have attributes or invalid starting.", getLineNumberForPosition(xmlData, tagStartPos));
|
|
1048
|
-
} else if (tags.length === 0) {
|
|
1049
|
-
return getErrorObject('InvalidTag', "Closing tag '"+tagName+"' has not been opened.", getLineNumberForPosition(xmlData, tagStartPos));
|
|
1050
|
-
} else {
|
|
1051
|
-
const otg = tags.pop();
|
|
1052
|
-
if (tagName !== otg.tagName) {
|
|
1053
|
-
let openPos = getLineNumberForPosition(xmlData, otg.tagStartPos);
|
|
1054
|
-
return getErrorObject('InvalidTag',
|
|
1055
|
-
"Expected closing tag '"+otg.tagName+"' (opened in line "+openPos.line+", col "+openPos.col+") instead of closing tag '"+tagName+"'.",
|
|
1056
|
-
getLineNumberForPosition(xmlData, tagStartPos));
|
|
1057
|
-
}
|
|
1058
|
-
|
|
1059
|
-
//when there are no more tags, we reached the root level.
|
|
1060
|
-
if (tags.length == 0) {
|
|
1061
|
-
reachedRoot = true;
|
|
1062
|
-
}
|
|
1063
|
-
}
|
|
753
|
+
var t = { d: /* @__PURE__ */ __name((e2, n2) => {
|
|
754
|
+
for (var i2 in n2) t.o(n2, i2) && !t.o(e2, i2) && Object.defineProperty(e2, i2, { enumerable: true, get: n2[i2] });
|
|
755
|
+
}, "d"), o: /* @__PURE__ */ __name((t2, e2) => Object.prototype.hasOwnProperty.call(t2, e2), "o"), r: /* @__PURE__ */ __name((t2) => {
|
|
756
|
+
"undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(t2, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(t2, "__esModule", { value: true });
|
|
757
|
+
}, "r") }, e = {};
|
|
758
|
+
t.r(e), t.d(e, { XMLBuilder: /* @__PURE__ */ __name(() => dt, "XMLBuilder"), XMLParser: /* @__PURE__ */ __name(() => it, "XMLParser"), XMLValidator: /* @__PURE__ */ __name(() => gt, "XMLValidator") });
|
|
759
|
+
const n = ":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD", i = new RegExp("^[" + n + "][" + n + "\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$");
|
|
760
|
+
function s(t2, e2) {
|
|
761
|
+
const n2 = [];
|
|
762
|
+
let i2 = e2.exec(t2);
|
|
763
|
+
for (; i2; ) {
|
|
764
|
+
const s2 = [];
|
|
765
|
+
s2.startIndex = e2.lastIndex - i2[0].length;
|
|
766
|
+
const r2 = i2.length;
|
|
767
|
+
for (let t3 = 0; t3 < r2; t3++) s2.push(i2[t3]);
|
|
768
|
+
n2.push(s2), i2 = e2.exec(t2);
|
|
769
|
+
}
|
|
770
|
+
return n2;
|
|
771
|
+
}
|
|
772
|
+
__name(s, "s");
|
|
773
|
+
const r = /* @__PURE__ */ __name(function(t2) {
|
|
774
|
+
return !(null == i.exec(t2));
|
|
775
|
+
}, "r"), o = { allowBooleanAttributes: false, unpairedTags: [] };
|
|
776
|
+
function a(t2, e2) {
|
|
777
|
+
e2 = Object.assign({}, o, e2);
|
|
778
|
+
const n2 = [];
|
|
779
|
+
let i2 = false, s2 = false;
|
|
780
|
+
"\uFEFF" === t2[0] && (t2 = t2.substr(1));
|
|
781
|
+
for (let o2 = 0; o2 < t2.length; o2++) if ("<" === t2[o2] && "?" === t2[o2 + 1]) {
|
|
782
|
+
if (o2 += 2, o2 = u(t2, o2), o2.err) return o2;
|
|
1064
783
|
} else {
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
//if the root level has been reached before ...
|
|
1074
|
-
if (reachedRoot === true) {
|
|
1075
|
-
return getErrorObject('InvalidXml', 'Multiple possible root nodes found.', getLineNumberForPosition(xmlData, i));
|
|
1076
|
-
} else if(options.unpairedTags.indexOf(tagName) !== -1){
|
|
1077
|
-
//don't push into stack
|
|
1078
|
-
} else {
|
|
1079
|
-
tags.push({tagName, tagStartPos});
|
|
1080
|
-
}
|
|
1081
|
-
tagFound = true;
|
|
1082
|
-
}
|
|
1083
|
-
|
|
1084
|
-
//skip tag text value
|
|
1085
|
-
//It may include comments and CDATA value
|
|
1086
|
-
for (i++; i < xmlData.length; i++) {
|
|
1087
|
-
if (xmlData[i] === '<') {
|
|
1088
|
-
if (xmlData[i + 1] === '!') {
|
|
1089
|
-
//comment or CADATA
|
|
1090
|
-
i++;
|
|
1091
|
-
i = readCommentAndCDATA(xmlData, i);
|
|
784
|
+
if ("<" !== t2[o2]) {
|
|
785
|
+
if (l(t2[o2])) continue;
|
|
786
|
+
return x("InvalidChar", "char '" + t2[o2] + "' is not expected.", N(t2, o2));
|
|
787
|
+
}
|
|
788
|
+
{
|
|
789
|
+
let a2 = o2;
|
|
790
|
+
if (o2++, "!" === t2[o2]) {
|
|
791
|
+
o2 = h(t2, o2);
|
|
1092
792
|
continue;
|
|
1093
|
-
} else if (xmlData[i+1] === '?') {
|
|
1094
|
-
i = readPI(xmlData, ++i);
|
|
1095
|
-
if (i.err) return i;
|
|
1096
|
-
} else{
|
|
1097
|
-
break;
|
|
1098
|
-
}
|
|
1099
|
-
} else if (xmlData[i] === '&') {
|
|
1100
|
-
const afterAmp = validateAmpersand(xmlData, i);
|
|
1101
|
-
if (afterAmp == -1)
|
|
1102
|
-
return getErrorObject('InvalidChar', "char '&' is not expected.", getLineNumberForPosition(xmlData, i));
|
|
1103
|
-
i = afterAmp;
|
|
1104
|
-
}else{
|
|
1105
|
-
if (reachedRoot === true && !isWhiteSpace(xmlData[i])) {
|
|
1106
|
-
return getErrorObject('InvalidXml', "Extra text at the end", getLineNumberForPosition(xmlData, i));
|
|
1107
793
|
}
|
|
794
|
+
{
|
|
795
|
+
let d2 = false;
|
|
796
|
+
"/" === t2[o2] && (d2 = true, o2++);
|
|
797
|
+
let c2 = "";
|
|
798
|
+
for (; o2 < t2.length && ">" !== t2[o2] && " " !== t2[o2] && " " !== t2[o2] && "\n" !== t2[o2] && "\r" !== t2[o2]; o2++) c2 += t2[o2];
|
|
799
|
+
if (c2 = c2.trim(), "/" === c2[c2.length - 1] && (c2 = c2.substring(0, c2.length - 1), o2--), !r(c2)) {
|
|
800
|
+
let e3;
|
|
801
|
+
return e3 = 0 === c2.trim().length ? "Invalid space after '<'." : "Tag '" + c2 + "' is an invalid name.", x("InvalidTag", e3, N(t2, o2));
|
|
802
|
+
}
|
|
803
|
+
const f2 = p(t2, o2);
|
|
804
|
+
if (false === f2) return x("InvalidAttr", "Attributes for '" + c2 + "' have open quote.", N(t2, o2));
|
|
805
|
+
let b2 = f2.value;
|
|
806
|
+
if (o2 = f2.index, "/" === b2[b2.length - 1]) {
|
|
807
|
+
const n3 = o2 - b2.length;
|
|
808
|
+
b2 = b2.substring(0, b2.length - 1);
|
|
809
|
+
const s3 = g(b2, e2);
|
|
810
|
+
if (true !== s3) return x(s3.err.code, s3.err.msg, N(t2, n3 + s3.err.line));
|
|
811
|
+
i2 = true;
|
|
812
|
+
} else if (d2) {
|
|
813
|
+
if (!f2.tagClosed) return x("InvalidTag", "Closing tag '" + c2 + "' doesn't have proper closing.", N(t2, o2));
|
|
814
|
+
if (b2.trim().length > 0) return x("InvalidTag", "Closing tag '" + c2 + "' can't have attributes or invalid starting.", N(t2, a2));
|
|
815
|
+
if (0 === n2.length) return x("InvalidTag", "Closing tag '" + c2 + "' has not been opened.", N(t2, a2));
|
|
816
|
+
{
|
|
817
|
+
const e3 = n2.pop();
|
|
818
|
+
if (c2 !== e3.tagName) {
|
|
819
|
+
let n3 = N(t2, e3.tagStartPos);
|
|
820
|
+
return x("InvalidTag", "Expected closing tag '" + e3.tagName + "' (opened in line " + n3.line + ", col " + n3.col + ") instead of closing tag '" + c2 + "'.", N(t2, a2));
|
|
821
|
+
}
|
|
822
|
+
0 == n2.length && (s2 = true);
|
|
823
|
+
}
|
|
824
|
+
} else {
|
|
825
|
+
const r2 = g(b2, e2);
|
|
826
|
+
if (true !== r2) return x(r2.err.code, r2.err.msg, N(t2, o2 - b2.length + r2.err.line));
|
|
827
|
+
if (true === s2) return x("InvalidXml", "Multiple possible root nodes found.", N(t2, o2));
|
|
828
|
+
-1 !== e2.unpairedTags.indexOf(c2) || n2.push({ tagName: c2, tagStartPos: a2 }), i2 = true;
|
|
829
|
+
}
|
|
830
|
+
for (o2++; o2 < t2.length; o2++) if ("<" === t2[o2]) {
|
|
831
|
+
if ("!" === t2[o2 + 1]) {
|
|
832
|
+
o2++, o2 = h(t2, o2);
|
|
833
|
+
continue;
|
|
834
|
+
}
|
|
835
|
+
if ("?" !== t2[o2 + 1]) break;
|
|
836
|
+
if (o2 = u(t2, ++o2), o2.err) return o2;
|
|
837
|
+
} else if ("&" === t2[o2]) {
|
|
838
|
+
const e3 = m(t2, o2);
|
|
839
|
+
if (-1 == e3) return x("InvalidChar", "char '&' is not expected.", N(t2, o2));
|
|
840
|
+
o2 = e3;
|
|
841
|
+
} else if (true === s2 && !l(t2[o2])) return x("InvalidXml", "Extra text at the end", N(t2, o2));
|
|
842
|
+
"<" === t2[o2] && o2--;
|
|
843
|
+
}
|
|
844
|
+
}
|
|
845
|
+
}
|
|
846
|
+
return i2 ? 1 == n2.length ? x("InvalidTag", "Unclosed tag '" + n2[0].tagName + "'.", N(t2, n2[0].tagStartPos)) : !(n2.length > 0) || x("InvalidXml", "Invalid '" + JSON.stringify(n2.map((t3) => t3.tagName), null, 4).replace(/\r?\n/g, "") + "' found.", { line: 1, col: 1 }) : x("InvalidXml", "Start tag expected.", 1);
|
|
847
|
+
}
|
|
848
|
+
__name(a, "a");
|
|
849
|
+
function l(t2) {
|
|
850
|
+
return " " === t2 || " " === t2 || "\n" === t2 || "\r" === t2;
|
|
851
|
+
}
|
|
852
|
+
__name(l, "l");
|
|
853
|
+
function u(t2, e2) {
|
|
854
|
+
const n2 = e2;
|
|
855
|
+
for (; e2 < t2.length; e2++) if ("?" != t2[e2] && " " != t2[e2]) ;
|
|
856
|
+
else {
|
|
857
|
+
const i2 = t2.substr(n2, e2 - n2);
|
|
858
|
+
if (e2 > 5 && "xml" === i2) return x("InvalidXml", "XML declaration allowed only at the start of the document.", N(t2, e2));
|
|
859
|
+
if ("?" == t2[e2] && ">" == t2[e2 + 1]) {
|
|
860
|
+
e2++;
|
|
861
|
+
break;
|
|
1108
862
|
}
|
|
1109
|
-
} //end of reading tag text value
|
|
1110
|
-
if (xmlData[i] === '<') {
|
|
1111
|
-
i--;
|
|
1112
|
-
}
|
|
1113
|
-
}
|
|
1114
|
-
} else {
|
|
1115
|
-
if ( isWhiteSpace(xmlData[i])) {
|
|
1116
|
-
continue;
|
|
1117
|
-
}
|
|
1118
|
-
return getErrorObject('InvalidChar', "char '"+xmlData[i]+"' is not expected.", getLineNumberForPosition(xmlData, i));
|
|
1119
|
-
}
|
|
1120
|
-
}
|
|
1121
|
-
|
|
1122
|
-
if (!tagFound) {
|
|
1123
|
-
return getErrorObject('InvalidXml', 'Start tag expected.', 1);
|
|
1124
|
-
}else if (tags.length == 1) {
|
|
1125
|
-
return getErrorObject('InvalidTag', "Unclosed tag '"+tags[0].tagName+"'.", getLineNumberForPosition(xmlData, tags[0].tagStartPos));
|
|
1126
|
-
}else if (tags.length > 0) {
|
|
1127
|
-
return getErrorObject('InvalidXml', "Invalid '"+
|
|
1128
|
-
JSON.stringify(tags.map(t => t.tagName), null, 4).replace(/\\r?\\n/g, '')+
|
|
1129
|
-
"' found.", {line: 1, col: 1});
|
|
1130
|
-
}
|
|
1131
|
-
|
|
1132
|
-
return true;
|
|
1133
|
-
};
|
|
1134
|
-
|
|
1135
|
-
function isWhiteSpace(char){
|
|
1136
|
-
return char === ' ' || char === '\\t' || char === '\\n' || char === '\\r';
|
|
1137
|
-
}
|
|
1138
|
-
/**
|
|
1139
|
-
* Read Processing insstructions and skip
|
|
1140
|
-
* @param {*} xmlData
|
|
1141
|
-
* @param {*} i
|
|
1142
|
-
*/
|
|
1143
|
-
function readPI(xmlData, i) {
|
|
1144
|
-
const start = i;
|
|
1145
|
-
for (; i < xmlData.length; i++) {
|
|
1146
|
-
if (xmlData[i] == '?' || xmlData[i] == ' ') {
|
|
1147
|
-
//tagname
|
|
1148
|
-
const tagname = xmlData.substr(start, i - start);
|
|
1149
|
-
if (i > 5 && tagname === 'xml') {
|
|
1150
|
-
return getErrorObject('InvalidXml', 'XML declaration allowed only at the start of the document.', getLineNumberForPosition(xmlData, i));
|
|
1151
|
-
} else if (xmlData[i] == '?' && xmlData[i + 1] == '>') {
|
|
1152
|
-
//check if valid attribut string
|
|
1153
|
-
i++;
|
|
1154
|
-
break;
|
|
1155
|
-
} else {
|
|
1156
|
-
continue;
|
|
1157
|
-
}
|
|
1158
|
-
}
|
|
1159
|
-
}
|
|
1160
|
-
return i;
|
|
1161
|
-
}
|
|
1162
|
-
|
|
1163
|
-
function readCommentAndCDATA(xmlData, i) {
|
|
1164
|
-
if (xmlData.length > i + 5 && xmlData[i + 1] === '-' && xmlData[i + 2] === '-') {
|
|
1165
|
-
//comment
|
|
1166
|
-
for (i += 3; i < xmlData.length; i++) {
|
|
1167
|
-
if (xmlData[i] === '-' && xmlData[i + 1] === '-' && xmlData[i + 2] === '>') {
|
|
1168
|
-
i += 2;
|
|
1169
|
-
break;
|
|
1170
|
-
}
|
|
1171
|
-
}
|
|
1172
|
-
} else if (
|
|
1173
|
-
xmlData.length > i + 8 &&
|
|
1174
|
-
xmlData[i + 1] === 'D' &&
|
|
1175
|
-
xmlData[i + 2] === 'O' &&
|
|
1176
|
-
xmlData[i + 3] === 'C' &&
|
|
1177
|
-
xmlData[i + 4] === 'T' &&
|
|
1178
|
-
xmlData[i + 5] === 'Y' &&
|
|
1179
|
-
xmlData[i + 6] === 'P' &&
|
|
1180
|
-
xmlData[i + 7] === 'E'
|
|
1181
|
-
) {
|
|
1182
|
-
let angleBracketsCount = 1;
|
|
1183
|
-
for (i += 8; i < xmlData.length; i++) {
|
|
1184
|
-
if (xmlData[i] === '<') {
|
|
1185
|
-
angleBracketsCount++;
|
|
1186
|
-
} else if (xmlData[i] === '>') {
|
|
1187
|
-
angleBracketsCount--;
|
|
1188
|
-
if (angleBracketsCount === 0) {
|
|
1189
|
-
break;
|
|
1190
863
|
}
|
|
864
|
+
return e2;
|
|
1191
865
|
}
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
xmlData[i + 4] === 'A' &&
|
|
1199
|
-
xmlData[i + 5] === 'T' &&
|
|
1200
|
-
xmlData[i + 6] === 'A' &&
|
|
1201
|
-
xmlData[i + 7] === '['
|
|
1202
|
-
) {
|
|
1203
|
-
for (i += 8; i < xmlData.length; i++) {
|
|
1204
|
-
if (xmlData[i] === ']' && xmlData[i + 1] === ']' && xmlData[i + 2] === '>') {
|
|
1205
|
-
i += 2;
|
|
1206
|
-
break;
|
|
1207
|
-
}
|
|
1208
|
-
}
|
|
1209
|
-
}
|
|
1210
|
-
|
|
1211
|
-
return i;
|
|
1212
|
-
}
|
|
1213
|
-
|
|
1214
|
-
const doubleQuote = '"';
|
|
1215
|
-
const singleQuote = "'";
|
|
1216
|
-
|
|
1217
|
-
/**
|
|
1218
|
-
* Keep reading xmlData until '<' is found outside the attribute value.
|
|
1219
|
-
* @param {string} xmlData
|
|
1220
|
-
* @param {number} i
|
|
1221
|
-
*/
|
|
1222
|
-
function readAttributeStr(xmlData, i) {
|
|
1223
|
-
let attrStr = '';
|
|
1224
|
-
let startChar = '';
|
|
1225
|
-
let tagClosed = false;
|
|
1226
|
-
for (; i < xmlData.length; i++) {
|
|
1227
|
-
if (xmlData[i] === doubleQuote || xmlData[i] === singleQuote) {
|
|
1228
|
-
if (startChar === '') {
|
|
1229
|
-
startChar = xmlData[i];
|
|
1230
|
-
} else if (startChar !== xmlData[i]) {
|
|
1231
|
-
//if vaue is enclosed with double quote then single quotes are allowed inside the value and vice versa
|
|
1232
|
-
} else {
|
|
1233
|
-
startChar = '';
|
|
1234
|
-
}
|
|
1235
|
-
} else if (xmlData[i] === '>') {
|
|
1236
|
-
if (startChar === '') {
|
|
1237
|
-
tagClosed = true;
|
|
1238
|
-
break;
|
|
1239
|
-
}
|
|
1240
|
-
}
|
|
1241
|
-
attrStr += xmlData[i];
|
|
1242
|
-
}
|
|
1243
|
-
if (startChar !== '') {
|
|
1244
|
-
return false;
|
|
1245
|
-
}
|
|
1246
|
-
|
|
1247
|
-
return {
|
|
1248
|
-
value: attrStr,
|
|
1249
|
-
index: i,
|
|
1250
|
-
tagClosed: tagClosed
|
|
1251
|
-
};
|
|
1252
|
-
}
|
|
1253
|
-
|
|
1254
|
-
/**
|
|
1255
|
-
* Select all the attributes whether valid or invalid.
|
|
1256
|
-
*/
|
|
1257
|
-
const validAttrStrRegxp = new RegExp('(\\\\s*)([^\\\\s=]+)(\\\\s*=)?(\\\\s*([\\'"])(([\\\\s\\\\S])*?)\\\\5)?', 'g');
|
|
1258
|
-
|
|
1259
|
-
//attr, ="sd", a="amit's", a="sd"b="saf", ab cd=""
|
|
1260
|
-
|
|
1261
|
-
function validateAttributeString(attrStr, options) {
|
|
1262
|
-
//console.log("start:"+attrStr+":end");
|
|
1263
|
-
|
|
1264
|
-
//if(attrStr.trim().length === 0) return true; //empty string
|
|
1265
|
-
|
|
1266
|
-
const matches = (0,_util_js__WEBPACK_IMPORTED_MODULE_0__.getAllMatches)(attrStr, validAttrStrRegxp);
|
|
1267
|
-
const attrNames = {};
|
|
1268
|
-
|
|
1269
|
-
for (let i = 0; i < matches.length; i++) {
|
|
1270
|
-
if (matches[i][1].length === 0) {
|
|
1271
|
-
//nospace before attribute name: a="sd"b="saf"
|
|
1272
|
-
return getErrorObject('InvalidAttr', "Attribute '"+matches[i][2]+"' has no space in starting.", getPositionFromMatch(matches[i]))
|
|
1273
|
-
} else if (matches[i][3] !== undefined && matches[i][4] === undefined) {
|
|
1274
|
-
return getErrorObject('InvalidAttr', "Attribute '"+matches[i][2]+"' is without value.", getPositionFromMatch(matches[i]));
|
|
1275
|
-
} else if (matches[i][3] === undefined && !options.allowBooleanAttributes) {
|
|
1276
|
-
//independent attribute: ab
|
|
1277
|
-
return getErrorObject('InvalidAttr', "boolean attribute '"+matches[i][2]+"' is not allowed.", getPositionFromMatch(matches[i]));
|
|
1278
|
-
}
|
|
1279
|
-
/* else if(matches[i][6] === undefined){//attribute without value: ab=
|
|
1280
|
-
return { err: { code:"InvalidAttr",msg:"attribute " + matches[i][2] + " has no value assigned."}};
|
|
1281
|
-
} */
|
|
1282
|
-
const attrName = matches[i][2];
|
|
1283
|
-
if (!validateAttrName(attrName)) {
|
|
1284
|
-
return getErrorObject('InvalidAttr', "Attribute '"+attrName+"' is an invalid name.", getPositionFromMatch(matches[i]));
|
|
1285
|
-
}
|
|
1286
|
-
if (!attrNames.hasOwnProperty(attrName)) {
|
|
1287
|
-
//check for duplicate attribute.
|
|
1288
|
-
attrNames[attrName] = 1;
|
|
1289
|
-
} else {
|
|
1290
|
-
return getErrorObject('InvalidAttr', "Attribute '"+attrName+"' is repeated.", getPositionFromMatch(matches[i]));
|
|
1291
|
-
}
|
|
1292
|
-
}
|
|
1293
|
-
|
|
1294
|
-
return true;
|
|
1295
|
-
}
|
|
1296
|
-
|
|
1297
|
-
function validateNumberAmpersand(xmlData, i) {
|
|
1298
|
-
let re = /\\d/;
|
|
1299
|
-
if (xmlData[i] === 'x') {
|
|
1300
|
-
i++;
|
|
1301
|
-
re = /[\\da-fA-F]/;
|
|
1302
|
-
}
|
|
1303
|
-
for (; i < xmlData.length; i++) {
|
|
1304
|
-
if (xmlData[i] === ';')
|
|
1305
|
-
return i;
|
|
1306
|
-
if (!xmlData[i].match(re))
|
|
1307
|
-
break;
|
|
1308
|
-
}
|
|
1309
|
-
return -1;
|
|
1310
|
-
}
|
|
1311
|
-
|
|
1312
|
-
function validateAmpersand(xmlData, i) {
|
|
1313
|
-
// https://www.w3.org/TR/xml/#dt-charref
|
|
1314
|
-
i++;
|
|
1315
|
-
if (xmlData[i] === ';')
|
|
1316
|
-
return -1;
|
|
1317
|
-
if (xmlData[i] === '#') {
|
|
1318
|
-
i++;
|
|
1319
|
-
return validateNumberAmpersand(xmlData, i);
|
|
1320
|
-
}
|
|
1321
|
-
let count = 0;
|
|
1322
|
-
for (; i < xmlData.length; i++, count++) {
|
|
1323
|
-
if (xmlData[i].match(/\\w/) && count < 20)
|
|
1324
|
-
continue;
|
|
1325
|
-
if (xmlData[i] === ';')
|
|
1326
|
-
break;
|
|
1327
|
-
return -1;
|
|
1328
|
-
}
|
|
1329
|
-
return i;
|
|
1330
|
-
}
|
|
1331
|
-
|
|
1332
|
-
function getErrorObject(code, message, lineNumber) {
|
|
1333
|
-
return {
|
|
1334
|
-
err: {
|
|
1335
|
-
code: code,
|
|
1336
|
-
msg: message,
|
|
1337
|
-
line: lineNumber.line || lineNumber,
|
|
1338
|
-
col: lineNumber.col,
|
|
1339
|
-
},
|
|
1340
|
-
};
|
|
1341
|
-
}
|
|
1342
|
-
|
|
1343
|
-
function validateAttrName(attrName) {
|
|
1344
|
-
return (0,_util_js__WEBPACK_IMPORTED_MODULE_0__.isName)(attrName);
|
|
1345
|
-
}
|
|
1346
|
-
|
|
1347
|
-
// const startsWithXML = /^xml/i;
|
|
1348
|
-
|
|
1349
|
-
function validateTagName(tagname) {
|
|
1350
|
-
return (0,_util_js__WEBPACK_IMPORTED_MODULE_0__.isName)(tagname) /* && !tagname.match(startsWithXML) */;
|
|
1351
|
-
}
|
|
1352
|
-
|
|
1353
|
-
//this function returns the line number for the character at the given index
|
|
1354
|
-
function getLineNumberForPosition(xmlData, index) {
|
|
1355
|
-
const lines = xmlData.substring(0, index).split(/\\r?\\n/);
|
|
1356
|
-
return {
|
|
1357
|
-
line: lines.length,
|
|
1358
|
-
|
|
1359
|
-
// column number is last line's length + 1, because column numbering starts at 1:
|
|
1360
|
-
col: lines[lines.length - 1].length + 1
|
|
1361
|
-
};
|
|
1362
|
-
}
|
|
1363
|
-
|
|
1364
|
-
//this function returns the position of the first character of match within attrStr
|
|
1365
|
-
function getPositionFromMatch(match) {
|
|
1366
|
-
return match.startIndex + match[1].length;
|
|
1367
|
-
}
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
//# sourceURL=webpack://fast-xml-parser/./src/validator.js?`);
|
|
1371
|
-
}, "./src/validator.js")
|
|
1372
|
-
),
|
|
1373
|
-
/***/
|
|
1374
|
-
"./src/xmlbuilder/json2xml.js": (
|
|
1375
|
-
/*!************************************!*\
|
|
1376
|
-
!*** ./src/xmlbuilder/json2xml.js ***!
|
|
1377
|
-
\************************************/
|
|
1378
|
-
/***/
|
|
1379
|
-
/* @__PURE__ */ __name((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
|
1380
|
-
eval(`__webpack_require__.r(__webpack_exports__);
|
|
1381
|
-
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1382
|
-
/* harmony export */ "default": () => (/* binding */ Builder)
|
|
1383
|
-
/* harmony export */ });
|
|
1384
|
-
/* harmony import */ var _orderedJs2Xml_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./orderedJs2Xml.js */ "./src/xmlbuilder/orderedJs2Xml.js");
|
|
1385
|
-
/* harmony import */ var _ignoreAttributes_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../ignoreAttributes.js */ "./src/ignoreAttributes.js");
|
|
1386
|
-
|
|
1387
|
-
//parse Empty Node as self closing node
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
const defaultOptions = {
|
|
1392
|
-
attributeNamePrefix: '@_',
|
|
1393
|
-
attributesGroupName: false,
|
|
1394
|
-
textNodeName: '#text',
|
|
1395
|
-
ignoreAttributes: true,
|
|
1396
|
-
cdataPropName: false,
|
|
1397
|
-
format: false,
|
|
1398
|
-
indentBy: ' ',
|
|
1399
|
-
suppressEmptyNode: false,
|
|
1400
|
-
suppressUnpairedNode: true,
|
|
1401
|
-
suppressBooleanAttributes: true,
|
|
1402
|
-
tagValueProcessor: function(key, a) {
|
|
1403
|
-
return a;
|
|
1404
|
-
},
|
|
1405
|
-
attributeValueProcessor: function(attrName, a) {
|
|
1406
|
-
return a;
|
|
1407
|
-
},
|
|
1408
|
-
preserveOrder: false,
|
|
1409
|
-
commentPropName: false,
|
|
1410
|
-
unpairedTags: [],
|
|
1411
|
-
entities: [
|
|
1412
|
-
{ regex: new RegExp("&", "g"), val: "&" },//it must be on top
|
|
1413
|
-
{ regex: new RegExp(">", "g"), val: ">" },
|
|
1414
|
-
{ regex: new RegExp("<", "g"), val: "<" },
|
|
1415
|
-
{ regex: new RegExp("\\'", "g"), val: "'" },
|
|
1416
|
-
{ regex: new RegExp("\\"", "g"), val: """ }
|
|
1417
|
-
],
|
|
1418
|
-
processEntities: true,
|
|
1419
|
-
stopNodes: [],
|
|
1420
|
-
// transformTagName: false,
|
|
1421
|
-
// transformAttributeName: false,
|
|
1422
|
-
oneListGroup: false
|
|
1423
|
-
};
|
|
1424
|
-
|
|
1425
|
-
function Builder(options) {
|
|
1426
|
-
this.options = Object.assign({}, defaultOptions, options);
|
|
1427
|
-
if (this.options.ignoreAttributes === true || this.options.attributesGroupName) {
|
|
1428
|
-
this.isAttribute = function(/*a*/) {
|
|
1429
|
-
return false;
|
|
1430
|
-
};
|
|
1431
|
-
} else {
|
|
1432
|
-
this.ignoreAttributesFn = (0,_ignoreAttributes_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this.options.ignoreAttributes)
|
|
1433
|
-
this.attrPrefixLen = this.options.attributeNamePrefix.length;
|
|
1434
|
-
this.isAttribute = isAttribute;
|
|
1435
|
-
}
|
|
1436
|
-
|
|
1437
|
-
this.processTextOrObjNode = processTextOrObjNode
|
|
1438
|
-
|
|
1439
|
-
if (this.options.format) {
|
|
1440
|
-
this.indentate = indentate;
|
|
1441
|
-
this.tagEndChar = '>\\n';
|
|
1442
|
-
this.newLine = '\\n';
|
|
1443
|
-
} else {
|
|
1444
|
-
this.indentate = function() {
|
|
1445
|
-
return '';
|
|
1446
|
-
};
|
|
1447
|
-
this.tagEndChar = '>';
|
|
1448
|
-
this.newLine = '';
|
|
1449
|
-
}
|
|
1450
|
-
}
|
|
1451
|
-
|
|
1452
|
-
Builder.prototype.build = function(jObj) {
|
|
1453
|
-
if(this.options.preserveOrder){
|
|
1454
|
-
return (0,_orderedJs2Xml_js__WEBPACK_IMPORTED_MODULE_0__["default"])(jObj, this.options);
|
|
1455
|
-
}else {
|
|
1456
|
-
if(Array.isArray(jObj) && this.options.arrayNodeName && this.options.arrayNodeName.length > 1){
|
|
1457
|
-
jObj = {
|
|
1458
|
-
[this.options.arrayNodeName] : jObj
|
|
1459
|
-
}
|
|
1460
|
-
}
|
|
1461
|
-
return this.j2x(jObj, 0, []).val;
|
|
1462
|
-
}
|
|
1463
|
-
};
|
|
1464
|
-
|
|
1465
|
-
Builder.prototype.j2x = function(jObj, level, ajPath) {
|
|
1466
|
-
let attrStr = '';
|
|
1467
|
-
let val = '';
|
|
1468
|
-
const jPath = ajPath.join('.')
|
|
1469
|
-
for (let key in jObj) {
|
|
1470
|
-
if(!Object.prototype.hasOwnProperty.call(jObj, key)) continue;
|
|
1471
|
-
if (typeof jObj[key] === 'undefined') {
|
|
1472
|
-
// supress undefined node only if it is not an attribute
|
|
1473
|
-
if (this.isAttribute(key)) {
|
|
1474
|
-
val += '';
|
|
1475
|
-
}
|
|
1476
|
-
} else if (jObj[key] === null) {
|
|
1477
|
-
// null attribute should be ignored by the attribute list, but should not cause the tag closing
|
|
1478
|
-
if (this.isAttribute(key)) {
|
|
1479
|
-
val += '';
|
|
1480
|
-
} else if (key === this.options.cdataPropName) {
|
|
1481
|
-
val += '';
|
|
1482
|
-
} else if (key[0] === '?') {
|
|
1483
|
-
val += this.indentate(level) + '<' + key + '?' + this.tagEndChar;
|
|
1484
|
-
} else {
|
|
1485
|
-
val += this.indentate(level) + '<' + key + '/' + this.tagEndChar;
|
|
1486
|
-
}
|
|
1487
|
-
// val += this.indentate(level) + '<' + key + '/' + this.tagEndChar;
|
|
1488
|
-
} else if (jObj[key] instanceof Date) {
|
|
1489
|
-
val += this.buildTextValNode(jObj[key], key, '', level);
|
|
1490
|
-
} else if (typeof jObj[key] !== 'object') {
|
|
1491
|
-
//premitive type
|
|
1492
|
-
const attr = this.isAttribute(key);
|
|
1493
|
-
if (attr && !this.ignoreAttributesFn(attr, jPath)) {
|
|
1494
|
-
attrStr += this.buildAttrPairStr(attr, '' + jObj[key]);
|
|
1495
|
-
} else if (!attr) {
|
|
1496
|
-
//tag value
|
|
1497
|
-
if (key === this.options.textNodeName) {
|
|
1498
|
-
let newval = this.options.tagValueProcessor(key, '' + jObj[key]);
|
|
1499
|
-
val += this.replaceEntitiesValue(newval);
|
|
1500
|
-
} else {
|
|
1501
|
-
val += this.buildTextValNode(jObj[key], key, '', level);
|
|
1502
|
-
}
|
|
1503
|
-
}
|
|
1504
|
-
} else if (Array.isArray(jObj[key])) {
|
|
1505
|
-
//repeated nodes
|
|
1506
|
-
const arrLen = jObj[key].length;
|
|
1507
|
-
let listTagVal = "";
|
|
1508
|
-
let listTagAttr = "";
|
|
1509
|
-
for (let j = 0; j < arrLen; j++) {
|
|
1510
|
-
const item = jObj[key][j];
|
|
1511
|
-
if (typeof item === 'undefined') {
|
|
1512
|
-
// supress undefined node
|
|
1513
|
-
} else if (item === null) {
|
|
1514
|
-
if(key[0] === "?") val += this.indentate(level) + '<' + key + '?' + this.tagEndChar;
|
|
1515
|
-
else val += this.indentate(level) + '<' + key + '/' + this.tagEndChar;
|
|
1516
|
-
// val += this.indentate(level) + '<' + key + '/' + this.tagEndChar;
|
|
1517
|
-
} else if (typeof item === 'object') {
|
|
1518
|
-
if(this.options.oneListGroup){
|
|
1519
|
-
const result = this.j2x(item, level + 1, ajPath.concat(key));
|
|
1520
|
-
listTagVal += result.val;
|
|
1521
|
-
if (this.options.attributesGroupName && item.hasOwnProperty(this.options.attributesGroupName)) {
|
|
1522
|
-
listTagAttr += result.attrStr
|
|
1523
|
-
}
|
|
1524
|
-
}else{
|
|
1525
|
-
listTagVal += this.processTextOrObjNode(item, key, level, ajPath)
|
|
866
|
+
__name(u, "u");
|
|
867
|
+
function h(t2, e2) {
|
|
868
|
+
if (t2.length > e2 + 5 && "-" === t2[e2 + 1] && "-" === t2[e2 + 2]) {
|
|
869
|
+
for (e2 += 3; e2 < t2.length; e2++) if ("-" === t2[e2] && "-" === t2[e2 + 1] && ">" === t2[e2 + 2]) {
|
|
870
|
+
e2 += 2;
|
|
871
|
+
break;
|
|
1526
872
|
}
|
|
1527
|
-
} else {
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
873
|
+
} else if (t2.length > e2 + 8 && "D" === t2[e2 + 1] && "O" === t2[e2 + 2] && "C" === t2[e2 + 3] && "T" === t2[e2 + 4] && "Y" === t2[e2 + 5] && "P" === t2[e2 + 6] && "E" === t2[e2 + 7]) {
|
|
874
|
+
let n2 = 1;
|
|
875
|
+
for (e2 += 8; e2 < t2.length; e2++) if ("<" === t2[e2]) n2++;
|
|
876
|
+
else if (">" === t2[e2] && (n2--, 0 === n2)) break;
|
|
877
|
+
} else if (t2.length > e2 + 9 && "[" === t2[e2 + 1] && "C" === t2[e2 + 2] && "D" === t2[e2 + 3] && "A" === t2[e2 + 4] && "T" === t2[e2 + 5] && "A" === t2[e2 + 6] && "[" === t2[e2 + 7]) {
|
|
878
|
+
for (e2 += 8; e2 < t2.length; e2++) if ("]" === t2[e2] && "]" === t2[e2 + 1] && ">" === t2[e2 + 2]) {
|
|
879
|
+
e2 += 2;
|
|
880
|
+
break;
|
|
1534
881
|
}
|
|
1535
882
|
}
|
|
883
|
+
return e2;
|
|
1536
884
|
}
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
}
|
|
1549
|
-
} else {
|
|
1550
|
-
val += this.processTextOrObjNode(jObj[key], key, level, ajPath)
|
|
1551
|
-
}
|
|
1552
|
-
}
|
|
1553
|
-
}
|
|
1554
|
-
return {attrStr: attrStr, val: val};
|
|
1555
|
-
};
|
|
1556
|
-
|
|
1557
|
-
Builder.prototype.buildAttrPairStr = function(attrName, val){
|
|
1558
|
-
val = this.options.attributeValueProcessor(attrName, '' + val);
|
|
1559
|
-
val = this.replaceEntitiesValue(val);
|
|
1560
|
-
if (this.options.suppressBooleanAttributes && val === "true") {
|
|
1561
|
-
return ' ' + attrName;
|
|
1562
|
-
} else return ' ' + attrName + '="' + val + '"';
|
|
1563
|
-
}
|
|
1564
|
-
|
|
1565
|
-
function processTextOrObjNode (object, key, level, ajPath) {
|
|
1566
|
-
const result = this.j2x(object, level + 1, ajPath.concat(key));
|
|
1567
|
-
if (object[this.options.textNodeName] !== undefined && Object.keys(object).length === 1) {
|
|
1568
|
-
return this.buildTextValNode(object[this.options.textNodeName], key, result.attrStr, level);
|
|
1569
|
-
} else {
|
|
1570
|
-
return this.buildObjectNode(result.val, key, result.attrStr, level);
|
|
1571
|
-
}
|
|
1572
|
-
}
|
|
1573
|
-
|
|
1574
|
-
Builder.prototype.buildObjectNode = function(val, key, attrStr, level) {
|
|
1575
|
-
if(val === ""){
|
|
1576
|
-
if(key[0] === "?") return this.indentate(level) + '<' + key + attrStr+ '?' + this.tagEndChar;
|
|
1577
|
-
else {
|
|
1578
|
-
return this.indentate(level) + '<' + key + attrStr + this.closeTag(key) + this.tagEndChar;
|
|
1579
|
-
}
|
|
1580
|
-
}else{
|
|
1581
|
-
|
|
1582
|
-
let tagEndExp = '</' + key + this.tagEndChar;
|
|
1583
|
-
let piClosingChar = "";
|
|
1584
|
-
|
|
1585
|
-
if(key[0] === "?") {
|
|
1586
|
-
piClosingChar = "?";
|
|
1587
|
-
tagEndExp = "";
|
|
1588
|
-
}
|
|
1589
|
-
|
|
1590
|
-
// attrStr is an empty string in case the attribute came as undefined or null
|
|
1591
|
-
if ((attrStr || attrStr === '') && val.indexOf('<') === -1) {
|
|
1592
|
-
return ( this.indentate(level) + '<' + key + attrStr + piClosingChar + '>' + val + tagEndExp );
|
|
1593
|
-
} else if (this.options.commentPropName !== false && key === this.options.commentPropName && piClosingChar.length === 0) {
|
|
1594
|
-
return this.indentate(level) + \`<!--\${val}-->\` + this.newLine;
|
|
1595
|
-
}else {
|
|
1596
|
-
return (
|
|
1597
|
-
this.indentate(level) + '<' + key + attrStr + piClosingChar + this.tagEndChar +
|
|
1598
|
-
val +
|
|
1599
|
-
this.indentate(level) + tagEndExp );
|
|
1600
|
-
}
|
|
1601
|
-
}
|
|
1602
|
-
}
|
|
1603
|
-
|
|
1604
|
-
Builder.prototype.closeTag = function(key){
|
|
1605
|
-
let closeTag = "";
|
|
1606
|
-
if(this.options.unpairedTags.indexOf(key) !== -1){ //unpaired
|
|
1607
|
-
if(!this.options.suppressUnpairedNode) closeTag = "/"
|
|
1608
|
-
}else if(this.options.suppressEmptyNode){ //empty
|
|
1609
|
-
closeTag = "/";
|
|
1610
|
-
}else{
|
|
1611
|
-
closeTag = \`></\${key}\`
|
|
1612
|
-
}
|
|
1613
|
-
return closeTag;
|
|
1614
|
-
}
|
|
1615
|
-
|
|
1616
|
-
function buildEmptyObjNode(val, key, attrStr, level) {
|
|
1617
|
-
if (val !== '') {
|
|
1618
|
-
return this.buildObjectNode(val, key, attrStr, level);
|
|
1619
|
-
} else {
|
|
1620
|
-
if(key[0] === "?") return this.indentate(level) + '<' + key + attrStr+ '?' + this.tagEndChar;
|
|
1621
|
-
else {
|
|
1622
|
-
return this.indentate(level) + '<' + key + attrStr + '/' + this.tagEndChar;
|
|
1623
|
-
// return this.buildTagStr(level,key, attrStr);
|
|
1624
|
-
}
|
|
1625
|
-
}
|
|
1626
|
-
}
|
|
1627
|
-
|
|
1628
|
-
Builder.prototype.buildTextValNode = function(val, key, attrStr, level) {
|
|
1629
|
-
if (this.options.cdataPropName !== false && key === this.options.cdataPropName) {
|
|
1630
|
-
return this.indentate(level) + \`<![CDATA[\${val}]]>\` + this.newLine;
|
|
1631
|
-
}else if (this.options.commentPropName !== false && key === this.options.commentPropName) {
|
|
1632
|
-
return this.indentate(level) + \`<!--\${val}-->\` + this.newLine;
|
|
1633
|
-
}else if(key[0] === "?") {//PI tag
|
|
1634
|
-
return this.indentate(level) + '<' + key + attrStr+ '?' + this.tagEndChar;
|
|
1635
|
-
}else{
|
|
1636
|
-
let textValue = this.options.tagValueProcessor(key, val);
|
|
1637
|
-
textValue = this.replaceEntitiesValue(textValue);
|
|
1638
|
-
|
|
1639
|
-
if( textValue === ''){
|
|
1640
|
-
return this.indentate(level) + '<' + key + attrStr + this.closeTag(key) + this.tagEndChar;
|
|
1641
|
-
}else{
|
|
1642
|
-
return this.indentate(level) + '<' + key + attrStr + '>' +
|
|
1643
|
-
textValue +
|
|
1644
|
-
'</' + key + this.tagEndChar;
|
|
1645
|
-
}
|
|
1646
|
-
}
|
|
1647
|
-
}
|
|
1648
|
-
|
|
1649
|
-
Builder.prototype.replaceEntitiesValue = function(textValue){
|
|
1650
|
-
if(textValue && textValue.length > 0 && this.options.processEntities){
|
|
1651
|
-
for (let i=0; i<this.options.entities.length; i++) {
|
|
1652
|
-
const entity = this.options.entities[i];
|
|
1653
|
-
textValue = textValue.replace(entity.regex, entity.val);
|
|
1654
|
-
}
|
|
1655
|
-
}
|
|
1656
|
-
return textValue;
|
|
1657
|
-
}
|
|
1658
|
-
|
|
1659
|
-
function indentate(level) {
|
|
1660
|
-
return this.options.indentBy.repeat(level);
|
|
1661
|
-
}
|
|
1662
|
-
|
|
1663
|
-
function isAttribute(name /*, options*/) {
|
|
1664
|
-
if (name.startsWith(this.options.attributeNamePrefix) && name !== this.options.textNodeName) {
|
|
1665
|
-
return name.substr(this.attrPrefixLen);
|
|
1666
|
-
} else {
|
|
1667
|
-
return false;
|
|
1668
|
-
}
|
|
1669
|
-
}
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
//# sourceURL=webpack://fast-xml-parser/./src/xmlbuilder/json2xml.js?`);
|
|
1674
|
-
}, "./src/xmlbuilder/json2xml.js")
|
|
1675
|
-
),
|
|
1676
|
-
/***/
|
|
1677
|
-
"./src/xmlbuilder/orderedJs2Xml.js": (
|
|
1678
|
-
/*!*****************************************!*\
|
|
1679
|
-
!*** ./src/xmlbuilder/orderedJs2Xml.js ***!
|
|
1680
|
-
\*****************************************/
|
|
1681
|
-
/***/
|
|
1682
|
-
/* @__PURE__ */ __name((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
|
1683
|
-
eval('__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ "default": () => (/* binding */ toXml)\n/* harmony export */ });\nconst EOL = "\\n";\n\n/**\n * \n * @param {array} jArray \n * @param {any} options \n * @returns \n */\nfunction toXml(jArray, options) {\n let indentation = "";\n if (options.format && options.indentBy.length > 0) {\n indentation = EOL;\n }\n return arrToStr(jArray, options, "", indentation);\n}\n\nfunction arrToStr(arr, options, jPath, indentation) {\n let xmlStr = "";\n let isPreviousElementTag = false;\n\n for (let i = 0; i < arr.length; i++) {\n const tagObj = arr[i];\n const tagName = propName(tagObj);\n if(tagName === undefined) continue;\n\n let newJPath = "";\n if (jPath.length === 0) newJPath = tagName\n else newJPath = `${jPath}.${tagName}`;\n\n if (tagName === options.textNodeName) {\n let tagText = tagObj[tagName];\n if (!isStopNode(newJPath, options)) {\n tagText = options.tagValueProcessor(tagName, tagText);\n tagText = replaceEntitiesValue(tagText, options);\n }\n if (isPreviousElementTag) {\n xmlStr += indentation;\n }\n xmlStr += tagText;\n isPreviousElementTag = false;\n continue;\n } else if (tagName === options.cdataPropName) {\n if (isPreviousElementTag) {\n xmlStr += indentation;\n }\n xmlStr += `<![CDATA[${tagObj[tagName][0][options.textNodeName]}]]>`;\n isPreviousElementTag = false;\n continue;\n } else if (tagName === options.commentPropName) {\n xmlStr += indentation + `<!--${tagObj[tagName][0][options.textNodeName]}-->`;\n isPreviousElementTag = true;\n continue;\n } else if (tagName[0] === "?") {\n const attStr = attr_to_str(tagObj[":@"], options);\n const tempInd = tagName === "?xml" ? "" : indentation;\n let piTextNodeName = tagObj[tagName][0][options.textNodeName];\n piTextNodeName = piTextNodeName.length !== 0 ? " " + piTextNodeName : ""; //remove extra spacing\n xmlStr += tempInd + `<${tagName}${piTextNodeName}${attStr}?>`;\n isPreviousElementTag = true;\n continue;\n }\n let newIdentation = indentation;\n if (newIdentation !== "") {\n newIdentation += options.indentBy;\n }\n const attStr = attr_to_str(tagObj[":@"], options);\n const tagStart = indentation + `<${tagName}${attStr}`;\n const tagValue = arrToStr(tagObj[tagName], options, newJPath, newIdentation);\n if (options.unpairedTags.indexOf(tagName) !== -1) {\n if (options.suppressUnpairedNode) xmlStr += tagStart + ">";\n else xmlStr += tagStart + "/>";\n } else if ((!tagValue || tagValue.length === 0) && options.suppressEmptyNode) {\n xmlStr += tagStart + "/>";\n } else if (tagValue && tagValue.endsWith(">")) {\n xmlStr += tagStart + `>${tagValue}${indentation}</${tagName}>`;\n } else {\n xmlStr += tagStart + ">";\n if (tagValue && indentation !== "" && (tagValue.includes("/>") || tagValue.includes("</"))) {\n xmlStr += indentation + options.indentBy + tagValue + indentation;\n } else {\n xmlStr += tagValue;\n }\n xmlStr += `</${tagName}>`;\n }\n isPreviousElementTag = true;\n }\n\n return xmlStr;\n}\n\nfunction propName(obj) {\n const keys = Object.keys(obj);\n for (let i = 0; i < keys.length; i++) {\n const key = keys[i];\n if(!obj.hasOwnProperty(key)) continue;\n if (key !== ":@") return key;\n }\n}\n\nfunction attr_to_str(attrMap, options) {\n let attrStr = "";\n if (attrMap && !options.ignoreAttributes) {\n for (let attr in attrMap) {\n if(!attrMap.hasOwnProperty(attr)) continue;\n let attrVal = options.attributeValueProcessor(attr, attrMap[attr]);\n attrVal = replaceEntitiesValue(attrVal, options);\n if (attrVal === true && options.suppressBooleanAttributes) {\n attrStr += ` ${attr.substr(options.attributeNamePrefix.length)}`;\n } else {\n attrStr += ` ${attr.substr(options.attributeNamePrefix.length)}="${attrVal}"`;\n }\n }\n }\n return attrStr;\n}\n\nfunction isStopNode(jPath, options) {\n jPath = jPath.substr(0, jPath.length - options.textNodeName.length - 1);\n let tagName = jPath.substr(jPath.lastIndexOf(".") + 1);\n for (let index in options.stopNodes) {\n if (options.stopNodes[index] === jPath || options.stopNodes[index] === "*." + tagName) return true;\n }\n return false;\n}\n\nfunction replaceEntitiesValue(textValue, options) {\n if (textValue && textValue.length > 0 && options.processEntities) {\n for (let i = 0; i < options.entities.length; i++) {\n const entity = options.entities[i];\n textValue = textValue.replace(entity.regex, entity.val);\n }\n }\n return textValue;\n}\n\n\n//# sourceURL=webpack://fast-xml-parser/./src/xmlbuilder/orderedJs2Xml.js?');
|
|
1684
|
-
}, "./src/xmlbuilder/orderedJs2Xml.js")
|
|
1685
|
-
),
|
|
1686
|
-
/***/
|
|
1687
|
-
"./src/xmlparser/DocTypeReader.js": (
|
|
1688
|
-
/*!****************************************!*\
|
|
1689
|
-
!*** ./src/xmlparser/DocTypeReader.js ***!
|
|
1690
|
-
\****************************************/
|
|
1691
|
-
/***/
|
|
1692
|
-
/* @__PURE__ */ __name((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
|
1693
|
-
eval(`__webpack_require__.r(__webpack_exports__);
|
|
1694
|
-
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1695
|
-
/* harmony export */ "default": () => (/* binding */ readDocType)
|
|
1696
|
-
/* harmony export */ });
|
|
1697
|
-
/* harmony import */ var _util_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../util.js */ "./src/util.js");
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
//TODO: handle comments
|
|
1701
|
-
function readDocType(xmlData, i){
|
|
1702
|
-
|
|
1703
|
-
const entities = {};
|
|
1704
|
-
if( xmlData[i + 3] === 'O' &&
|
|
1705
|
-
xmlData[i + 4] === 'C' &&
|
|
1706
|
-
xmlData[i + 5] === 'T' &&
|
|
1707
|
-
xmlData[i + 6] === 'Y' &&
|
|
1708
|
-
xmlData[i + 7] === 'P' &&
|
|
1709
|
-
xmlData[i + 8] === 'E')
|
|
1710
|
-
{
|
|
1711
|
-
i = i+9;
|
|
1712
|
-
let angleBracketsCount = 1;
|
|
1713
|
-
let hasBody = false, comment = false;
|
|
1714
|
-
let exp = "";
|
|
1715
|
-
for(;i<xmlData.length;i++){
|
|
1716
|
-
if (xmlData[i] === '<' && !comment) { //Determine the tag type
|
|
1717
|
-
if( hasBody && isEntity(xmlData, i)){
|
|
1718
|
-
i += 7;
|
|
1719
|
-
let entityName, val;
|
|
1720
|
-
[entityName, val,i] = readEntityExp(xmlData,i+1);
|
|
1721
|
-
if(val.indexOf("&") === -1) //Parameter entities are not supported
|
|
1722
|
-
entities[ validateEntityName(entityName) ] = {
|
|
1723
|
-
regx : RegExp( \`&\${entityName};\`,"g"),
|
|
1724
|
-
val: val
|
|
1725
|
-
};
|
|
1726
|
-
}
|
|
1727
|
-
else if( hasBody && isElement(xmlData, i)) i += 8;//Not supported
|
|
1728
|
-
else if( hasBody && isAttlist(xmlData, i)) i += 8;//Not supported
|
|
1729
|
-
else if( hasBody && isNotation(xmlData, i)) i += 9;//Not supported
|
|
1730
|
-
else if( isComment) comment = true;
|
|
1731
|
-
else throw new Error("Invalid DOCTYPE");
|
|
1732
|
-
|
|
1733
|
-
angleBracketsCount++;
|
|
1734
|
-
exp = "";
|
|
1735
|
-
} else if (xmlData[i] === '>') { //Read tag content
|
|
1736
|
-
if(comment){
|
|
1737
|
-
if( xmlData[i - 1] === "-" && xmlData[i - 2] === "-"){
|
|
1738
|
-
comment = false;
|
|
1739
|
-
angleBracketsCount--;
|
|
1740
|
-
}
|
|
1741
|
-
}else{
|
|
1742
|
-
angleBracketsCount--;
|
|
1743
|
-
}
|
|
1744
|
-
if (angleBracketsCount === 0) {
|
|
1745
|
-
break;
|
|
1746
|
-
}
|
|
1747
|
-
}else if( xmlData[i] === '['){
|
|
1748
|
-
hasBody = true;
|
|
1749
|
-
}else{
|
|
1750
|
-
exp += xmlData[i];
|
|
1751
|
-
}
|
|
1752
|
-
}
|
|
1753
|
-
if(angleBracketsCount !== 0){
|
|
1754
|
-
throw new Error(\`Unclosed DOCTYPE\`);
|
|
1755
|
-
}
|
|
1756
|
-
}else{
|
|
1757
|
-
throw new Error(\`Invalid Tag instead of DOCTYPE\`);
|
|
1758
|
-
}
|
|
1759
|
-
return {entities, i};
|
|
1760
|
-
}
|
|
1761
|
-
|
|
1762
|
-
function readEntityExp(xmlData,i){
|
|
1763
|
-
//External entities are not supported
|
|
1764
|
-
// <!ENTITY ext SYSTEM "http://normal-website.com" >
|
|
1765
|
-
|
|
1766
|
-
//Parameter entities are not supported
|
|
1767
|
-
// <!ENTITY entityname "&anotherElement;">
|
|
1768
|
-
|
|
1769
|
-
//Internal entities are supported
|
|
1770
|
-
// <!ENTITY entityname "replacement text">
|
|
1771
|
-
|
|
1772
|
-
//read EntityName
|
|
1773
|
-
let entityName = "";
|
|
1774
|
-
for (; i < xmlData.length && (xmlData[i] !== "'" && xmlData[i] !== '"' ); i++) {
|
|
1775
|
-
// if(xmlData[i] === " ") continue;
|
|
1776
|
-
// else
|
|
1777
|
-
entityName += xmlData[i];
|
|
1778
|
-
}
|
|
1779
|
-
entityName = entityName.trim();
|
|
1780
|
-
if(entityName.indexOf(" ") !== -1) throw new Error("External entites are not supported");
|
|
1781
|
-
|
|
1782
|
-
//read Entity Value
|
|
1783
|
-
const startChar = xmlData[i++];
|
|
1784
|
-
let val = ""
|
|
1785
|
-
for (; i < xmlData.length && xmlData[i] !== startChar ; i++) {
|
|
1786
|
-
val += xmlData[i];
|
|
1787
|
-
}
|
|
1788
|
-
return [entityName, val, i];
|
|
1789
|
-
}
|
|
1790
|
-
|
|
1791
|
-
function isComment(xmlData, i){
|
|
1792
|
-
if(xmlData[i+1] === '!' &&
|
|
1793
|
-
xmlData[i+2] === '-' &&
|
|
1794
|
-
xmlData[i+3] === '-') return true
|
|
1795
|
-
return false
|
|
1796
|
-
}
|
|
1797
|
-
function isEntity(xmlData, i){
|
|
1798
|
-
if(xmlData[i+1] === '!' &&
|
|
1799
|
-
xmlData[i+2] === 'E' &&
|
|
1800
|
-
xmlData[i+3] === 'N' &&
|
|
1801
|
-
xmlData[i+4] === 'T' &&
|
|
1802
|
-
xmlData[i+5] === 'I' &&
|
|
1803
|
-
xmlData[i+6] === 'T' &&
|
|
1804
|
-
xmlData[i+7] === 'Y') return true
|
|
1805
|
-
return false
|
|
1806
|
-
}
|
|
1807
|
-
function isElement(xmlData, i){
|
|
1808
|
-
if(xmlData[i+1] === '!' &&
|
|
1809
|
-
xmlData[i+2] === 'E' &&
|
|
1810
|
-
xmlData[i+3] === 'L' &&
|
|
1811
|
-
xmlData[i+4] === 'E' &&
|
|
1812
|
-
xmlData[i+5] === 'M' &&
|
|
1813
|
-
xmlData[i+6] === 'E' &&
|
|
1814
|
-
xmlData[i+7] === 'N' &&
|
|
1815
|
-
xmlData[i+8] === 'T') return true
|
|
1816
|
-
return false
|
|
1817
|
-
}
|
|
1818
|
-
|
|
1819
|
-
function isAttlist(xmlData, i){
|
|
1820
|
-
if(xmlData[i+1] === '!' &&
|
|
1821
|
-
xmlData[i+2] === 'A' &&
|
|
1822
|
-
xmlData[i+3] === 'T' &&
|
|
1823
|
-
xmlData[i+4] === 'T' &&
|
|
1824
|
-
xmlData[i+5] === 'L' &&
|
|
1825
|
-
xmlData[i+6] === 'I' &&
|
|
1826
|
-
xmlData[i+7] === 'S' &&
|
|
1827
|
-
xmlData[i+8] === 'T') return true
|
|
1828
|
-
return false
|
|
1829
|
-
}
|
|
1830
|
-
function isNotation(xmlData, i){
|
|
1831
|
-
if(xmlData[i+1] === '!' &&
|
|
1832
|
-
xmlData[i+2] === 'N' &&
|
|
1833
|
-
xmlData[i+3] === 'O' &&
|
|
1834
|
-
xmlData[i+4] === 'T' &&
|
|
1835
|
-
xmlData[i+5] === 'A' &&
|
|
1836
|
-
xmlData[i+6] === 'T' &&
|
|
1837
|
-
xmlData[i+7] === 'I' &&
|
|
1838
|
-
xmlData[i+8] === 'O' &&
|
|
1839
|
-
xmlData[i+9] === 'N') return true
|
|
1840
|
-
return false
|
|
1841
|
-
}
|
|
1842
|
-
|
|
1843
|
-
function validateEntityName(name){
|
|
1844
|
-
if ((0,_util_js__WEBPACK_IMPORTED_MODULE_0__.isName)(name))
|
|
1845
|
-
return name;
|
|
1846
|
-
else
|
|
1847
|
-
throw new Error(\`Invalid entity name \${name}\`);
|
|
1848
|
-
}
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
//# sourceURL=webpack://fast-xml-parser/./src/xmlparser/DocTypeReader.js?`);
|
|
1852
|
-
}, "./src/xmlparser/DocTypeReader.js")
|
|
1853
|
-
),
|
|
1854
|
-
/***/
|
|
1855
|
-
"./src/xmlparser/OptionsBuilder.js": (
|
|
1856
|
-
/*!*****************************************!*\
|
|
1857
|
-
!*** ./src/xmlparser/OptionsBuilder.js ***!
|
|
1858
|
-
\*****************************************/
|
|
1859
|
-
/***/
|
|
1860
|
-
/* @__PURE__ */ __name((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
|
1861
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ buildOptions: () => (/* binding */ buildOptions),\n/* harmony export */ defaultOptions: () => (/* binding */ defaultOptions)\n/* harmony export */ });\n\nconst defaultOptions = {\n preserveOrder: false,\n attributeNamePrefix: '@_',\n attributesGroupName: false,\n textNodeName: '#text',\n ignoreAttributes: true,\n removeNSPrefix: false, // remove NS from tag name or attribute name if true\n allowBooleanAttributes: false, //a tag can have attributes without any value\n //ignoreRootElement : false,\n parseTagValue: true,\n parseAttributeValue: false,\n trimValues: true, //Trim string values of tag and attributes\n cdataPropName: false,\n numberParseOptions: {\n hex: true,\n leadingZeros: true,\n eNotation: true\n },\n tagValueProcessor: function(tagName, val) {\n return val;\n },\n attributeValueProcessor: function(attrName, val) {\n return val;\n },\n stopNodes: [], //nested tags will not be parsed even for errors\n alwaysCreateTextNode: false,\n isArray: () => false,\n commentPropName: false,\n unpairedTags: [],\n processEntities: true,\n htmlEntities: false,\n ignoreDeclaration: false,\n ignorePiTags: false,\n transformTagName: false,\n transformAttributeName: false,\n updateTag: function(tagName, jPath, attrs){\n return tagName\n },\n // skipEmptyListItem: false\n};\n \nconst buildOptions = function(options) {\n return Object.assign({}, defaultOptions, options);\n};\n\n\n//# sourceURL=webpack://fast-xml-parser/./src/xmlparser/OptionsBuilder.js?");
|
|
1862
|
-
}, "./src/xmlparser/OptionsBuilder.js")
|
|
1863
|
-
),
|
|
1864
|
-
/***/
|
|
1865
|
-
"./src/xmlparser/OrderedObjParser.js": (
|
|
1866
|
-
/*!*******************************************!*\
|
|
1867
|
-
!*** ./src/xmlparser/OrderedObjParser.js ***!
|
|
1868
|
-
\*******************************************/
|
|
1869
|
-
/***/
|
|
1870
|
-
/* @__PURE__ */ __name((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
|
1871
|
-
eval(`__webpack_require__.r(__webpack_exports__);
|
|
1872
|
-
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1873
|
-
/* harmony export */ "default": () => (/* binding */ OrderedObjParser)
|
|
1874
|
-
/* harmony export */ });
|
|
1875
|
-
/* harmony import */ var _util_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../util.js */ "./src/util.js");
|
|
1876
|
-
/* harmony import */ var _xmlNode_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./xmlNode.js */ "./src/xmlparser/xmlNode.js");
|
|
1877
|
-
/* harmony import */ var _DocTypeReader_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./DocTypeReader.js */ "./src/xmlparser/DocTypeReader.js");
|
|
1878
|
-
/* harmony import */ var strnum__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! strnum */ "./node_modules/strnum/strnum.js");
|
|
1879
|
-
/* harmony import */ var _ignoreAttributes_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../ignoreAttributes.js */ "./src/ignoreAttributes.js");
|
|
1880
|
-
|
|
1881
|
-
///@ts-check
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
// const regx =
|
|
1890
|
-
// '<((!\\\\[CDATA\\\\[([\\\\s\\\\S]*?)(]]>))|((NAME:)?(NAME))([^>]*)>|((\\\\/)(NAME)\\\\s*>))([^<]*)'
|
|
1891
|
-
// .replace(/NAME/g, util.nameRegexp);
|
|
1892
|
-
|
|
1893
|
-
//const tagsRegx = new RegExp("<(\\\\/?[\\\\w:\\\\-\\._]+)([^>]*)>(\\\\s*"+cdataRegx+")*([^<]+)?","g");
|
|
1894
|
-
//const tagsRegx = new RegExp("<(\\\\/?)((\\\\w*:)?([\\\\w:\\\\-\\._]+))([^>]*)>([^<]*)("+cdataRegx+"([^<]*))*([^<]+)?","g");
|
|
1895
|
-
|
|
1896
|
-
class OrderedObjParser{
|
|
1897
|
-
constructor(options){
|
|
1898
|
-
this.options = options;
|
|
1899
|
-
this.currentNode = null;
|
|
1900
|
-
this.tagsNodeStack = [];
|
|
1901
|
-
this.docTypeEntities = {};
|
|
1902
|
-
this.lastEntities = {
|
|
1903
|
-
"apos" : { regex: /&(apos|#39|#x27);/g, val : "'"},
|
|
1904
|
-
"gt" : { regex: /&(gt|#62|#x3E);/g, val : ">"},
|
|
1905
|
-
"lt" : { regex: /&(lt|#60|#x3C);/g, val : "<"},
|
|
1906
|
-
"quot" : { regex: /&(quot|#34|#x22);/g, val : "\\""},
|
|
1907
|
-
};
|
|
1908
|
-
this.ampEntity = { regex: /&(amp|#38|#x26);/g, val : "&"};
|
|
1909
|
-
this.htmlEntities = {
|
|
1910
|
-
"space": { regex: /&(nbsp|#160);/g, val: " " },
|
|
1911
|
-
// "lt" : { regex: /&(lt|#60);/g, val: "<" },
|
|
1912
|
-
// "gt" : { regex: /&(gt|#62);/g, val: ">" },
|
|
1913
|
-
// "amp" : { regex: /&(amp|#38);/g, val: "&" },
|
|
1914
|
-
// "quot" : { regex: /&(quot|#34);/g, val: "\\"" },
|
|
1915
|
-
// "apos" : { regex: /&(apos|#39);/g, val: "'" },
|
|
1916
|
-
"cent" : { regex: /&(cent|#162);/g, val: "\xA2" },
|
|
1917
|
-
"pound" : { regex: /&(pound|#163);/g, val: "\xA3" },
|
|
1918
|
-
"yen" : { regex: /&(yen|#165);/g, val: "\xA5" },
|
|
1919
|
-
"euro" : { regex: /&(euro|#8364);/g, val: "\u20AC" },
|
|
1920
|
-
"copyright" : { regex: /&(copy|#169);/g, val: "\xA9" },
|
|
1921
|
-
"reg" : { regex: /&(reg|#174);/g, val: "\xAE" },
|
|
1922
|
-
"inr" : { regex: /&(inr|#8377);/g, val: "\u20B9" },
|
|
1923
|
-
"num_dec": { regex: /&#([0-9]{1,7});/g, val : (_, str) => String.fromCodePoint(Number.parseInt(str, 10)) },
|
|
1924
|
-
"num_hex": { regex: /&#x([0-9a-fA-F]{1,6});/g, val : (_, str) => String.fromCodePoint(Number.parseInt(str, 16)) },
|
|
1925
|
-
};
|
|
1926
|
-
this.addExternalEntities = addExternalEntities;
|
|
1927
|
-
this.parseXml = parseXml;
|
|
1928
|
-
this.parseTextData = parseTextData;
|
|
1929
|
-
this.resolveNameSpace = resolveNameSpace;
|
|
1930
|
-
this.buildAttributesMap = buildAttributesMap;
|
|
1931
|
-
this.isItStopNode = isItStopNode;
|
|
1932
|
-
this.replaceEntitiesValue = replaceEntitiesValue;
|
|
1933
|
-
this.readStopNodeData = readStopNodeData;
|
|
1934
|
-
this.saveTextToParentTag = saveTextToParentTag;
|
|
1935
|
-
this.addChild = addChild;
|
|
1936
|
-
this.ignoreAttributesFn = (0,_ignoreAttributes_js__WEBPACK_IMPORTED_MODULE_4__["default"])(this.options.ignoreAttributes)
|
|
1937
|
-
}
|
|
1938
|
-
|
|
1939
|
-
}
|
|
1940
|
-
|
|
1941
|
-
function addExternalEntities(externalEntities){
|
|
1942
|
-
const entKeys = Object.keys(externalEntities);
|
|
1943
|
-
for (let i = 0; i < entKeys.length; i++) {
|
|
1944
|
-
const ent = entKeys[i];
|
|
1945
|
-
this.lastEntities[ent] = {
|
|
1946
|
-
regex: new RegExp("&"+ent+";","g"),
|
|
1947
|
-
val : externalEntities[ent]
|
|
1948
|
-
}
|
|
1949
|
-
}
|
|
1950
|
-
}
|
|
1951
|
-
|
|
1952
|
-
/**
|
|
1953
|
-
* @param {string} val
|
|
1954
|
-
* @param {string} tagName
|
|
1955
|
-
* @param {string} jPath
|
|
1956
|
-
* @param {boolean} dontTrim
|
|
1957
|
-
* @param {boolean} hasAttributes
|
|
1958
|
-
* @param {boolean} isLeafNode
|
|
1959
|
-
* @param {boolean} escapeEntities
|
|
1960
|
-
*/
|
|
1961
|
-
function parseTextData(val, tagName, jPath, dontTrim, hasAttributes, isLeafNode, escapeEntities) {
|
|
1962
|
-
if (val !== undefined) {
|
|
1963
|
-
if (this.options.trimValues && !dontTrim) {
|
|
1964
|
-
val = val.trim();
|
|
1965
|
-
}
|
|
1966
|
-
if(val.length > 0){
|
|
1967
|
-
if(!escapeEntities) val = this.replaceEntitiesValue(val);
|
|
1968
|
-
|
|
1969
|
-
const newval = this.options.tagValueProcessor(tagName, val, jPath, hasAttributes, isLeafNode);
|
|
1970
|
-
if(newval === null || newval === undefined){
|
|
1971
|
-
//don't parse
|
|
1972
|
-
return val;
|
|
1973
|
-
}else if(typeof newval !== typeof val || newval !== val){
|
|
1974
|
-
//overwrite
|
|
1975
|
-
return newval;
|
|
1976
|
-
}else if(this.options.trimValues){
|
|
1977
|
-
return parseValue(val, this.options.parseTagValue, this.options.numberParseOptions);
|
|
1978
|
-
}else{
|
|
1979
|
-
const trimmedVal = val.trim();
|
|
1980
|
-
if(trimmedVal === val){
|
|
1981
|
-
return parseValue(val, this.options.parseTagValue, this.options.numberParseOptions);
|
|
1982
|
-
}else{
|
|
1983
|
-
return val;
|
|
885
|
+
__name(h, "h");
|
|
886
|
+
const d = '"', c = "'";
|
|
887
|
+
function p(t2, e2) {
|
|
888
|
+
let n2 = "", i2 = "", s2 = false;
|
|
889
|
+
for (; e2 < t2.length; e2++) {
|
|
890
|
+
if (t2[e2] === d || t2[e2] === c) "" === i2 ? i2 = t2[e2] : i2 !== t2[e2] || (i2 = "");
|
|
891
|
+
else if (">" === t2[e2] && "" === i2) {
|
|
892
|
+
s2 = true;
|
|
893
|
+
break;
|
|
894
|
+
}
|
|
895
|
+
n2 += t2[e2];
|
|
1984
896
|
}
|
|
897
|
+
return "" === i2 && { value: n2, index: e2, tagClosed: s2 };
|
|
1985
898
|
}
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
tagname = prefix + tags[1];
|
|
1999
|
-
}
|
|
2000
|
-
}
|
|
2001
|
-
return tagname;
|
|
2002
|
-
}
|
|
2003
|
-
|
|
2004
|
-
//TODO: change regex to capture NS
|
|
2005
|
-
//const attrsRegx = new RegExp("([\\\\w\\\\-\\\\.\\\\:]+)\\\\s*=\\\\s*(['\\"])((.|\\n)*?)\\\\2","gm");
|
|
2006
|
-
const attrsRegx = new RegExp('([^\\\\s=]+)\\\\s*(=\\\\s*([\\'"])([\\\\s\\\\S]*?)\\\\3)?', 'gm');
|
|
2007
|
-
|
|
2008
|
-
function buildAttributesMap(attrStr, jPath, tagName) {
|
|
2009
|
-
if (this.options.ignoreAttributes !== true && typeof attrStr === 'string') {
|
|
2010
|
-
// attrStr = attrStr.replace(/\\r?\\n/g, ' ');
|
|
2011
|
-
//attrStr = attrStr || attrStr.trim();
|
|
2012
|
-
|
|
2013
|
-
const matches = (0,_util_js__WEBPACK_IMPORTED_MODULE_0__.getAllMatches)(attrStr, attrsRegx);
|
|
2014
|
-
const len = matches.length; //don't make it inline
|
|
2015
|
-
const attrs = {};
|
|
2016
|
-
for (let i = 0; i < len; i++) {
|
|
2017
|
-
const attrName = this.resolveNameSpace(matches[i][1]);
|
|
2018
|
-
if (this.ignoreAttributesFn(attrName, jPath)) {
|
|
2019
|
-
continue
|
|
2020
|
-
}
|
|
2021
|
-
let oldVal = matches[i][4];
|
|
2022
|
-
let aName = this.options.attributeNamePrefix + attrName;
|
|
2023
|
-
if (attrName.length) {
|
|
2024
|
-
if (this.options.transformAttributeName) {
|
|
2025
|
-
aName = this.options.transformAttributeName(aName);
|
|
2026
|
-
}
|
|
2027
|
-
if(aName === "__proto__") aName = "#__proto__";
|
|
2028
|
-
if (oldVal !== undefined) {
|
|
2029
|
-
if (this.options.trimValues) {
|
|
2030
|
-
oldVal = oldVal.trim();
|
|
2031
|
-
}
|
|
2032
|
-
oldVal = this.replaceEntitiesValue(oldVal);
|
|
2033
|
-
const newVal = this.options.attributeValueProcessor(attrName, oldVal, jPath);
|
|
2034
|
-
if(newVal === null || newVal === undefined){
|
|
2035
|
-
//don't parse
|
|
2036
|
-
attrs[aName] = oldVal;
|
|
2037
|
-
}else if(typeof newVal !== typeof oldVal || newVal !== oldVal){
|
|
2038
|
-
//overwrite
|
|
2039
|
-
attrs[aName] = newVal;
|
|
2040
|
-
}else{
|
|
2041
|
-
//parse
|
|
2042
|
-
attrs[aName] = parseValue(
|
|
2043
|
-
oldVal,
|
|
2044
|
-
this.options.parseAttributeValue,
|
|
2045
|
-
this.options.numberParseOptions
|
|
2046
|
-
);
|
|
2047
|
-
}
|
|
2048
|
-
} else if (this.options.allowBooleanAttributes) {
|
|
2049
|
-
attrs[aName] = true;
|
|
899
|
+
__name(p, "p");
|
|
900
|
+
const f = new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`, "g");
|
|
901
|
+
function g(t2, e2) {
|
|
902
|
+
const n2 = s(t2, f), i2 = {};
|
|
903
|
+
for (let t3 = 0; t3 < n2.length; t3++) {
|
|
904
|
+
if (0 === n2[t3][1].length) return x("InvalidAttr", "Attribute '" + n2[t3][2] + "' has no space in starting.", v(n2[t3]));
|
|
905
|
+
if (void 0 !== n2[t3][3] && void 0 === n2[t3][4]) return x("InvalidAttr", "Attribute '" + n2[t3][2] + "' is without value.", v(n2[t3]));
|
|
906
|
+
if (void 0 === n2[t3][3] && !e2.allowBooleanAttributes) return x("InvalidAttr", "boolean attribute '" + n2[t3][2] + "' is not allowed.", v(n2[t3]));
|
|
907
|
+
const s2 = n2[t3][2];
|
|
908
|
+
if (!b(s2)) return x("InvalidAttr", "Attribute '" + s2 + "' is an invalid name.", v(n2[t3]));
|
|
909
|
+
if (i2.hasOwnProperty(s2)) return x("InvalidAttr", "Attribute '" + s2 + "' is repeated.", v(n2[t3]));
|
|
910
|
+
i2[s2] = 1;
|
|
2050
911
|
}
|
|
912
|
+
return true;
|
|
2051
913
|
}
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
|
-
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
|
|
2082
|
-
|
|
2083
|
-
|
|
2084
|
-
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
}
|
|
2107
|
-
|
|
2108
|
-
|
|
2109
|
-
currentNode = this.tagsNodeStack.pop();//avoid recursion, set the parent tag scope
|
|
2110
|
-
textData = "";
|
|
2111
|
-
i = closeIndex;
|
|
2112
|
-
} else if( xmlData[i+1] === '?') {
|
|
2113
|
-
|
|
2114
|
-
let tagData = readTagExp(xmlData,i, false, "?>");
|
|
2115
|
-
if(!tagData) throw new Error("Pi Tag is not closed.");
|
|
2116
|
-
|
|
2117
|
-
textData = this.saveTextToParentTag(textData, currentNode, jPath);
|
|
2118
|
-
if( (this.options.ignoreDeclaration && tagData.tagName === "?xml") || this.options.ignorePiTags){
|
|
2119
|
-
|
|
2120
|
-
}else{
|
|
2121
|
-
|
|
2122
|
-
const childNode = new _xmlNode_js__WEBPACK_IMPORTED_MODULE_1__["default"](tagData.tagName);
|
|
2123
|
-
childNode.add(this.options.textNodeName, "");
|
|
2124
|
-
|
|
2125
|
-
if(tagData.tagName !== tagData.tagExp && tagData.attrExpPresent){
|
|
2126
|
-
childNode[":@"] = this.buildAttributesMap(tagData.tagExp, jPath, tagData.tagName);
|
|
2127
|
-
}
|
|
2128
|
-
this.addChild(currentNode, childNode, jPath)
|
|
2129
|
-
|
|
2130
|
-
}
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
i = tagData.closeIndex + 1;
|
|
2134
|
-
} else if(xmlData.substr(i + 1, 3) === '!--') {
|
|
2135
|
-
const endIndex = findClosingIndex(xmlData, "-->", i+4, "Comment is not closed.")
|
|
2136
|
-
if(this.options.commentPropName){
|
|
2137
|
-
const comment = xmlData.substring(i + 4, endIndex - 2);
|
|
2138
|
-
|
|
2139
|
-
textData = this.saveTextToParentTag(textData, currentNode, jPath);
|
|
2140
|
-
|
|
2141
|
-
currentNode.add(this.options.commentPropName, [ { [this.options.textNodeName] : comment } ]);
|
|
2142
|
-
}
|
|
2143
|
-
i = endIndex;
|
|
2144
|
-
} else if( xmlData.substr(i + 1, 2) === '!D') {
|
|
2145
|
-
const result = (0,_DocTypeReader_js__WEBPACK_IMPORTED_MODULE_2__["default"])(xmlData, i);
|
|
2146
|
-
this.docTypeEntities = result.entities;
|
|
2147
|
-
i = result.i;
|
|
2148
|
-
}else if(xmlData.substr(i + 1, 2) === '![') {
|
|
2149
|
-
const closeIndex = findClosingIndex(xmlData, "]]>", i, "CDATA is not closed.") - 2;
|
|
2150
|
-
const tagExp = xmlData.substring(i + 9,closeIndex);
|
|
2151
|
-
|
|
2152
|
-
textData = this.saveTextToParentTag(textData, currentNode, jPath);
|
|
2153
|
-
|
|
2154
|
-
let val = this.parseTextData(tagExp, currentNode.tagname, jPath, true, false, true, true);
|
|
2155
|
-
if(val == undefined) val = "";
|
|
2156
|
-
|
|
2157
|
-
//cdata should be set even if it is 0 length string
|
|
2158
|
-
if(this.options.cdataPropName){
|
|
2159
|
-
currentNode.add(this.options.cdataPropName, [ { [this.options.textNodeName] : tagExp } ]);
|
|
2160
|
-
}else{
|
|
2161
|
-
currentNode.add(this.options.textNodeName, val);
|
|
2162
|
-
}
|
|
2163
|
-
|
|
2164
|
-
i = closeIndex + 2;
|
|
2165
|
-
}else {//Opening tag
|
|
2166
|
-
let result = readTagExp(xmlData,i, this.options.removeNSPrefix);
|
|
2167
|
-
let tagName= result.tagName;
|
|
2168
|
-
const rawTagName = result.rawTagName;
|
|
2169
|
-
let tagExp = result.tagExp;
|
|
2170
|
-
let attrExpPresent = result.attrExpPresent;
|
|
2171
|
-
let closeIndex = result.closeIndex;
|
|
2172
|
-
|
|
2173
|
-
if (this.options.transformTagName) {
|
|
2174
|
-
tagName = this.options.transformTagName(tagName);
|
|
914
|
+
__name(g, "g");
|
|
915
|
+
function m(t2, e2) {
|
|
916
|
+
if (";" === t2[++e2]) return -1;
|
|
917
|
+
if ("#" === t2[e2]) return function(t3, e3) {
|
|
918
|
+
let n3 = /\d/;
|
|
919
|
+
for ("x" === t3[e3] && (e3++, n3 = /[\da-fA-F]/); e3 < t3.length; e3++) {
|
|
920
|
+
if (";" === t3[e3]) return e3;
|
|
921
|
+
if (!t3[e3].match(n3)) break;
|
|
922
|
+
}
|
|
923
|
+
return -1;
|
|
924
|
+
}(t2, ++e2);
|
|
925
|
+
let n2 = 0;
|
|
926
|
+
for (; e2 < t2.length; e2++, n2++) if (!(t2[e2].match(/\w/) && n2 < 20)) {
|
|
927
|
+
if (";" === t2[e2]) break;
|
|
928
|
+
return -1;
|
|
929
|
+
}
|
|
930
|
+
return e2;
|
|
931
|
+
}
|
|
932
|
+
__name(m, "m");
|
|
933
|
+
function x(t2, e2, n2) {
|
|
934
|
+
return { err: { code: t2, msg: e2, line: n2.line || n2, col: n2.col } };
|
|
935
|
+
}
|
|
936
|
+
__name(x, "x");
|
|
937
|
+
function b(t2) {
|
|
938
|
+
return r(t2);
|
|
939
|
+
}
|
|
940
|
+
__name(b, "b");
|
|
941
|
+
function N(t2, e2) {
|
|
942
|
+
const n2 = t2.substring(0, e2).split(/\r?\n/);
|
|
943
|
+
return { line: n2.length, col: n2[n2.length - 1].length + 1 };
|
|
944
|
+
}
|
|
945
|
+
__name(N, "N");
|
|
946
|
+
function v(t2) {
|
|
947
|
+
return t2.startIndex + t2[1].length;
|
|
948
|
+
}
|
|
949
|
+
__name(v, "v");
|
|
950
|
+
const E = { preserveOrder: false, attributeNamePrefix: "@_", attributesGroupName: false, textNodeName: "#text", ignoreAttributes: true, removeNSPrefix: false, allowBooleanAttributes: false, parseTagValue: true, parseAttributeValue: false, trimValues: true, cdataPropName: false, numberParseOptions: { hex: true, leadingZeros: true, eNotation: true }, tagValueProcessor: /* @__PURE__ */ __name(function(t2, e2) {
|
|
951
|
+
return e2;
|
|
952
|
+
}, "tagValueProcessor"), attributeValueProcessor: /* @__PURE__ */ __name(function(t2, e2) {
|
|
953
|
+
return e2;
|
|
954
|
+
}, "attributeValueProcessor"), stopNodes: [], alwaysCreateTextNode: false, isArray: /* @__PURE__ */ __name(() => false, "isArray"), commentPropName: false, unpairedTags: [], processEntities: true, htmlEntities: false, ignoreDeclaration: false, ignorePiTags: false, transformTagName: false, transformAttributeName: false, updateTag: /* @__PURE__ */ __name(function(t2, e2, n2) {
|
|
955
|
+
return t2;
|
|
956
|
+
}, "updateTag"), captureMetaData: false };
|
|
957
|
+
let y;
|
|
958
|
+
y = "function" != typeof Symbol ? "@@xmlMetadata" : Symbol("XML Node Metadata");
|
|
959
|
+
const _T = class _T {
|
|
960
|
+
constructor(t2) {
|
|
961
|
+
this.tagname = t2, this.child = [], this[":@"] = {};
|
|
962
|
+
}
|
|
963
|
+
add(t2, e2) {
|
|
964
|
+
"__proto__" === t2 && (t2 = "#__proto__"), this.child.push({ [t2]: e2 });
|
|
965
|
+
}
|
|
966
|
+
addChild(t2, e2) {
|
|
967
|
+
"__proto__" === t2.tagname && (t2.tagname = "#__proto__"), t2[":@"] && Object.keys(t2[":@"]).length > 0 ? this.child.push({ [t2.tagname]: t2.child, ":@": t2[":@"] }) : this.child.push({ [t2.tagname]: t2.child }), void 0 !== e2 && (this.child[this.child.length - 1][y] = { startIndex: e2 });
|
|
968
|
+
}
|
|
969
|
+
static getMetaDataSymbol() {
|
|
970
|
+
return y;
|
|
2175
971
|
}
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
|
|
2182
|
-
|
|
972
|
+
};
|
|
973
|
+
__name(_T, "T");
|
|
974
|
+
let T = _T;
|
|
975
|
+
function P(t2, e2) {
|
|
976
|
+
const n2 = {};
|
|
977
|
+
if ("O" !== t2[e2 + 3] || "C" !== t2[e2 + 4] || "T" !== t2[e2 + 5] || "Y" !== t2[e2 + 6] || "P" !== t2[e2 + 7] || "E" !== t2[e2 + 8]) throw new Error("Invalid Tag instead of DOCTYPE");
|
|
978
|
+
{
|
|
979
|
+
e2 += 9;
|
|
980
|
+
let i2 = 1, s2 = false, r2 = false, o2 = "";
|
|
981
|
+
for (; e2 < t2.length; e2++) if ("<" !== t2[e2] || r2) if (">" === t2[e2]) {
|
|
982
|
+
if (r2 ? "-" === t2[e2 - 1] && "-" === t2[e2 - 2] && (r2 = false, i2--) : i2--, 0 === i2) break;
|
|
983
|
+
} else "[" === t2[e2] ? s2 = true : o2 += t2[e2];
|
|
984
|
+
else {
|
|
985
|
+
if (s2 && A(t2, e2)) {
|
|
986
|
+
let i3, s3;
|
|
987
|
+
e2 += 7, [i3, s3, e2] = O(t2, e2 + 1), -1 === s3.indexOf("&") && (n2[j(i3)] = { regx: RegExp(`&${i3};`, "g"), val: s3 });
|
|
988
|
+
} else if (s2 && I(t2, e2)) e2 += 8;
|
|
989
|
+
else if (s2 && C(t2, e2)) e2 += 8;
|
|
990
|
+
else if (s2 && S(t2, e2)) e2 += 9;
|
|
991
|
+
else {
|
|
992
|
+
if (!w) throw new Error("Invalid DOCTYPE");
|
|
993
|
+
r2 = true;
|
|
994
|
+
}
|
|
995
|
+
i2++, o2 = "";
|
|
996
|
+
}
|
|
997
|
+
if (0 !== i2) throw new Error("Unclosed DOCTYPE");
|
|
998
|
+
}
|
|
999
|
+
return { entities: n2, i: e2 };
|
|
1000
|
+
}
|
|
1001
|
+
__name(P, "P");
|
|
1002
|
+
function O(t2, e2) {
|
|
1003
|
+
let n2 = "";
|
|
1004
|
+
for (; e2 < t2.length && "'" !== t2[e2] && '"' !== t2[e2]; e2++) n2 += t2[e2];
|
|
1005
|
+
if (n2 = n2.trim(), -1 !== n2.indexOf(" ")) throw new Error("External entites are not supported");
|
|
1006
|
+
const i2 = t2[e2++];
|
|
1007
|
+
let s2 = "";
|
|
1008
|
+
for (; e2 < t2.length && t2[e2] !== i2; e2++) s2 += t2[e2];
|
|
1009
|
+
return [n2, s2, e2];
|
|
1010
|
+
}
|
|
1011
|
+
__name(O, "O");
|
|
1012
|
+
function w(t2, e2) {
|
|
1013
|
+
return "!" === t2[e2 + 1] && "-" === t2[e2 + 2] && "-" === t2[e2 + 3];
|
|
1014
|
+
}
|
|
1015
|
+
__name(w, "w");
|
|
1016
|
+
function A(t2, e2) {
|
|
1017
|
+
return "!" === t2[e2 + 1] && "E" === t2[e2 + 2] && "N" === t2[e2 + 3] && "T" === t2[e2 + 4] && "I" === t2[e2 + 5] && "T" === t2[e2 + 6] && "Y" === t2[e2 + 7];
|
|
1018
|
+
}
|
|
1019
|
+
__name(A, "A");
|
|
1020
|
+
function I(t2, e2) {
|
|
1021
|
+
return "!" === t2[e2 + 1] && "E" === t2[e2 + 2] && "L" === t2[e2 + 3] && "E" === t2[e2 + 4] && "M" === t2[e2 + 5] && "E" === t2[e2 + 6] && "N" === t2[e2 + 7] && "T" === t2[e2 + 8];
|
|
1022
|
+
}
|
|
1023
|
+
__name(I, "I");
|
|
1024
|
+
function C(t2, e2) {
|
|
1025
|
+
return "!" === t2[e2 + 1] && "A" === t2[e2 + 2] && "T" === t2[e2 + 3] && "T" === t2[e2 + 4] && "L" === t2[e2 + 5] && "I" === t2[e2 + 6] && "S" === t2[e2 + 7] && "T" === t2[e2 + 8];
|
|
1026
|
+
}
|
|
1027
|
+
__name(C, "C");
|
|
1028
|
+
function S(t2, e2) {
|
|
1029
|
+
return "!" === t2[e2 + 1] && "N" === t2[e2 + 2] && "O" === t2[e2 + 3] && "T" === t2[e2 + 4] && "A" === t2[e2 + 5] && "T" === t2[e2 + 6] && "I" === t2[e2 + 7] && "O" === t2[e2 + 8] && "N" === t2[e2 + 9];
|
|
1030
|
+
}
|
|
1031
|
+
__name(S, "S");
|
|
1032
|
+
function j(t2) {
|
|
1033
|
+
if (r(t2)) return t2;
|
|
1034
|
+
throw new Error(`Invalid entity name ${t2}`);
|
|
1035
|
+
}
|
|
1036
|
+
__name(j, "j");
|
|
1037
|
+
const D = /^[-+]?0x[a-fA-F0-9]+$/, V = /^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/, $ = { hex: true, leadingZeros: true, decimalPoint: ".", eNotation: true };
|
|
1038
|
+
function _(t2) {
|
|
1039
|
+
return "function" == typeof t2 ? t2 : Array.isArray(t2) ? (e2) => {
|
|
1040
|
+
for (const n2 of t2) {
|
|
1041
|
+
if ("string" == typeof n2 && e2 === n2) return true;
|
|
1042
|
+
if (n2 instanceof RegExp && n2.test(e2)) return true;
|
|
1043
|
+
}
|
|
1044
|
+
} : () => false;
|
|
1045
|
+
}
|
|
1046
|
+
__name(_, "_");
|
|
1047
|
+
const _k = class _k {
|
|
1048
|
+
constructor(t2) {
|
|
1049
|
+
this.options = t2, this.currentNode = null, this.tagsNodeStack = [], this.docTypeEntities = {}, this.lastEntities = { apos: { regex: /&(apos|#39|#x27);/g, val: "'" }, gt: { regex: /&(gt|#62|#x3E);/g, val: ">" }, lt: { regex: /&(lt|#60|#x3C);/g, val: "<" }, quot: { regex: /&(quot|#34|#x22);/g, val: '"' } }, this.ampEntity = { regex: /&(amp|#38|#x26);/g, val: "&" }, this.htmlEntities = { space: { regex: /&(nbsp|#160);/g, val: " " }, cent: { regex: /&(cent|#162);/g, val: "\xA2" }, pound: { regex: /&(pound|#163);/g, val: "\xA3" }, yen: { regex: /&(yen|#165);/g, val: "\xA5" }, euro: { regex: /&(euro|#8364);/g, val: "\u20AC" }, copyright: { regex: /&(copy|#169);/g, val: "\xA9" }, reg: { regex: /&(reg|#174);/g, val: "\xAE" }, inr: { regex: /&(inr|#8377);/g, val: "\u20B9" }, num_dec: { regex: /&#([0-9]{1,7});/g, val: /* @__PURE__ */ __name((t3, e2) => String.fromCodePoint(Number.parseInt(e2, 10)), "val") }, num_hex: { regex: /&#x([0-9a-fA-F]{1,6});/g, val: /* @__PURE__ */ __name((t3, e2) => String.fromCodePoint(Number.parseInt(e2, 16)), "val") } }, this.addExternalEntities = F, this.parseXml = X, this.parseTextData = M, this.resolveNameSpace = L, this.buildAttributesMap = G, this.isItStopNode = Y, this.replaceEntitiesValue = U, this.readStopNodeData = z, this.saveTextToParentTag = Z, this.addChild = R, this.ignoreAttributesFn = _(this.options.ignoreAttributes);
|
|
2183
1050
|
}
|
|
2184
|
-
|
|
2185
|
-
|
|
2186
|
-
|
|
2187
|
-
|
|
2188
|
-
|
|
2189
|
-
|
|
2190
|
-
|
|
2191
|
-
|
|
2192
|
-
|
|
2193
|
-
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
|
|
2197
|
-
|
|
2198
|
-
|
|
2199
|
-
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
|
|
2204
|
-
|
|
2205
|
-
|
|
2206
|
-
|
|
2207
|
-
|
|
2208
|
-
|
|
2209
|
-
|
|
2210
|
-
|
|
2211
|
-
|
|
2212
|
-
|
|
2213
|
-
|
|
2214
|
-
|
|
2215
|
-
|
|
2216
|
-
|
|
2217
|
-
|
|
2218
|
-
|
|
2219
|
-
|
|
2220
|
-
|
|
2221
|
-
|
|
2222
|
-
|
|
2223
|
-
|
|
2224
|
-
|
|
2225
|
-
|
|
2226
|
-
|
|
2227
|
-
|
|
2228
|
-
|
|
2229
|
-
|
|
2230
|
-
|
|
2231
|
-
|
|
2232
|
-
|
|
2233
|
-
|
|
2234
|
-
|
|
2235
|
-
|
|
2236
|
-
|
|
2237
|
-
|
|
2238
|
-
|
|
2239
|
-
|
|
2240
|
-
|
|
2241
|
-
|
|
2242
|
-
|
|
2243
|
-
|
|
2244
|
-
|
|
2245
|
-
|
|
2246
|
-
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
1051
|
+
};
|
|
1052
|
+
__name(_k, "k");
|
|
1053
|
+
let k = _k;
|
|
1054
|
+
function F(t2) {
|
|
1055
|
+
const e2 = Object.keys(t2);
|
|
1056
|
+
for (let n2 = 0; n2 < e2.length; n2++) {
|
|
1057
|
+
const i2 = e2[n2];
|
|
1058
|
+
this.lastEntities[i2] = { regex: new RegExp("&" + i2 + ";", "g"), val: t2[i2] };
|
|
1059
|
+
}
|
|
1060
|
+
}
|
|
1061
|
+
__name(F, "F");
|
|
1062
|
+
function M(t2, e2, n2, i2, s2, r2, o2) {
|
|
1063
|
+
if (void 0 !== t2 && (this.options.trimValues && !i2 && (t2 = t2.trim()), t2.length > 0)) {
|
|
1064
|
+
o2 || (t2 = this.replaceEntitiesValue(t2));
|
|
1065
|
+
const i3 = this.options.tagValueProcessor(e2, t2, n2, s2, r2);
|
|
1066
|
+
return null == i3 ? t2 : typeof i3 != typeof t2 || i3 !== t2 ? i3 : this.options.trimValues || t2.trim() === t2 ? J(t2, this.options.parseTagValue, this.options.numberParseOptions) : t2;
|
|
1067
|
+
}
|
|
1068
|
+
}
|
|
1069
|
+
__name(M, "M");
|
|
1070
|
+
function L(t2) {
|
|
1071
|
+
if (this.options.removeNSPrefix) {
|
|
1072
|
+
const e2 = t2.split(":"), n2 = "/" === t2.charAt(0) ? "/" : "";
|
|
1073
|
+
if ("xmlns" === e2[0]) return "";
|
|
1074
|
+
2 === e2.length && (t2 = n2 + e2[1]);
|
|
1075
|
+
}
|
|
1076
|
+
return t2;
|
|
1077
|
+
}
|
|
1078
|
+
__name(L, "L");
|
|
1079
|
+
const B = new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`, "gm");
|
|
1080
|
+
function G(t2, e2, n2) {
|
|
1081
|
+
if (true !== this.options.ignoreAttributes && "string" == typeof t2) {
|
|
1082
|
+
const n3 = s(t2, B), i2 = n3.length, r2 = {};
|
|
1083
|
+
for (let t3 = 0; t3 < i2; t3++) {
|
|
1084
|
+
const i3 = this.resolveNameSpace(n3[t3][1]);
|
|
1085
|
+
if (this.ignoreAttributesFn(i3, e2)) continue;
|
|
1086
|
+
let s2 = n3[t3][4], o2 = this.options.attributeNamePrefix + i3;
|
|
1087
|
+
if (i3.length) if (this.options.transformAttributeName && (o2 = this.options.transformAttributeName(o2)), "__proto__" === o2 && (o2 = "#__proto__"), void 0 !== s2) {
|
|
1088
|
+
this.options.trimValues && (s2 = s2.trim()), s2 = this.replaceEntitiesValue(s2);
|
|
1089
|
+
const t4 = this.options.attributeValueProcessor(i3, s2, e2);
|
|
1090
|
+
r2[o2] = null == t4 ? s2 : typeof t4 != typeof s2 || t4 !== s2 ? t4 : J(s2, this.options.parseAttributeValue, this.options.numberParseOptions);
|
|
1091
|
+
} else this.options.allowBooleanAttributes && (r2[o2] = true);
|
|
1092
|
+
}
|
|
1093
|
+
if (!Object.keys(r2).length) return;
|
|
1094
|
+
if (this.options.attributesGroupName) {
|
|
1095
|
+
const t3 = {};
|
|
1096
|
+
return t3[this.options.attributesGroupName] = r2, t3;
|
|
1097
|
+
}
|
|
1098
|
+
return r2;
|
|
1099
|
+
}
|
|
1100
|
+
}
|
|
1101
|
+
__name(G, "G");
|
|
1102
|
+
const X = /* @__PURE__ */ __name(function(t2) {
|
|
1103
|
+
t2 = t2.replace(/\r\n?/g, "\n");
|
|
1104
|
+
const e2 = new T("!xml");
|
|
1105
|
+
let n2 = e2, i2 = "", s2 = "";
|
|
1106
|
+
for (let r2 = 0; r2 < t2.length; r2++) if ("<" === t2[r2]) if ("/" === t2[r2 + 1]) {
|
|
1107
|
+
const e3 = q(t2, ">", r2, "Closing Tag is not closed.");
|
|
1108
|
+
let o2 = t2.substring(r2 + 2, e3).trim();
|
|
1109
|
+
if (this.options.removeNSPrefix) {
|
|
1110
|
+
const t3 = o2.indexOf(":");
|
|
1111
|
+
-1 !== t3 && (o2 = o2.substr(t3 + 1));
|
|
1112
|
+
}
|
|
1113
|
+
this.options.transformTagName && (o2 = this.options.transformTagName(o2)), n2 && (i2 = this.saveTextToParentTag(i2, n2, s2));
|
|
1114
|
+
const a2 = s2.substring(s2.lastIndexOf(".") + 1);
|
|
1115
|
+
if (o2 && -1 !== this.options.unpairedTags.indexOf(o2)) throw new Error(`Unpaired tag can not be used as closing tag: </${o2}>`);
|
|
1116
|
+
let l2 = 0;
|
|
1117
|
+
a2 && -1 !== this.options.unpairedTags.indexOf(a2) ? (l2 = s2.lastIndexOf(".", s2.lastIndexOf(".") - 1), this.tagsNodeStack.pop()) : l2 = s2.lastIndexOf("."), s2 = s2.substring(0, l2), n2 = this.tagsNodeStack.pop(), i2 = "", r2 = e3;
|
|
1118
|
+
} else if ("?" === t2[r2 + 1]) {
|
|
1119
|
+
let e3 = W(t2, r2, false, "?>");
|
|
1120
|
+
if (!e3) throw new Error("Pi Tag is not closed.");
|
|
1121
|
+
if (i2 = this.saveTextToParentTag(i2, n2, s2), this.options.ignoreDeclaration && "?xml" === e3.tagName || this.options.ignorePiTags) ;
|
|
1122
|
+
else {
|
|
1123
|
+
const t3 = new T(e3.tagName);
|
|
1124
|
+
t3.add(this.options.textNodeName, ""), e3.tagName !== e3.tagExp && e3.attrExpPresent && (t3[":@"] = this.buildAttributesMap(e3.tagExp, s2, e3.tagName)), this.addChild(n2, t3, s2, r2);
|
|
1125
|
+
}
|
|
1126
|
+
r2 = e3.closeIndex + 1;
|
|
1127
|
+
} else if ("!--" === t2.substr(r2 + 1, 3)) {
|
|
1128
|
+
const e3 = q(t2, "-->", r2 + 4, "Comment is not closed.");
|
|
1129
|
+
if (this.options.commentPropName) {
|
|
1130
|
+
const o2 = t2.substring(r2 + 4, e3 - 2);
|
|
1131
|
+
i2 = this.saveTextToParentTag(i2, n2, s2), n2.add(this.options.commentPropName, [{ [this.options.textNodeName]: o2 }]);
|
|
1132
|
+
}
|
|
1133
|
+
r2 = e3;
|
|
1134
|
+
} else if ("!D" === t2.substr(r2 + 1, 2)) {
|
|
1135
|
+
const e3 = P(t2, r2);
|
|
1136
|
+
this.docTypeEntities = e3.entities, r2 = e3.i;
|
|
1137
|
+
} else if ("![" === t2.substr(r2 + 1, 2)) {
|
|
1138
|
+
const e3 = q(t2, "]]>", r2, "CDATA is not closed.") - 2, o2 = t2.substring(r2 + 9, e3);
|
|
1139
|
+
i2 = this.saveTextToParentTag(i2, n2, s2);
|
|
1140
|
+
let a2 = this.parseTextData(o2, n2.tagname, s2, true, false, true, true);
|
|
1141
|
+
null == a2 && (a2 = ""), this.options.cdataPropName ? n2.add(this.options.cdataPropName, [{ [this.options.textNodeName]: o2 }]) : n2.add(this.options.textNodeName, a2), r2 = e3 + 2;
|
|
1142
|
+
} else {
|
|
1143
|
+
let o2 = W(t2, r2, this.options.removeNSPrefix), a2 = o2.tagName;
|
|
1144
|
+
const l2 = o2.rawTagName;
|
|
1145
|
+
let u2 = o2.tagExp, h2 = o2.attrExpPresent, d2 = o2.closeIndex;
|
|
1146
|
+
this.options.transformTagName && (a2 = this.options.transformTagName(a2)), n2 && i2 && "!xml" !== n2.tagname && (i2 = this.saveTextToParentTag(i2, n2, s2, false));
|
|
1147
|
+
const c2 = n2;
|
|
1148
|
+
c2 && -1 !== this.options.unpairedTags.indexOf(c2.tagname) && (n2 = this.tagsNodeStack.pop(), s2 = s2.substring(0, s2.lastIndexOf("."))), a2 !== e2.tagname && (s2 += s2 ? "." + a2 : a2);
|
|
1149
|
+
const p2 = r2;
|
|
1150
|
+
if (this.isItStopNode(this.options.stopNodes, s2, a2)) {
|
|
1151
|
+
let e3 = "";
|
|
1152
|
+
if (u2.length > 0 && u2.lastIndexOf("/") === u2.length - 1) "/" === a2[a2.length - 1] ? (a2 = a2.substr(0, a2.length - 1), s2 = s2.substr(0, s2.length - 1), u2 = a2) : u2 = u2.substr(0, u2.length - 1), r2 = o2.closeIndex;
|
|
1153
|
+
else if (-1 !== this.options.unpairedTags.indexOf(a2)) r2 = o2.closeIndex;
|
|
1154
|
+
else {
|
|
1155
|
+
const n3 = this.readStopNodeData(t2, l2, d2 + 1);
|
|
1156
|
+
if (!n3) throw new Error(`Unexpected end of ${l2}`);
|
|
1157
|
+
r2 = n3.i, e3 = n3.tagContent;
|
|
1158
|
+
}
|
|
1159
|
+
const i3 = new T(a2);
|
|
1160
|
+
a2 !== u2 && h2 && (i3[":@"] = this.buildAttributesMap(u2, s2, a2)), e3 && (e3 = this.parseTextData(e3, a2, s2, true, h2, true, true)), s2 = s2.substr(0, s2.lastIndexOf(".")), i3.add(this.options.textNodeName, e3), this.addChild(n2, i3, s2, p2);
|
|
1161
|
+
} else {
|
|
1162
|
+
if (u2.length > 0 && u2.lastIndexOf("/") === u2.length - 1) {
|
|
1163
|
+
"/" === a2[a2.length - 1] ? (a2 = a2.substr(0, a2.length - 1), s2 = s2.substr(0, s2.length - 1), u2 = a2) : u2 = u2.substr(0, u2.length - 1), this.options.transformTagName && (a2 = this.options.transformTagName(a2));
|
|
1164
|
+
const t3 = new T(a2);
|
|
1165
|
+
a2 !== u2 && h2 && (t3[":@"] = this.buildAttributesMap(u2, s2, a2)), this.addChild(n2, t3, s2, p2), s2 = s2.substr(0, s2.lastIndexOf("."));
|
|
1166
|
+
} else {
|
|
1167
|
+
const t3 = new T(a2);
|
|
1168
|
+
this.tagsNodeStack.push(n2), a2 !== u2 && h2 && (t3[":@"] = this.buildAttributesMap(u2, s2, a2)), this.addChild(n2, t3, s2, p2), n2 = t3;
|
|
2262
1169
|
}
|
|
2263
|
-
|
|
2264
|
-
currentNode = childNode;
|
|
1170
|
+
i2 = "", r2 = d2;
|
|
2265
1171
|
}
|
|
2266
|
-
textData = "";
|
|
2267
|
-
i = closeIndex;
|
|
2268
1172
|
}
|
|
1173
|
+
else i2 += t2[r2];
|
|
1174
|
+
return e2.child;
|
|
1175
|
+
}, "X");
|
|
1176
|
+
function R(t2, e2, n2, i2) {
|
|
1177
|
+
this.options.captureMetaData || (i2 = void 0);
|
|
1178
|
+
const s2 = this.options.updateTag(e2.tagname, n2, e2[":@"]);
|
|
1179
|
+
false === s2 || ("string" == typeof s2 ? (e2.tagname = s2, t2.addChild(e2, i2)) : t2.addChild(e2, i2));
|
|
2269
1180
|
}
|
|
2270
|
-
|
|
2271
|
-
|
|
2272
|
-
|
|
2273
|
-
|
|
2274
|
-
|
|
2275
|
-
|
|
2276
|
-
|
|
2277
|
-
function addChild(currentNode, childNode, jPath){
|
|
2278
|
-
const result = this.options.updateTag(childNode.tagname, jPath, childNode[":@"])
|
|
2279
|
-
if(result === false){
|
|
2280
|
-
}else if(typeof result === "string"){
|
|
2281
|
-
childNode.tagname = result
|
|
2282
|
-
currentNode.addChild(childNode);
|
|
2283
|
-
}else{
|
|
2284
|
-
currentNode.addChild(childNode);
|
|
2285
|
-
}
|
|
2286
|
-
}
|
|
2287
|
-
|
|
2288
|
-
const replaceEntitiesValue = function(val){
|
|
2289
|
-
|
|
2290
|
-
if(this.options.processEntities){
|
|
2291
|
-
for(let entityName in this.docTypeEntities){
|
|
2292
|
-
const entity = this.docTypeEntities[entityName];
|
|
2293
|
-
val = val.replace( entity.regx, entity.val);
|
|
2294
|
-
}
|
|
2295
|
-
for(let entityName in this.lastEntities){
|
|
2296
|
-
const entity = this.lastEntities[entityName];
|
|
2297
|
-
val = val.replace( entity.regex, entity.val);
|
|
2298
|
-
}
|
|
2299
|
-
if(this.options.htmlEntities){
|
|
2300
|
-
for(let entityName in this.htmlEntities){
|
|
2301
|
-
const entity = this.htmlEntities[entityName];
|
|
2302
|
-
val = val.replace( entity.regex, entity.val);
|
|
2303
|
-
}
|
|
2304
|
-
}
|
|
2305
|
-
val = val.replace( this.ampEntity.regex, this.ampEntity.val);
|
|
2306
|
-
}
|
|
2307
|
-
return val;
|
|
2308
|
-
}
|
|
2309
|
-
function saveTextToParentTag(textData, currentNode, jPath, isLeafNode) {
|
|
2310
|
-
if (textData) { //store previously collected data as textNode
|
|
2311
|
-
if(isLeafNode === undefined) isLeafNode = currentNode.child.length === 0
|
|
2312
|
-
|
|
2313
|
-
textData = this.parseTextData(textData,
|
|
2314
|
-
currentNode.tagname,
|
|
2315
|
-
jPath,
|
|
2316
|
-
false,
|
|
2317
|
-
currentNode[":@"] ? Object.keys(currentNode[":@"]).length !== 0 : false,
|
|
2318
|
-
isLeafNode);
|
|
2319
|
-
|
|
2320
|
-
if (textData !== undefined && textData !== "")
|
|
2321
|
-
currentNode.add(this.options.textNodeName, textData);
|
|
2322
|
-
textData = "";
|
|
2323
|
-
}
|
|
2324
|
-
return textData;
|
|
2325
|
-
}
|
|
2326
|
-
|
|
2327
|
-
//TODO: use jPath to simplify the logic
|
|
2328
|
-
/**
|
|
2329
|
-
*
|
|
2330
|
-
* @param {string[]} stopNodes
|
|
2331
|
-
* @param {string} jPath
|
|
2332
|
-
* @param {string} currentTagName
|
|
2333
|
-
*/
|
|
2334
|
-
function isItStopNode(stopNodes, jPath, currentTagName){
|
|
2335
|
-
const allNodesExp = "*." + currentTagName;
|
|
2336
|
-
for (const stopNodePath in stopNodes) {
|
|
2337
|
-
const stopNodeExp = stopNodes[stopNodePath];
|
|
2338
|
-
if( allNodesExp === stopNodeExp || jPath === stopNodeExp ) return true;
|
|
2339
|
-
}
|
|
2340
|
-
return false;
|
|
2341
|
-
}
|
|
2342
|
-
|
|
2343
|
-
/**
|
|
2344
|
-
* Returns the tag Expression and where it is ending handling single-double quotes situation
|
|
2345
|
-
* @param {string} xmlData
|
|
2346
|
-
* @param {number} i starting index
|
|
2347
|
-
* @returns
|
|
2348
|
-
*/
|
|
2349
|
-
function tagExpWithClosingIndex(xmlData, i, closingChar = ">"){
|
|
2350
|
-
let attrBoundary;
|
|
2351
|
-
let tagExp = "";
|
|
2352
|
-
for (let index = i; index < xmlData.length; index++) {
|
|
2353
|
-
let ch = xmlData[index];
|
|
2354
|
-
if (attrBoundary) {
|
|
2355
|
-
if (ch === attrBoundary) attrBoundary = "";//reset
|
|
2356
|
-
} else if (ch === '"' || ch === "'") {
|
|
2357
|
-
attrBoundary = ch;
|
|
2358
|
-
} else if (ch === closingChar[0]) {
|
|
2359
|
-
if(closingChar[1]){
|
|
2360
|
-
if(xmlData[index + 1] === closingChar[1]){
|
|
2361
|
-
return {
|
|
2362
|
-
data: tagExp,
|
|
2363
|
-
index: index
|
|
1181
|
+
__name(R, "R");
|
|
1182
|
+
const U = /* @__PURE__ */ __name(function(t2) {
|
|
1183
|
+
if (this.options.processEntities) {
|
|
1184
|
+
for (let e2 in this.docTypeEntities) {
|
|
1185
|
+
const n2 = this.docTypeEntities[e2];
|
|
1186
|
+
t2 = t2.replace(n2.regx, n2.val);
|
|
2364
1187
|
}
|
|
2365
|
-
|
|
2366
|
-
|
|
2367
|
-
|
|
2368
|
-
data: tagExp,
|
|
2369
|
-
index: index
|
|
2370
|
-
}
|
|
2371
|
-
}
|
|
2372
|
-
} else if (ch === '\\t') {
|
|
2373
|
-
ch = " "
|
|
2374
|
-
}
|
|
2375
|
-
tagExp += ch;
|
|
2376
|
-
}
|
|
2377
|
-
}
|
|
2378
|
-
|
|
2379
|
-
function findClosingIndex(xmlData, str, i, errMsg){
|
|
2380
|
-
const closingIndex = xmlData.indexOf(str, i);
|
|
2381
|
-
if(closingIndex === -1){
|
|
2382
|
-
throw new Error(errMsg)
|
|
2383
|
-
}else{
|
|
2384
|
-
return closingIndex + str.length - 1;
|
|
2385
|
-
}
|
|
2386
|
-
}
|
|
2387
|
-
|
|
2388
|
-
function readTagExp(xmlData,i, removeNSPrefix, closingChar = ">"){
|
|
2389
|
-
const result = tagExpWithClosingIndex(xmlData, i+1, closingChar);
|
|
2390
|
-
if(!result) return;
|
|
2391
|
-
let tagExp = result.data;
|
|
2392
|
-
const closeIndex = result.index;
|
|
2393
|
-
const separatorIndex = tagExp.search(/\\s/);
|
|
2394
|
-
let tagName = tagExp;
|
|
2395
|
-
let attrExpPresent = true;
|
|
2396
|
-
if(separatorIndex !== -1){//separate tag name and attributes expression
|
|
2397
|
-
tagName = tagExp.substring(0, separatorIndex);
|
|
2398
|
-
tagExp = tagExp.substring(separatorIndex + 1).trimStart();
|
|
2399
|
-
}
|
|
2400
|
-
|
|
2401
|
-
const rawTagName = tagName;
|
|
2402
|
-
if(removeNSPrefix){
|
|
2403
|
-
const colonIndex = tagName.indexOf(":");
|
|
2404
|
-
if(colonIndex !== -1){
|
|
2405
|
-
tagName = tagName.substr(colonIndex+1);
|
|
2406
|
-
attrExpPresent = tagName !== result.data.substr(colonIndex + 1);
|
|
2407
|
-
}
|
|
2408
|
-
}
|
|
2409
|
-
|
|
2410
|
-
return {
|
|
2411
|
-
tagName: tagName,
|
|
2412
|
-
tagExp: tagExp,
|
|
2413
|
-
closeIndex: closeIndex,
|
|
2414
|
-
attrExpPresent: attrExpPresent,
|
|
2415
|
-
rawTagName: rawTagName,
|
|
2416
|
-
}
|
|
2417
|
-
}
|
|
2418
|
-
/**
|
|
2419
|
-
* find paired tag for a stop node
|
|
2420
|
-
* @param {string} xmlData
|
|
2421
|
-
* @param {string} tagName
|
|
2422
|
-
* @param {number} i
|
|
2423
|
-
*/
|
|
2424
|
-
function readStopNodeData(xmlData, tagName, i){
|
|
2425
|
-
const startIndex = i;
|
|
2426
|
-
// Starting at 1 since we already have an open tag
|
|
2427
|
-
let openTagCount = 1;
|
|
2428
|
-
|
|
2429
|
-
for (; i < xmlData.length; i++) {
|
|
2430
|
-
if( xmlData[i] === "<"){
|
|
2431
|
-
if (xmlData[i+1] === "/") {//close tag
|
|
2432
|
-
const closeIndex = findClosingIndex(xmlData, ">", i, \`\${tagName} is not closed\`);
|
|
2433
|
-
let closeTagName = xmlData.substring(i+2,closeIndex).trim();
|
|
2434
|
-
if(closeTagName === tagName){
|
|
2435
|
-
openTagCount--;
|
|
2436
|
-
if (openTagCount === 0) {
|
|
2437
|
-
return {
|
|
2438
|
-
tagContent: xmlData.substring(startIndex, i),
|
|
2439
|
-
i : closeIndex
|
|
2440
|
-
}
|
|
2441
|
-
}
|
|
1188
|
+
for (let e2 in this.lastEntities) {
|
|
1189
|
+
const n2 = this.lastEntities[e2];
|
|
1190
|
+
t2 = t2.replace(n2.regex, n2.val);
|
|
2442
1191
|
}
|
|
2443
|
-
|
|
2444
|
-
|
|
2445
|
-
|
|
2446
|
-
i=closeIndex;
|
|
2447
|
-
} else if(xmlData.substr(i + 1, 3) === '!--') {
|
|
2448
|
-
const closeIndex = findClosingIndex(xmlData, "-->", i+3, "StopNode is not closed.")
|
|
2449
|
-
i=closeIndex;
|
|
2450
|
-
} else if(xmlData.substr(i + 1, 2) === '![') {
|
|
2451
|
-
const closeIndex = findClosingIndex(xmlData, "]]>", i, "StopNode is not closed.") - 2;
|
|
2452
|
-
i=closeIndex;
|
|
2453
|
-
} else {
|
|
2454
|
-
const tagData = readTagExp(xmlData, i, '>')
|
|
2455
|
-
|
|
2456
|
-
if (tagData) {
|
|
2457
|
-
const openTagName = tagData && tagData.tagName;
|
|
2458
|
-
if (openTagName === tagName && tagData.tagExp[tagData.tagExp.length-1] !== "/") {
|
|
2459
|
-
openTagCount++;
|
|
2460
|
-
}
|
|
2461
|
-
i=tagData.closeIndex;
|
|
1192
|
+
if (this.options.htmlEntities) for (let e2 in this.htmlEntities) {
|
|
1193
|
+
const n2 = this.htmlEntities[e2];
|
|
1194
|
+
t2 = t2.replace(n2.regex, n2.val);
|
|
2462
1195
|
}
|
|
1196
|
+
t2 = t2.replace(this.ampEntity.regex, this.ampEntity.val);
|
|
2463
1197
|
}
|
|
1198
|
+
return t2;
|
|
1199
|
+
}, "U");
|
|
1200
|
+
function Z(t2, e2, n2, i2) {
|
|
1201
|
+
return t2 && (void 0 === i2 && (i2 = 0 === e2.child.length), void 0 !== (t2 = this.parseTextData(t2, e2.tagname, n2, false, !!e2[":@"] && 0 !== Object.keys(e2[":@"]).length, i2)) && "" !== t2 && e2.add(this.options.textNodeName, t2), t2 = ""), t2;
|
|
2464
1202
|
}
|
|
2465
|
-
|
|
2466
|
-
|
|
2467
|
-
|
|
2468
|
-
|
|
2469
|
-
|
|
2470
|
-
|
|
2471
|
-
const newval = val.trim();
|
|
2472
|
-
if(newval === 'true' ) return true;
|
|
2473
|
-
else if(newval === 'false' ) return false;
|
|
2474
|
-
else return (0,strnum__WEBPACK_IMPORTED_MODULE_3__["default"])(val, options);
|
|
2475
|
-
} else {
|
|
2476
|
-
if ((0,_util_js__WEBPACK_IMPORTED_MODULE_0__.isExist)(val)) {
|
|
2477
|
-
return val;
|
|
2478
|
-
} else {
|
|
2479
|
-
return '';
|
|
2480
|
-
}
|
|
2481
|
-
}
|
|
2482
|
-
}
|
|
2483
|
-
|
|
2484
|
-
|
|
2485
|
-
//# sourceURL=webpack://fast-xml-parser/./src/xmlparser/OrderedObjParser.js?`);
|
|
2486
|
-
}, "./src/xmlparser/OrderedObjParser.js")
|
|
2487
|
-
),
|
|
2488
|
-
/***/
|
|
2489
|
-
"./src/xmlparser/XMLParser.js": (
|
|
2490
|
-
/*!************************************!*\
|
|
2491
|
-
!*** ./src/xmlparser/XMLParser.js ***!
|
|
2492
|
-
\************************************/
|
|
2493
|
-
/***/
|
|
2494
|
-
/* @__PURE__ */ __name((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
|
2495
|
-
eval(`__webpack_require__.r(__webpack_exports__);
|
|
2496
|
-
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
2497
|
-
/* harmony export */ "default": () => (/* binding */ XMLParser)
|
|
2498
|
-
/* harmony export */ });
|
|
2499
|
-
/* harmony import */ var _OptionsBuilder_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./OptionsBuilder.js */ "./src/xmlparser/OptionsBuilder.js");
|
|
2500
|
-
/* harmony import */ var _OrderedObjParser_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./OrderedObjParser.js */ "./src/xmlparser/OrderedObjParser.js");
|
|
2501
|
-
/* harmony import */ var _node2json_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./node2json.js */ "./src/xmlparser/node2json.js");
|
|
2502
|
-
/* harmony import */ var _validator_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../validator.js */ "./src/validator.js");
|
|
2503
|
-
|
|
2504
|
-
|
|
2505
|
-
|
|
2506
|
-
|
|
2507
|
-
|
|
2508
|
-
class XMLParser{
|
|
2509
|
-
|
|
2510
|
-
constructor(options){
|
|
2511
|
-
this.externalEntities = {};
|
|
2512
|
-
this.options = (0,_OptionsBuilder_js__WEBPACK_IMPORTED_MODULE_0__.buildOptions)(options);
|
|
2513
|
-
|
|
2514
|
-
}
|
|
2515
|
-
/**
|
|
2516
|
-
* Parse XML dats to JS object
|
|
2517
|
-
* @param {string|Buffer} xmlData
|
|
2518
|
-
* @param {boolean|Object} validationOption
|
|
2519
|
-
*/
|
|
2520
|
-
parse(xmlData,validationOption){
|
|
2521
|
-
if(typeof xmlData === "string"){
|
|
2522
|
-
}else if( xmlData.toString){
|
|
2523
|
-
xmlData = xmlData.toString();
|
|
2524
|
-
}else{
|
|
2525
|
-
throw new Error("XML data is accepted in String or Bytes[] form.")
|
|
2526
|
-
}
|
|
2527
|
-
if( validationOption){
|
|
2528
|
-
if(validationOption === true) validationOption = {}; //validate with default options
|
|
2529
|
-
|
|
2530
|
-
const result = (0,_validator_js__WEBPACK_IMPORTED_MODULE_3__.validate)(xmlData, validationOption);
|
|
2531
|
-
if (result !== true) {
|
|
2532
|
-
throw Error( \`\${result.err.msg}:\${result.err.line}:\${result.err.col}\` )
|
|
2533
|
-
}
|
|
2534
|
-
}
|
|
2535
|
-
const orderedObjParser = new _OrderedObjParser_js__WEBPACK_IMPORTED_MODULE_1__["default"](this.options);
|
|
2536
|
-
orderedObjParser.addExternalEntities(this.externalEntities);
|
|
2537
|
-
const orderedResult = orderedObjParser.parseXml(xmlData);
|
|
2538
|
-
if(this.options.preserveOrder || orderedResult === undefined) return orderedResult;
|
|
2539
|
-
else return (0,_node2json_js__WEBPACK_IMPORTED_MODULE_2__["default"])(orderedResult, this.options);
|
|
2540
|
-
}
|
|
2541
|
-
|
|
2542
|
-
/**
|
|
2543
|
-
* Add Entity which is not by default supported by this library
|
|
2544
|
-
* @param {string} key
|
|
2545
|
-
* @param {string} value
|
|
2546
|
-
*/
|
|
2547
|
-
addEntity(key, value){
|
|
2548
|
-
if(value.indexOf("&") !== -1){
|
|
2549
|
-
throw new Error("Entity value can't have '&'")
|
|
2550
|
-
}else if(key.indexOf("&") !== -1 || key.indexOf(";") !== -1){
|
|
2551
|
-
throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '
'")
|
|
2552
|
-
}else if(value === "&"){
|
|
2553
|
-
throw new Error("An entity with value '&' is not permitted");
|
|
2554
|
-
}else{
|
|
2555
|
-
this.externalEntities[key] = value;
|
|
1203
|
+
__name(Z, "Z");
|
|
1204
|
+
function Y(t2, e2, n2) {
|
|
1205
|
+
const i2 = "*." + n2;
|
|
1206
|
+
for (const n3 in t2) {
|
|
1207
|
+
const s2 = t2[n3];
|
|
1208
|
+
if (i2 === s2 || e2 === s2) return true;
|
|
2556
1209
|
}
|
|
2557
|
-
|
|
2558
|
-
}
|
|
2559
|
-
|
|
2560
|
-
//# sourceURL=webpack://fast-xml-parser/./src/xmlparser/XMLParser.js?`);
|
|
2561
|
-
}, "./src/xmlparser/XMLParser.js")
|
|
2562
|
-
),
|
|
2563
|
-
/***/
|
|
2564
|
-
"./src/xmlparser/node2json.js": (
|
|
2565
|
-
/*!************************************!*\
|
|
2566
|
-
!*** ./src/xmlparser/node2json.js ***!
|
|
2567
|
-
\************************************/
|
|
2568
|
-
/***/
|
|
2569
|
-
/* @__PURE__ */ __name((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
|
2570
|
-
eval(`__webpack_require__.r(__webpack_exports__);
|
|
2571
|
-
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
2572
|
-
/* harmony export */ "default": () => (/* binding */ prettify)
|
|
2573
|
-
/* harmony export */ });
|
|
2574
|
-
|
|
2575
|
-
|
|
2576
|
-
/**
|
|
2577
|
-
*
|
|
2578
|
-
* @param {array} node
|
|
2579
|
-
* @param {any} options
|
|
2580
|
-
* @returns
|
|
2581
|
-
*/
|
|
2582
|
-
function prettify(node, options){
|
|
2583
|
-
return compress( node, options);
|
|
2584
|
-
}
|
|
2585
|
-
|
|
2586
|
-
/**
|
|
2587
|
-
*
|
|
2588
|
-
* @param {array} arr
|
|
2589
|
-
* @param {object} options
|
|
2590
|
-
* @param {string} jPath
|
|
2591
|
-
* @returns object
|
|
2592
|
-
*/
|
|
2593
|
-
function compress(arr, options, jPath){
|
|
2594
|
-
let text;
|
|
2595
|
-
const compressedObj = {};
|
|
2596
|
-
for (let i = 0; i < arr.length; i++) {
|
|
2597
|
-
const tagObj = arr[i];
|
|
2598
|
-
const property = propName(tagObj);
|
|
2599
|
-
let newJpath = "";
|
|
2600
|
-
if(jPath === undefined) newJpath = property;
|
|
2601
|
-
else newJpath = jPath + "." + property;
|
|
2602
|
-
|
|
2603
|
-
if(property === options.textNodeName){
|
|
2604
|
-
if(text === undefined) text = tagObj[property];
|
|
2605
|
-
else text += "" + tagObj[property];
|
|
2606
|
-
}else if(property === undefined){
|
|
2607
|
-
continue;
|
|
2608
|
-
}else if(tagObj[property]){
|
|
2609
|
-
|
|
2610
|
-
let val = compress(tagObj[property], options, newJpath);
|
|
2611
|
-
const isLeaf = isLeafTag(val, options);
|
|
2612
|
-
|
|
2613
|
-
if(tagObj[":@"]){
|
|
2614
|
-
assignAttributes( val, tagObj[":@"], newJpath, options);
|
|
2615
|
-
}else if(Object.keys(val).length === 1 && val[options.textNodeName] !== undefined && !options.alwaysCreateTextNode){
|
|
2616
|
-
val = val[options.textNodeName];
|
|
2617
|
-
}else if(Object.keys(val).length === 0){
|
|
2618
|
-
if(options.alwaysCreateTextNode) val[options.textNodeName] = "";
|
|
2619
|
-
else val = "";
|
|
1210
|
+
return false;
|
|
2620
1211
|
}
|
|
2621
|
-
|
|
2622
|
-
|
|
2623
|
-
|
|
2624
|
-
|
|
2625
|
-
|
|
2626
|
-
|
|
2627
|
-
|
|
2628
|
-
|
|
2629
|
-
|
|
2630
|
-
|
|
2631
|
-
|
|
2632
|
-
|
|
2633
|
-
|
|
1212
|
+
__name(Y, "Y");
|
|
1213
|
+
function q(t2, e2, n2, i2) {
|
|
1214
|
+
const s2 = t2.indexOf(e2, n2);
|
|
1215
|
+
if (-1 === s2) throw new Error(i2);
|
|
1216
|
+
return s2 + e2.length - 1;
|
|
1217
|
+
}
|
|
1218
|
+
__name(q, "q");
|
|
1219
|
+
function W(t2, e2, n2, i2 = ">") {
|
|
1220
|
+
const s2 = function(t3, e3, n3 = ">") {
|
|
1221
|
+
let i3, s3 = "";
|
|
1222
|
+
for (let r3 = e3; r3 < t3.length; r3++) {
|
|
1223
|
+
let e4 = t3[r3];
|
|
1224
|
+
if (i3) e4 === i3 && (i3 = "");
|
|
1225
|
+
else if ('"' === e4 || "'" === e4) i3 = e4;
|
|
1226
|
+
else if (e4 === n3[0]) {
|
|
1227
|
+
if (!n3[1]) return { data: s3, index: r3 };
|
|
1228
|
+
if (t3[r3 + 1] === n3[1]) return { data: s3, index: r3 };
|
|
1229
|
+
} else " " === e4 && (e4 = " ");
|
|
1230
|
+
s3 += e4;
|
|
1231
|
+
}
|
|
1232
|
+
}(t2, e2 + 1, i2);
|
|
1233
|
+
if (!s2) return;
|
|
1234
|
+
let r2 = s2.data;
|
|
1235
|
+
const o2 = s2.index, a2 = r2.search(/\s/);
|
|
1236
|
+
let l2 = r2, u2 = true;
|
|
1237
|
+
-1 !== a2 && (l2 = r2.substring(0, a2), r2 = r2.substring(a2 + 1).trimStart());
|
|
1238
|
+
const h2 = l2;
|
|
1239
|
+
if (n2) {
|
|
1240
|
+
const t3 = l2.indexOf(":");
|
|
1241
|
+
-1 !== t3 && (l2 = l2.substr(t3 + 1), u2 = l2 !== s2.data.substr(t3 + 1));
|
|
1242
|
+
}
|
|
1243
|
+
return { tagName: l2, tagExp: r2, closeIndex: o2, attrExpPresent: u2, rawTagName: h2 };
|
|
1244
|
+
}
|
|
1245
|
+
__name(W, "W");
|
|
1246
|
+
function z(t2, e2, n2) {
|
|
1247
|
+
const i2 = n2;
|
|
1248
|
+
let s2 = 1;
|
|
1249
|
+
for (; n2 < t2.length; n2++) if ("<" === t2[n2]) if ("/" === t2[n2 + 1]) {
|
|
1250
|
+
const r2 = q(t2, ">", n2, `${e2} is not closed`);
|
|
1251
|
+
if (t2.substring(n2 + 2, r2).trim() === e2 && (s2--, 0 === s2)) return { tagContent: t2.substring(i2, n2), i: r2 };
|
|
1252
|
+
n2 = r2;
|
|
1253
|
+
} else if ("?" === t2[n2 + 1]) n2 = q(t2, "?>", n2 + 1, "StopNode is not closed.");
|
|
1254
|
+
else if ("!--" === t2.substr(n2 + 1, 3)) n2 = q(t2, "-->", n2 + 3, "StopNode is not closed.");
|
|
1255
|
+
else if ("![" === t2.substr(n2 + 1, 2)) n2 = q(t2, "]]>", n2, "StopNode is not closed.") - 2;
|
|
1256
|
+
else {
|
|
1257
|
+
const i3 = W(t2, n2, ">");
|
|
1258
|
+
i3 && ((i3 && i3.tagName) === e2 && "/" !== i3.tagExp[i3.tagExp.length - 1] && s2++, n2 = i3.closeIndex);
|
|
1259
|
+
}
|
|
1260
|
+
}
|
|
1261
|
+
__name(z, "z");
|
|
1262
|
+
function J(t2, e2, n2) {
|
|
1263
|
+
if (e2 && "string" == typeof t2) {
|
|
1264
|
+
const e3 = t2.trim();
|
|
1265
|
+
return "true" === e3 || "false" !== e3 && function(t3, e4 = {}) {
|
|
1266
|
+
if (e4 = Object.assign({}, $, e4), !t3 || "string" != typeof t3) return t3;
|
|
1267
|
+
let n3 = t3.trim();
|
|
1268
|
+
if (void 0 !== e4.skipLike && e4.skipLike.test(n3)) return t3;
|
|
1269
|
+
if ("0" === t3) return 0;
|
|
1270
|
+
if (e4.hex && D.test(n3)) return function(t4) {
|
|
1271
|
+
if (parseInt) return parseInt(t4, 16);
|
|
1272
|
+
if (Number.parseInt) return Number.parseInt(t4, 16);
|
|
1273
|
+
if (window && window.parseInt) return window.parseInt(t4, 16);
|
|
1274
|
+
throw new Error("parseInt, Number.parseInt, window.parseInt are not supported");
|
|
1275
|
+
}(n3);
|
|
1276
|
+
if (-1 !== n3.search(/[eE]/)) {
|
|
1277
|
+
const i3 = n3.match(/^([-\+])?(0*)([0-9]*(\.[0-9]*)?[eE][-\+]?[0-9]+)$/);
|
|
1278
|
+
if (i3) {
|
|
1279
|
+
if (e4.leadingZeros) n3 = (i3[1] || "") + i3[3];
|
|
1280
|
+
else if ("0" !== i3[2] || "." !== i3[3][0]) return t3;
|
|
1281
|
+
return e4.eNotation ? Number(n3) : t3;
|
|
1282
|
+
}
|
|
1283
|
+
return t3;
|
|
1284
|
+
}
|
|
1285
|
+
{
|
|
1286
|
+
const s2 = V.exec(n3);
|
|
1287
|
+
if (s2) {
|
|
1288
|
+
const r2 = s2[1], o2 = s2[2];
|
|
1289
|
+
let a2 = (i2 = s2[3]) && -1 !== i2.indexOf(".") ? ("." === (i2 = i2.replace(/0+$/, "")) ? i2 = "0" : "." === i2[0] ? i2 = "0" + i2 : "." === i2[i2.length - 1] && (i2 = i2.substr(0, i2.length - 1)), i2) : i2;
|
|
1290
|
+
if (!e4.leadingZeros && o2.length > 0 && r2 && "." !== n3[2]) return t3;
|
|
1291
|
+
if (!e4.leadingZeros && o2.length > 0 && !r2 && "." !== n3[1]) return t3;
|
|
1292
|
+
if (e4.leadingZeros && o2 === t3) return 0;
|
|
1293
|
+
{
|
|
1294
|
+
const i3 = Number(n3), s3 = "" + i3;
|
|
1295
|
+
return -1 !== s3.search(/[eE]/) ? e4.eNotation ? i3 : t3 : -1 !== n3.indexOf(".") ? "0" === s3 && "" === a2 || s3 === a2 || r2 && s3 === "-" + a2 ? i3 : t3 : o2 ? a2 === s3 || r2 + a2 === s3 ? i3 : t3 : n3 === s3 || n3 === r2 + s3 ? i3 : t3;
|
|
1296
|
+
}
|
|
1297
|
+
}
|
|
1298
|
+
return t3;
|
|
1299
|
+
}
|
|
1300
|
+
var i2;
|
|
1301
|
+
}(t2, n2);
|
|
1302
|
+
}
|
|
1303
|
+
return void 0 !== t2 ? t2 : "";
|
|
1304
|
+
}
|
|
1305
|
+
__name(J, "J");
|
|
1306
|
+
const H = T.getMetaDataSymbol();
|
|
1307
|
+
function K(t2, e2) {
|
|
1308
|
+
return Q(t2, e2);
|
|
1309
|
+
}
|
|
1310
|
+
__name(K, "K");
|
|
1311
|
+
function Q(t2, e2, n2) {
|
|
1312
|
+
let i2;
|
|
1313
|
+
const s2 = {};
|
|
1314
|
+
for (let r2 = 0; r2 < t2.length; r2++) {
|
|
1315
|
+
const o2 = t2[r2], a2 = tt(o2);
|
|
1316
|
+
let l2 = "";
|
|
1317
|
+
if (l2 = void 0 === n2 ? a2 : n2 + "." + a2, a2 === e2.textNodeName) void 0 === i2 ? i2 = o2[a2] : i2 += "" + o2[a2];
|
|
1318
|
+
else {
|
|
1319
|
+
if (void 0 === a2) continue;
|
|
1320
|
+
if (o2[a2]) {
|
|
1321
|
+
let t3 = Q(o2[a2], e2, l2);
|
|
1322
|
+
const n3 = nt(t3, e2);
|
|
1323
|
+
void 0 !== o2[H] && (t3[H] = o2[H]), o2[":@"] ? et(t3, o2[":@"], l2, e2) : 1 !== Object.keys(t3).length || void 0 === t3[e2.textNodeName] || e2.alwaysCreateTextNode ? 0 === Object.keys(t3).length && (e2.alwaysCreateTextNode ? t3[e2.textNodeName] = "" : t3 = "") : t3 = t3[e2.textNodeName], void 0 !== s2[a2] && s2.hasOwnProperty(a2) ? (Array.isArray(s2[a2]) || (s2[a2] = [s2[a2]]), s2[a2].push(t3)) : e2.isArray(a2, l2, n3) ? s2[a2] = [t3] : s2[a2] = t3;
|
|
1324
|
+
}
|
|
1325
|
+
}
|
|
1326
|
+
}
|
|
1327
|
+
return "string" == typeof i2 ? i2.length > 0 && (s2[e2.textNodeName] = i2) : void 0 !== i2 && (s2[e2.textNodeName] = i2), s2;
|
|
1328
|
+
}
|
|
1329
|
+
__name(Q, "Q");
|
|
1330
|
+
function tt(t2) {
|
|
1331
|
+
const e2 = Object.keys(t2);
|
|
1332
|
+
for (let t3 = 0; t3 < e2.length; t3++) {
|
|
1333
|
+
const n2 = e2[t3];
|
|
1334
|
+
if (":@" !== n2) return n2;
|
|
1335
|
+
}
|
|
1336
|
+
}
|
|
1337
|
+
__name(tt, "tt");
|
|
1338
|
+
function et(t2, e2, n2, i2) {
|
|
1339
|
+
if (e2) {
|
|
1340
|
+
const s2 = Object.keys(e2), r2 = s2.length;
|
|
1341
|
+
for (let o2 = 0; o2 < r2; o2++) {
|
|
1342
|
+
const r3 = s2[o2];
|
|
1343
|
+
i2.isArray(r3, n2 + "." + r3, true, true) ? t2[r3] = [e2[r3]] : t2[r3] = e2[r3];
|
|
1344
|
+
}
|
|
1345
|
+
}
|
|
1346
|
+
}
|
|
1347
|
+
__name(et, "et");
|
|
1348
|
+
function nt(t2, e2) {
|
|
1349
|
+
const { textNodeName: n2 } = e2, i2 = Object.keys(t2).length;
|
|
1350
|
+
return 0 === i2 || !(1 !== i2 || !t2[n2] && "boolean" != typeof t2[n2] && 0 !== t2[n2]);
|
|
1351
|
+
}
|
|
1352
|
+
__name(nt, "nt");
|
|
1353
|
+
const _it = class _it {
|
|
1354
|
+
constructor(t2) {
|
|
1355
|
+
this.externalEntities = {}, this.options = function(t3) {
|
|
1356
|
+
return Object.assign({}, E, t3);
|
|
1357
|
+
}(t2);
|
|
1358
|
+
}
|
|
1359
|
+
parse(t2, e2) {
|
|
1360
|
+
if ("string" == typeof t2) ;
|
|
1361
|
+
else {
|
|
1362
|
+
if (!t2.toString) throw new Error("XML data is accepted in String or Bytes[] form.");
|
|
1363
|
+
t2 = t2.toString();
|
|
1364
|
+
}
|
|
1365
|
+
if (e2) {
|
|
1366
|
+
true === e2 && (e2 = {});
|
|
1367
|
+
const n3 = a(t2, e2);
|
|
1368
|
+
if (true !== n3) throw Error(`${n3.err.msg}:${n3.err.line}:${n3.err.col}`);
|
|
1369
|
+
}
|
|
1370
|
+
const n2 = new k(this.options);
|
|
1371
|
+
n2.addExternalEntities(this.externalEntities);
|
|
1372
|
+
const i2 = n2.parseXml(t2);
|
|
1373
|
+
return this.options.preserveOrder || void 0 === i2 ? i2 : K(i2, this.options);
|
|
1374
|
+
}
|
|
1375
|
+
addEntity(t2, e2) {
|
|
1376
|
+
if (-1 !== e2.indexOf("&")) throw new Error("Entity value can't have '&'");
|
|
1377
|
+
if (-1 !== t2.indexOf("&") || -1 !== t2.indexOf(";")) throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '
'");
|
|
1378
|
+
if ("&" === e2) throw new Error("An entity with value '&' is not permitted");
|
|
1379
|
+
this.externalEntities[t2] = e2;
|
|
1380
|
+
}
|
|
1381
|
+
static getMetaDataSymbol() {
|
|
1382
|
+
return T.getMetaDataSymbol();
|
|
2634
1383
|
}
|
|
2635
|
-
}
|
|
2636
|
-
}
|
|
2637
|
-
|
|
2638
|
-
}
|
|
2639
|
-
// if(text && text.length > 0) compressedObj[options.textNodeName] = text;
|
|
2640
|
-
if(typeof text === "string"){
|
|
2641
|
-
if(text.length > 0) compressedObj[options.textNodeName] = text;
|
|
2642
|
-
}else if(text !== undefined) compressedObj[options.textNodeName] = text;
|
|
2643
|
-
return compressedObj;
|
|
2644
|
-
}
|
|
2645
|
-
|
|
2646
|
-
function propName(obj){
|
|
2647
|
-
const keys = Object.keys(obj);
|
|
2648
|
-
for (let i = 0; i < keys.length; i++) {
|
|
2649
|
-
const key = keys[i];
|
|
2650
|
-
if(key !== ":@") return key;
|
|
2651
|
-
}
|
|
2652
|
-
}
|
|
2653
|
-
|
|
2654
|
-
function assignAttributes(obj, attrMap, jpath, options){
|
|
2655
|
-
if (attrMap) {
|
|
2656
|
-
const keys = Object.keys(attrMap);
|
|
2657
|
-
const len = keys.length; //don't make it inline
|
|
2658
|
-
for (let i = 0; i < len; i++) {
|
|
2659
|
-
const atrrName = keys[i];
|
|
2660
|
-
if (options.isArray(atrrName, jpath + "." + atrrName, true, true)) {
|
|
2661
|
-
obj[atrrName] = [ attrMap[atrrName] ];
|
|
2662
|
-
} else {
|
|
2663
|
-
obj[atrrName] = attrMap[atrrName];
|
|
2664
|
-
}
|
|
2665
|
-
}
|
|
2666
|
-
}
|
|
2667
|
-
}
|
|
2668
|
-
|
|
2669
|
-
function isLeafTag(obj, options){
|
|
2670
|
-
const { textNodeName } = options;
|
|
2671
|
-
const propCount = Object.keys(obj).length;
|
|
2672
|
-
|
|
2673
|
-
if (propCount === 0) {
|
|
2674
|
-
return true;
|
|
2675
|
-
}
|
|
2676
|
-
|
|
2677
|
-
if (
|
|
2678
|
-
propCount === 1 &&
|
|
2679
|
-
(obj[textNodeName] || typeof obj[textNodeName] === "boolean" || obj[textNodeName] === 0)
|
|
2680
|
-
) {
|
|
2681
|
-
return true;
|
|
2682
|
-
}
|
|
2683
|
-
|
|
2684
|
-
return false;
|
|
2685
|
-
}
|
|
2686
|
-
|
|
2687
|
-
|
|
2688
|
-
//# sourceURL=webpack://fast-xml-parser/./src/xmlparser/node2json.js?`);
|
|
2689
|
-
}, "./src/xmlparser/node2json.js")
|
|
2690
|
-
),
|
|
2691
|
-
/***/
|
|
2692
|
-
"./src/xmlparser/xmlNode.js": (
|
|
2693
|
-
/*!**********************************!*\
|
|
2694
|
-
!*** ./src/xmlparser/xmlNode.js ***!
|
|
2695
|
-
\**********************************/
|
|
2696
|
-
/***/
|
|
2697
|
-
/* @__PURE__ */ __name((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
|
2698
|
-
eval('__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ "default": () => (/* binding */ XmlNode)\n/* harmony export */ });\n\n\nclass XmlNode{\n constructor(tagname) {\n this.tagname = tagname;\n this.child = []; //nested tags, text, cdata, comments in order\n this[":@"] = {}; //attributes map\n }\n add(key,val){\n // this.child.push( {name : key, val: val, isCdata: isCdata });\n if(key === "__proto__") key = "#__proto__";\n this.child.push( {[key]: val });\n }\n addChild(node) {\n if(node.tagname === "__proto__") node.tagname = "#__proto__";\n if(node[":@"] && Object.keys(node[":@"]).length > 0){\n this.child.push( { [node.tagname]: node.child, [":@"]: node[":@"] });\n }else{\n this.child.push( { [node.tagname]: node.child });\n }\n }\n}\n\n\n//# sourceURL=webpack://fast-xml-parser/./src/xmlparser/xmlNode.js?');
|
|
2699
|
-
}, "./src/xmlparser/xmlNode.js")
|
|
2700
|
-
)
|
|
2701
|
-
/******/
|
|
2702
1384
|
};
|
|
2703
|
-
|
|
2704
|
-
|
|
2705
|
-
|
|
2706
|
-
|
|
2707
|
-
|
|
2708
|
-
|
|
2709
|
-
|
|
2710
|
-
|
|
2711
|
-
|
|
2712
|
-
|
|
2713
|
-
|
|
2714
|
-
|
|
2715
|
-
|
|
2716
|
-
|
|
2717
|
-
|
|
2718
|
-
|
|
2719
|
-
|
|
1385
|
+
__name(_it, "it");
|
|
1386
|
+
let it = _it;
|
|
1387
|
+
function st(t2, e2) {
|
|
1388
|
+
let n2 = "";
|
|
1389
|
+
return e2.format && e2.indentBy.length > 0 && (n2 = "\n"), rt(t2, e2, "", n2);
|
|
1390
|
+
}
|
|
1391
|
+
__name(st, "st");
|
|
1392
|
+
function rt(t2, e2, n2, i2) {
|
|
1393
|
+
let s2 = "", r2 = false;
|
|
1394
|
+
for (let o2 = 0; o2 < t2.length; o2++) {
|
|
1395
|
+
const a2 = t2[o2], l2 = ot(a2);
|
|
1396
|
+
if (void 0 === l2) continue;
|
|
1397
|
+
let u2 = "";
|
|
1398
|
+
if (u2 = 0 === n2.length ? l2 : `${n2}.${l2}`, l2 === e2.textNodeName) {
|
|
1399
|
+
let t3 = a2[l2];
|
|
1400
|
+
lt(u2, e2) || (t3 = e2.tagValueProcessor(l2, t3), t3 = ut(t3, e2)), r2 && (s2 += i2), s2 += t3, r2 = false;
|
|
1401
|
+
continue;
|
|
1402
|
+
}
|
|
1403
|
+
if (l2 === e2.cdataPropName) {
|
|
1404
|
+
r2 && (s2 += i2), s2 += `<![CDATA[${a2[l2][0][e2.textNodeName]}]]>`, r2 = false;
|
|
1405
|
+
continue;
|
|
1406
|
+
}
|
|
1407
|
+
if (l2 === e2.commentPropName) {
|
|
1408
|
+
s2 += i2 + `<!--${a2[l2][0][e2.textNodeName]}-->`, r2 = true;
|
|
1409
|
+
continue;
|
|
1410
|
+
}
|
|
1411
|
+
if ("?" === l2[0]) {
|
|
1412
|
+
const t3 = at(a2[":@"], e2), n3 = "?xml" === l2 ? "" : i2;
|
|
1413
|
+
let o3 = a2[l2][0][e2.textNodeName];
|
|
1414
|
+
o3 = 0 !== o3.length ? " " + o3 : "", s2 += n3 + `<${l2}${o3}${t3}?>`, r2 = true;
|
|
1415
|
+
continue;
|
|
1416
|
+
}
|
|
1417
|
+
let h2 = i2;
|
|
1418
|
+
"" !== h2 && (h2 += e2.indentBy);
|
|
1419
|
+
const d2 = i2 + `<${l2}${at(a2[":@"], e2)}`, c2 = rt(a2[l2], e2, u2, h2);
|
|
1420
|
+
-1 !== e2.unpairedTags.indexOf(l2) ? e2.suppressUnpairedNode ? s2 += d2 + ">" : s2 += d2 + "/>" : c2 && 0 !== c2.length || !e2.suppressEmptyNode ? c2 && c2.endsWith(">") ? s2 += d2 + `>${c2}${i2}</${l2}>` : (s2 += d2 + ">", c2 && "" !== i2 && (c2.includes("/>") || c2.includes("</")) ? s2 += i2 + e2.indentBy + c2 + i2 : s2 += c2, s2 += `</${l2}>`) : s2 += d2 + "/>", r2 = true;
|
|
1421
|
+
}
|
|
1422
|
+
return s2;
|
|
1423
|
+
}
|
|
1424
|
+
__name(rt, "rt");
|
|
1425
|
+
function ot(t2) {
|
|
1426
|
+
const e2 = Object.keys(t2);
|
|
1427
|
+
for (let n2 = 0; n2 < e2.length; n2++) {
|
|
1428
|
+
const i2 = e2[n2];
|
|
1429
|
+
if (t2.hasOwnProperty(i2) && ":@" !== i2) return i2;
|
|
1430
|
+
}
|
|
1431
|
+
}
|
|
1432
|
+
__name(ot, "ot");
|
|
1433
|
+
function at(t2, e2) {
|
|
1434
|
+
let n2 = "";
|
|
1435
|
+
if (t2 && !e2.ignoreAttributes) for (let i2 in t2) {
|
|
1436
|
+
if (!t2.hasOwnProperty(i2)) continue;
|
|
1437
|
+
let s2 = e2.attributeValueProcessor(i2, t2[i2]);
|
|
1438
|
+
s2 = ut(s2, e2), true === s2 && e2.suppressBooleanAttributes ? n2 += ` ${i2.substr(e2.attributeNamePrefix.length)}` : n2 += ` ${i2.substr(e2.attributeNamePrefix.length)}="${s2}"`;
|
|
1439
|
+
}
|
|
1440
|
+
return n2;
|
|
1441
|
+
}
|
|
1442
|
+
__name(at, "at");
|
|
1443
|
+
function lt(t2, e2) {
|
|
1444
|
+
let n2 = (t2 = t2.substr(0, t2.length - e2.textNodeName.length - 1)).substr(t2.lastIndexOf(".") + 1);
|
|
1445
|
+
for (let i2 in e2.stopNodes) if (e2.stopNodes[i2] === t2 || e2.stopNodes[i2] === "*." + n2) return true;
|
|
1446
|
+
return false;
|
|
2720
1447
|
}
|
|
2721
|
-
__name(
|
|
2722
|
-
(
|
|
2723
|
-
|
|
2724
|
-
|
|
2725
|
-
|
|
2726
|
-
|
|
2727
|
-
|
|
2728
|
-
|
|
2729
|
-
|
|
2730
|
-
|
|
2731
|
-
|
|
2732
|
-
|
|
2733
|
-
|
|
2734
|
-
(()
|
|
2735
|
-
|
|
2736
|
-
|
|
2737
|
-
|
|
2738
|
-
|
|
2739
|
-
|
|
2740
|
-
};
|
|
2741
|
-
}
|
|
2742
|
-
|
|
2743
|
-
|
|
1448
|
+
__name(lt, "lt");
|
|
1449
|
+
function ut(t2, e2) {
|
|
1450
|
+
if (t2 && t2.length > 0 && e2.processEntities) for (let n2 = 0; n2 < e2.entities.length; n2++) {
|
|
1451
|
+
const i2 = e2.entities[n2];
|
|
1452
|
+
t2 = t2.replace(i2.regex, i2.val);
|
|
1453
|
+
}
|
|
1454
|
+
return t2;
|
|
1455
|
+
}
|
|
1456
|
+
__name(ut, "ut");
|
|
1457
|
+
const ht = { attributeNamePrefix: "@_", attributesGroupName: false, textNodeName: "#text", ignoreAttributes: true, cdataPropName: false, format: false, indentBy: " ", suppressEmptyNode: false, suppressUnpairedNode: true, suppressBooleanAttributes: true, tagValueProcessor: /* @__PURE__ */ __name(function(t2, e2) {
|
|
1458
|
+
return e2;
|
|
1459
|
+
}, "tagValueProcessor"), attributeValueProcessor: /* @__PURE__ */ __name(function(t2, e2) {
|
|
1460
|
+
return e2;
|
|
1461
|
+
}, "attributeValueProcessor"), preserveOrder: false, commentPropName: false, unpairedTags: [], entities: [{ regex: new RegExp("&", "g"), val: "&" }, { regex: new RegExp(">", "g"), val: ">" }, { regex: new RegExp("<", "g"), val: "<" }, { regex: new RegExp("'", "g"), val: "'" }, { regex: new RegExp('"', "g"), val: """ }], processEntities: true, stopNodes: [], oneListGroup: false };
|
|
1462
|
+
function dt(t2) {
|
|
1463
|
+
this.options = Object.assign({}, ht, t2), true === this.options.ignoreAttributes || this.options.attributesGroupName ? this.isAttribute = function() {
|
|
1464
|
+
return false;
|
|
1465
|
+
} : (this.ignoreAttributesFn = _(this.options.ignoreAttributes), this.attrPrefixLen = this.options.attributeNamePrefix.length, this.isAttribute = ft), this.processTextOrObjNode = ct, this.options.format ? (this.indentate = pt, this.tagEndChar = ">\n", this.newLine = "\n") : (this.indentate = function() {
|
|
1466
|
+
return "";
|
|
1467
|
+
}, this.tagEndChar = ">", this.newLine = "");
|
|
1468
|
+
}
|
|
1469
|
+
__name(dt, "dt");
|
|
1470
|
+
function ct(t2, e2, n2, i2) {
|
|
1471
|
+
const s2 = this.j2x(t2, n2 + 1, i2.concat(e2));
|
|
1472
|
+
return void 0 !== t2[this.options.textNodeName] && 1 === Object.keys(t2).length ? this.buildTextValNode(t2[this.options.textNodeName], e2, s2.attrStr, n2) : this.buildObjectNode(s2.val, e2, s2.attrStr, n2);
|
|
1473
|
+
}
|
|
1474
|
+
__name(ct, "ct");
|
|
1475
|
+
function pt(t2) {
|
|
1476
|
+
return this.options.indentBy.repeat(t2);
|
|
1477
|
+
}
|
|
1478
|
+
__name(pt, "pt");
|
|
1479
|
+
function ft(t2) {
|
|
1480
|
+
return !(!t2.startsWith(this.options.attributeNamePrefix) || t2 === this.options.textNodeName) && t2.substr(this.attrPrefixLen);
|
|
1481
|
+
}
|
|
1482
|
+
__name(ft, "ft");
|
|
1483
|
+
dt.prototype.build = function(t2) {
|
|
1484
|
+
return this.options.preserveOrder ? st(t2, this.options) : (Array.isArray(t2) && this.options.arrayNodeName && this.options.arrayNodeName.length > 1 && (t2 = { [this.options.arrayNodeName]: t2 }), this.j2x(t2, 0, []).val);
|
|
1485
|
+
}, dt.prototype.j2x = function(t2, e2, n2) {
|
|
1486
|
+
let i2 = "", s2 = "";
|
|
1487
|
+
const r2 = n2.join(".");
|
|
1488
|
+
for (let o2 in t2) if (Object.prototype.hasOwnProperty.call(t2, o2)) if (void 0 === t2[o2]) this.isAttribute(o2) && (s2 += "");
|
|
1489
|
+
else if (null === t2[o2]) this.isAttribute(o2) || o2 === this.options.cdataPropName ? s2 += "" : "?" === o2[0] ? s2 += this.indentate(e2) + "<" + o2 + "?" + this.tagEndChar : s2 += this.indentate(e2) + "<" + o2 + "/" + this.tagEndChar;
|
|
1490
|
+
else if (t2[o2] instanceof Date) s2 += this.buildTextValNode(t2[o2], o2, "", e2);
|
|
1491
|
+
else if ("object" != typeof t2[o2]) {
|
|
1492
|
+
const n3 = this.isAttribute(o2);
|
|
1493
|
+
if (n3 && !this.ignoreAttributesFn(n3, r2)) i2 += this.buildAttrPairStr(n3, "" + t2[o2]);
|
|
1494
|
+
else if (!n3) if (o2 === this.options.textNodeName) {
|
|
1495
|
+
let e3 = this.options.tagValueProcessor(o2, "" + t2[o2]);
|
|
1496
|
+
s2 += this.replaceEntitiesValue(e3);
|
|
1497
|
+
} else s2 += this.buildTextValNode(t2[o2], o2, "", e2);
|
|
1498
|
+
} else if (Array.isArray(t2[o2])) {
|
|
1499
|
+
const i3 = t2[o2].length;
|
|
1500
|
+
let r3 = "", a2 = "";
|
|
1501
|
+
for (let l2 = 0; l2 < i3; l2++) {
|
|
1502
|
+
const i4 = t2[o2][l2];
|
|
1503
|
+
if (void 0 === i4) ;
|
|
1504
|
+
else if (null === i4) "?" === o2[0] ? s2 += this.indentate(e2) + "<" + o2 + "?" + this.tagEndChar : s2 += this.indentate(e2) + "<" + o2 + "/" + this.tagEndChar;
|
|
1505
|
+
else if ("object" == typeof i4) if (this.options.oneListGroup) {
|
|
1506
|
+
const t3 = this.j2x(i4, e2 + 1, n2.concat(o2));
|
|
1507
|
+
r3 += t3.val, this.options.attributesGroupName && i4.hasOwnProperty(this.options.attributesGroupName) && (a2 += t3.attrStr);
|
|
1508
|
+
} else r3 += this.processTextOrObjNode(i4, o2, e2, n2);
|
|
1509
|
+
else if (this.options.oneListGroup) {
|
|
1510
|
+
let t3 = this.options.tagValueProcessor(o2, i4);
|
|
1511
|
+
t3 = this.replaceEntitiesValue(t3), r3 += t3;
|
|
1512
|
+
} else r3 += this.buildTextValNode(i4, o2, "", e2);
|
|
1513
|
+
}
|
|
1514
|
+
this.options.oneListGroup && (r3 = this.buildObjectNode(r3, o2, a2, e2)), s2 += r3;
|
|
1515
|
+
} else if (this.options.attributesGroupName && o2 === this.options.attributesGroupName) {
|
|
1516
|
+
const e3 = Object.keys(t2[o2]), n3 = e3.length;
|
|
1517
|
+
for (let s3 = 0; s3 < n3; s3++) i2 += this.buildAttrPairStr(e3[s3], "" + t2[o2][e3[s3]]);
|
|
1518
|
+
} else s2 += this.processTextOrObjNode(t2[o2], o2, e2, n2);
|
|
1519
|
+
return { attrStr: i2, val: s2 };
|
|
1520
|
+
}, dt.prototype.buildAttrPairStr = function(t2, e2) {
|
|
1521
|
+
return e2 = this.options.attributeValueProcessor(t2, "" + e2), e2 = this.replaceEntitiesValue(e2), this.options.suppressBooleanAttributes && "true" === e2 ? " " + t2 : " " + t2 + '="' + e2 + '"';
|
|
1522
|
+
}, dt.prototype.buildObjectNode = function(t2, e2, n2, i2) {
|
|
1523
|
+
if ("" === t2) return "?" === e2[0] ? this.indentate(i2) + "<" + e2 + n2 + "?" + this.tagEndChar : this.indentate(i2) + "<" + e2 + n2 + this.closeTag(e2) + this.tagEndChar;
|
|
1524
|
+
{
|
|
1525
|
+
let s2 = "</" + e2 + this.tagEndChar, r2 = "";
|
|
1526
|
+
return "?" === e2[0] && (r2 = "?", s2 = ""), !n2 && "" !== n2 || -1 !== t2.indexOf("<") ? false !== this.options.commentPropName && e2 === this.options.commentPropName && 0 === r2.length ? this.indentate(i2) + `<!--${t2}-->` + this.newLine : this.indentate(i2) + "<" + e2 + n2 + r2 + this.tagEndChar + t2 + this.indentate(i2) + s2 : this.indentate(i2) + "<" + e2 + n2 + r2 + ">" + t2 + s2;
|
|
1527
|
+
}
|
|
1528
|
+
}, dt.prototype.closeTag = function(t2) {
|
|
1529
|
+
let e2 = "";
|
|
1530
|
+
return -1 !== this.options.unpairedTags.indexOf(t2) ? this.options.suppressUnpairedNode || (e2 = "/") : e2 = this.options.suppressEmptyNode ? "/" : `></${t2}`, e2;
|
|
1531
|
+
}, dt.prototype.buildTextValNode = function(t2, e2, n2, i2) {
|
|
1532
|
+
if (false !== this.options.cdataPropName && e2 === this.options.cdataPropName) return this.indentate(i2) + `<![CDATA[${t2}]]>` + this.newLine;
|
|
1533
|
+
if (false !== this.options.commentPropName && e2 === this.options.commentPropName) return this.indentate(i2) + `<!--${t2}-->` + this.newLine;
|
|
1534
|
+
if ("?" === e2[0]) return this.indentate(i2) + "<" + e2 + n2 + "?" + this.tagEndChar;
|
|
1535
|
+
{
|
|
1536
|
+
let s2 = this.options.tagValueProcessor(e2, t2);
|
|
1537
|
+
return s2 = this.replaceEntitiesValue(s2), "" === s2 ? this.indentate(i2) + "<" + e2 + n2 + this.closeTag(e2) + this.tagEndChar : this.indentate(i2) + "<" + e2 + n2 + ">" + s2 + "</" + e2 + this.tagEndChar;
|
|
1538
|
+
}
|
|
1539
|
+
}, dt.prototype.replaceEntitiesValue = function(t2) {
|
|
1540
|
+
if (t2 && t2.length > 0 && this.options.processEntities) for (let e2 = 0; e2 < this.options.entities.length; e2++) {
|
|
1541
|
+
const n2 = this.options.entities[e2];
|
|
1542
|
+
t2 = t2.replace(n2.regex, n2.val);
|
|
1543
|
+
}
|
|
1544
|
+
return t2;
|
|
1545
|
+
};
|
|
1546
|
+
const gt = { validate: a };
|
|
1547
|
+
module.exports = e;
|
|
2744
1548
|
})();
|
|
2745
1549
|
}
|
|
2746
1550
|
});
|
|
2747
1551
|
|
|
2748
1552
|
// ../../node_modules/.store/@azure-core-xml-npm-1.4.5-aa0a69dac5/package/dist/commonjs/xml.common.js
|
|
2749
1553
|
var require_xml_common = __commonJS({
|
|
2750
|
-
"../../node_modules/.store/@azure-core-xml-npm-1.4.5-aa0a69dac5/package/dist/commonjs/xml.common.js"(
|
|
1554
|
+
"../../node_modules/.store/@azure-core-xml-npm-1.4.5-aa0a69dac5/package/dist/commonjs/xml.common.js"(exports) {
|
|
2751
1555
|
"use strict";
|
|
2752
|
-
Object.defineProperty(
|
|
2753
|
-
|
|
2754
|
-
|
|
2755
|
-
|
|
1556
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1557
|
+
exports.XML_CHARKEY = exports.XML_ATTRKEY = void 0;
|
|
1558
|
+
exports.XML_ATTRKEY = "$";
|
|
1559
|
+
exports.XML_CHARKEY = "_";
|
|
2756
1560
|
}
|
|
2757
1561
|
});
|
|
2758
1562
|
|
|
2759
1563
|
// ../../node_modules/.store/@azure-core-xml-npm-1.4.5-aa0a69dac5/package/dist/commonjs/xml.js
|
|
2760
1564
|
var require_xml = __commonJS({
|
|
2761
|
-
"../../node_modules/.store/@azure-core-xml-npm-1.4.5-aa0a69dac5/package/dist/commonjs/xml.js"(
|
|
1565
|
+
"../../node_modules/.store/@azure-core-xml-npm-1.4.5-aa0a69dac5/package/dist/commonjs/xml.js"(exports) {
|
|
2762
1566
|
"use strict";
|
|
2763
|
-
Object.defineProperty(
|
|
2764
|
-
|
|
2765
|
-
|
|
1567
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1568
|
+
exports.stringifyXML = stringifyXML;
|
|
1569
|
+
exports.parseXML = parseXML;
|
|
2766
1570
|
var fast_xml_parser_1 = require_fxp();
|
|
2767
1571
|
var xml_common_js_1 = require_xml_common();
|
|
2768
1572
|
function getCommonOptions(options) {
|
|
@@ -2819,22 +1623,22 @@ var require_xml = __commonJS({
|
|
|
2819
1623
|
|
|
2820
1624
|
// ../../node_modules/.store/@azure-core-xml-npm-1.4.5-aa0a69dac5/package/dist/commonjs/index.js
|
|
2821
1625
|
var require_commonjs9 = __commonJS({
|
|
2822
|
-
"../../node_modules/.store/@azure-core-xml-npm-1.4.5-aa0a69dac5/package/dist/commonjs/index.js"(
|
|
1626
|
+
"../../node_modules/.store/@azure-core-xml-npm-1.4.5-aa0a69dac5/package/dist/commonjs/index.js"(exports) {
|
|
2823
1627
|
"use strict";
|
|
2824
|
-
Object.defineProperty(
|
|
2825
|
-
|
|
1628
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1629
|
+
exports.XML_CHARKEY = exports.XML_ATTRKEY = exports.parseXML = exports.stringifyXML = void 0;
|
|
2826
1630
|
var xml_js_1 = require_xml();
|
|
2827
|
-
Object.defineProperty(
|
|
1631
|
+
Object.defineProperty(exports, "stringifyXML", { enumerable: true, get: /* @__PURE__ */ __name(function() {
|
|
2828
1632
|
return xml_js_1.stringifyXML;
|
|
2829
1633
|
}, "get") });
|
|
2830
|
-
Object.defineProperty(
|
|
1634
|
+
Object.defineProperty(exports, "parseXML", { enumerable: true, get: /* @__PURE__ */ __name(function() {
|
|
2831
1635
|
return xml_js_1.parseXML;
|
|
2832
1636
|
}, "get") });
|
|
2833
1637
|
var xml_common_js_1 = require_xml_common();
|
|
2834
|
-
Object.defineProperty(
|
|
1638
|
+
Object.defineProperty(exports, "XML_ATTRKEY", { enumerable: true, get: /* @__PURE__ */ __name(function() {
|
|
2835
1639
|
return xml_common_js_1.XML_ATTRKEY;
|
|
2836
1640
|
}, "get") });
|
|
2837
|
-
Object.defineProperty(
|
|
1641
|
+
Object.defineProperty(exports, "XML_CHARKEY", { enumerable: true, get: /* @__PURE__ */ __name(function() {
|
|
2838
1642
|
return xml_common_js_1.XML_CHARKEY;
|
|
2839
1643
|
}, "get") });
|
|
2840
1644
|
}
|
|
@@ -2842,32 +1646,32 @@ var require_commonjs9 = __commonJS({
|
|
|
2842
1646
|
|
|
2843
1647
|
// ../../node_modules/.store/@azure-core-lro-npm-2.7.2-8c7fa05bf6/package/dist/commonjs/logger.js
|
|
2844
1648
|
var require_logger = __commonJS({
|
|
2845
|
-
"../../node_modules/.store/@azure-core-lro-npm-2.7.2-8c7fa05bf6/package/dist/commonjs/logger.js"(
|
|
1649
|
+
"../../node_modules/.store/@azure-core-lro-npm-2.7.2-8c7fa05bf6/package/dist/commonjs/logger.js"(exports) {
|
|
2846
1650
|
"use strict";
|
|
2847
|
-
Object.defineProperty(
|
|
2848
|
-
|
|
1651
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1652
|
+
exports.logger = void 0;
|
|
2849
1653
|
var logger_1 = require_commonjs();
|
|
2850
|
-
|
|
1654
|
+
exports.logger = (0, logger_1.createClientLogger)("core-lro");
|
|
2851
1655
|
}
|
|
2852
1656
|
});
|
|
2853
1657
|
|
|
2854
1658
|
// ../../node_modules/.store/@azure-core-lro-npm-2.7.2-8c7fa05bf6/package/dist/commonjs/poller/constants.js
|
|
2855
1659
|
var require_constants = __commonJS({
|
|
2856
|
-
"../../node_modules/.store/@azure-core-lro-npm-2.7.2-8c7fa05bf6/package/dist/commonjs/poller/constants.js"(
|
|
1660
|
+
"../../node_modules/.store/@azure-core-lro-npm-2.7.2-8c7fa05bf6/package/dist/commonjs/poller/constants.js"(exports) {
|
|
2857
1661
|
"use strict";
|
|
2858
|
-
Object.defineProperty(
|
|
2859
|
-
|
|
2860
|
-
|
|
2861
|
-
|
|
1662
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1663
|
+
exports.terminalStates = exports.POLL_INTERVAL_IN_MS = void 0;
|
|
1664
|
+
exports.POLL_INTERVAL_IN_MS = 2e3;
|
|
1665
|
+
exports.terminalStates = ["succeeded", "canceled", "failed"];
|
|
2862
1666
|
}
|
|
2863
1667
|
});
|
|
2864
1668
|
|
|
2865
1669
|
// ../../node_modules/.store/@azure-core-lro-npm-2.7.2-8c7fa05bf6/package/dist/commonjs/poller/operation.js
|
|
2866
1670
|
var require_operation = __commonJS({
|
|
2867
|
-
"../../node_modules/.store/@azure-core-lro-npm-2.7.2-8c7fa05bf6/package/dist/commonjs/poller/operation.js"(
|
|
1671
|
+
"../../node_modules/.store/@azure-core-lro-npm-2.7.2-8c7fa05bf6/package/dist/commonjs/poller/operation.js"(exports) {
|
|
2868
1672
|
"use strict";
|
|
2869
|
-
Object.defineProperty(
|
|
2870
|
-
|
|
1673
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1674
|
+
exports.pollOperation = exports.initOperation = exports.deserializeState = void 0;
|
|
2871
1675
|
var logger_js_1 = require_logger();
|
|
2872
1676
|
var constants_js_1 = require_constants();
|
|
2873
1677
|
function deserializeState(serializedState) {
|
|
@@ -2878,7 +1682,7 @@ var require_operation = __commonJS({
|
|
|
2878
1682
|
}
|
|
2879
1683
|
}
|
|
2880
1684
|
__name(deserializeState, "deserializeState");
|
|
2881
|
-
|
|
1685
|
+
exports.deserializeState = deserializeState;
|
|
2882
1686
|
function setStateError(inputs) {
|
|
2883
1687
|
const { state, stateProxy, isOperationError } = inputs;
|
|
2884
1688
|
return (error) => {
|
|
@@ -2969,7 +1773,7 @@ var require_operation = __commonJS({
|
|
|
2969
1773
|
return state;
|
|
2970
1774
|
}
|
|
2971
1775
|
__name(initOperation, "initOperation");
|
|
2972
|
-
|
|
1776
|
+
exports.initOperation = initOperation;
|
|
2973
1777
|
async function pollOperationHelper(inputs) {
|
|
2974
1778
|
const { poll, state, stateProxy, operationLocation, getOperationStatus, getResourceLocation, isOperationError, options } = inputs;
|
|
2975
1779
|
const response = await poll(operationLocation, options).catch(setStateError({
|
|
@@ -3034,16 +1838,16 @@ var require_operation = __commonJS({
|
|
|
3034
1838
|
}
|
|
3035
1839
|
}
|
|
3036
1840
|
__name(pollOperation, "pollOperation");
|
|
3037
|
-
|
|
1841
|
+
exports.pollOperation = pollOperation;
|
|
3038
1842
|
}
|
|
3039
1843
|
});
|
|
3040
1844
|
|
|
3041
1845
|
// ../../node_modules/.store/@azure-core-lro-npm-2.7.2-8c7fa05bf6/package/dist/commonjs/http/operation.js
|
|
3042
1846
|
var require_operation2 = __commonJS({
|
|
3043
|
-
"../../node_modules/.store/@azure-core-lro-npm-2.7.2-8c7fa05bf6/package/dist/commonjs/http/operation.js"(
|
|
1847
|
+
"../../node_modules/.store/@azure-core-lro-npm-2.7.2-8c7fa05bf6/package/dist/commonjs/http/operation.js"(exports) {
|
|
3044
1848
|
"use strict";
|
|
3045
|
-
Object.defineProperty(
|
|
3046
|
-
|
|
1849
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1850
|
+
exports.pollHttpOperation = exports.isOperationError = exports.getResourceLocation = exports.getOperationStatus = exports.getOperationLocation = exports.initHttpOperation = exports.getStatusFromInitialResponse = exports.getErrorFromResponse = exports.parseRetryAfter = exports.inferLroMode = void 0;
|
|
3047
1851
|
var operation_js_1 = require_operation();
|
|
3048
1852
|
var logger_js_1 = require_logger();
|
|
3049
1853
|
function getOperationLocationPollingUrl(inputs) {
|
|
@@ -3130,7 +1934,7 @@ var require_operation2 = __commonJS({
|
|
|
3130
1934
|
}
|
|
3131
1935
|
}
|
|
3132
1936
|
__name(inferLroMode, "inferLroMode");
|
|
3133
|
-
|
|
1937
|
+
exports.inferLroMode = inferLroMode;
|
|
3134
1938
|
function transformStatus(inputs) {
|
|
3135
1939
|
const { status, statusCode } = inputs;
|
|
3136
1940
|
if (typeof status !== "string" && status !== void 0) {
|
|
@@ -3191,7 +1995,7 @@ var require_operation2 = __commonJS({
|
|
|
3191
1995
|
return void 0;
|
|
3192
1996
|
}
|
|
3193
1997
|
__name(parseRetryAfter, "parseRetryAfter");
|
|
3194
|
-
|
|
1998
|
+
exports.parseRetryAfter = parseRetryAfter;
|
|
3195
1999
|
function getErrorFromResponse(response) {
|
|
3196
2000
|
const error = accessBodyProperty(response, "error");
|
|
3197
2001
|
if (!error) {
|
|
@@ -3205,7 +2009,7 @@ var require_operation2 = __commonJS({
|
|
|
3205
2009
|
return error;
|
|
3206
2010
|
}
|
|
3207
2011
|
__name(getErrorFromResponse, "getErrorFromResponse");
|
|
3208
|
-
|
|
2012
|
+
exports.getErrorFromResponse = getErrorFromResponse;
|
|
3209
2013
|
function calculatePollingIntervalFromDate(retryAfterDate) {
|
|
3210
2014
|
const timeNow = Math.floor((/* @__PURE__ */ new Date()).getTime());
|
|
3211
2015
|
const retryAfterTime = retryAfterDate.getTime();
|
|
@@ -3234,7 +2038,7 @@ var require_operation2 = __commonJS({
|
|
|
3234
2038
|
return status === "running" && operationLocation === void 0 ? "succeeded" : status;
|
|
3235
2039
|
}
|
|
3236
2040
|
__name(getStatusFromInitialResponse, "getStatusFromInitialResponse");
|
|
3237
|
-
|
|
2041
|
+
exports.getStatusFromInitialResponse = getStatusFromInitialResponse;
|
|
3238
2042
|
async function initHttpOperation(inputs) {
|
|
3239
2043
|
const { stateProxy, resourceLocationConfig, processResult, lro, setErrorAsResult } = inputs;
|
|
3240
2044
|
return (0, operation_js_1.initOperation)({
|
|
@@ -3255,7 +2059,7 @@ var require_operation2 = __commonJS({
|
|
|
3255
2059
|
});
|
|
3256
2060
|
}
|
|
3257
2061
|
__name(initHttpOperation, "initHttpOperation");
|
|
3258
|
-
|
|
2062
|
+
exports.initHttpOperation = initHttpOperation;
|
|
3259
2063
|
function getOperationLocation({ rawResponse }, state) {
|
|
3260
2064
|
var _a;
|
|
3261
2065
|
const mode = (_a = state.config.metadata) === null || _a === void 0 ? void 0 : _a["mode"];
|
|
@@ -3276,7 +2080,7 @@ var require_operation2 = __commonJS({
|
|
|
3276
2080
|
}
|
|
3277
2081
|
}
|
|
3278
2082
|
__name(getOperationLocation, "getOperationLocation");
|
|
3279
|
-
|
|
2083
|
+
exports.getOperationLocation = getOperationLocation;
|
|
3280
2084
|
function getOperationStatus({ rawResponse }, state) {
|
|
3281
2085
|
var _a;
|
|
3282
2086
|
const mode = (_a = state.config.metadata) === null || _a === void 0 ? void 0 : _a["mode"];
|
|
@@ -3295,7 +2099,7 @@ var require_operation2 = __commonJS({
|
|
|
3295
2099
|
}
|
|
3296
2100
|
}
|
|
3297
2101
|
__name(getOperationStatus, "getOperationStatus");
|
|
3298
|
-
|
|
2102
|
+
exports.getOperationStatus = getOperationStatus;
|
|
3299
2103
|
function accessBodyProperty({ flatResponse, rawResponse }, prop) {
|
|
3300
2104
|
var _a, _b;
|
|
3301
2105
|
return (_a = flatResponse === null || flatResponse === void 0 ? void 0 : flatResponse[prop]) !== null && _a !== void 0 ? _a : (_b = rawResponse.body) === null || _b === void 0 ? void 0 : _b[prop];
|
|
@@ -3309,12 +2113,12 @@ var require_operation2 = __commonJS({
|
|
|
3309
2113
|
return state.config.resourceLocation;
|
|
3310
2114
|
}
|
|
3311
2115
|
__name(getResourceLocation, "getResourceLocation");
|
|
3312
|
-
|
|
2116
|
+
exports.getResourceLocation = getResourceLocation;
|
|
3313
2117
|
function isOperationError(e) {
|
|
3314
2118
|
return e.name === "RestError";
|
|
3315
2119
|
}
|
|
3316
2120
|
__name(isOperationError, "isOperationError");
|
|
3317
|
-
|
|
2121
|
+
exports.isOperationError = isOperationError;
|
|
3318
2122
|
async function pollHttpOperation(inputs) {
|
|
3319
2123
|
const { lro, stateProxy, options, processResult, updateState, setDelay, state, setErrorAsResult } = inputs;
|
|
3320
2124
|
return (0, operation_js_1.pollOperation)({
|
|
@@ -3339,16 +2143,16 @@ var require_operation2 = __commonJS({
|
|
|
3339
2143
|
});
|
|
3340
2144
|
}
|
|
3341
2145
|
__name(pollHttpOperation, "pollHttpOperation");
|
|
3342
|
-
|
|
2146
|
+
exports.pollHttpOperation = pollHttpOperation;
|
|
3343
2147
|
}
|
|
3344
2148
|
});
|
|
3345
2149
|
|
|
3346
2150
|
// ../../node_modules/.store/@azure-core-lro-npm-2.7.2-8c7fa05bf6/package/dist/commonjs/poller/poller.js
|
|
3347
2151
|
var require_poller = __commonJS({
|
|
3348
|
-
"../../node_modules/.store/@azure-core-lro-npm-2.7.2-8c7fa05bf6/package/dist/commonjs/poller/poller.js"(
|
|
2152
|
+
"../../node_modules/.store/@azure-core-lro-npm-2.7.2-8c7fa05bf6/package/dist/commonjs/poller/poller.js"(exports) {
|
|
3349
2153
|
"use strict";
|
|
3350
|
-
Object.defineProperty(
|
|
3351
|
-
|
|
2154
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2155
|
+
exports.buildCreatePoller = void 0;
|
|
3352
2156
|
var operation_js_1 = require_operation();
|
|
3353
2157
|
var constants_js_1 = require_constants();
|
|
3354
2158
|
var core_util_1 = require_commonjs3();
|
|
@@ -3506,16 +2310,16 @@ var require_poller = __commonJS({
|
|
|
3506
2310
|
};
|
|
3507
2311
|
}
|
|
3508
2312
|
__name(buildCreatePoller, "buildCreatePoller");
|
|
3509
|
-
|
|
2313
|
+
exports.buildCreatePoller = buildCreatePoller;
|
|
3510
2314
|
}
|
|
3511
2315
|
});
|
|
3512
2316
|
|
|
3513
2317
|
// ../../node_modules/.store/@azure-core-lro-npm-2.7.2-8c7fa05bf6/package/dist/commonjs/http/poller.js
|
|
3514
2318
|
var require_poller2 = __commonJS({
|
|
3515
|
-
"../../node_modules/.store/@azure-core-lro-npm-2.7.2-8c7fa05bf6/package/dist/commonjs/http/poller.js"(
|
|
2319
|
+
"../../node_modules/.store/@azure-core-lro-npm-2.7.2-8c7fa05bf6/package/dist/commonjs/http/poller.js"(exports) {
|
|
3516
2320
|
"use strict";
|
|
3517
|
-
Object.defineProperty(
|
|
3518
|
-
|
|
2321
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2322
|
+
exports.createHttpPoller = void 0;
|
|
3519
2323
|
var operation_js_1 = require_operation2();
|
|
3520
2324
|
var poller_js_1 = require_poller();
|
|
3521
2325
|
async function createHttpPoller(lro, options) {
|
|
@@ -3550,16 +2354,16 @@ var require_poller2 = __commonJS({
|
|
|
3550
2354
|
});
|
|
3551
2355
|
}
|
|
3552
2356
|
__name(createHttpPoller, "createHttpPoller");
|
|
3553
|
-
|
|
2357
|
+
exports.createHttpPoller = createHttpPoller;
|
|
3554
2358
|
}
|
|
3555
2359
|
});
|
|
3556
2360
|
|
|
3557
2361
|
// ../../node_modules/.store/@azure-core-lro-npm-2.7.2-8c7fa05bf6/package/dist/commonjs/legacy/lroEngine/operation.js
|
|
3558
2362
|
var require_operation3 = __commonJS({
|
|
3559
|
-
"../../node_modules/.store/@azure-core-lro-npm-2.7.2-8c7fa05bf6/package/dist/commonjs/legacy/lroEngine/operation.js"(
|
|
2363
|
+
"../../node_modules/.store/@azure-core-lro-npm-2.7.2-8c7fa05bf6/package/dist/commonjs/legacy/lroEngine/operation.js"(exports) {
|
|
3560
2364
|
"use strict";
|
|
3561
|
-
Object.defineProperty(
|
|
3562
|
-
|
|
2365
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2366
|
+
exports.GenericPollOperation = void 0;
|
|
3563
2367
|
var operation_js_1 = require_operation2();
|
|
3564
2368
|
var logger_js_1 = require_logger();
|
|
3565
2369
|
var createStateProxy = /* @__PURE__ */ __name(() => ({
|
|
@@ -3638,16 +2442,16 @@ var require_operation3 = __commonJS({
|
|
|
3638
2442
|
};
|
|
3639
2443
|
__name(_GenericPollOperation, "GenericPollOperation");
|
|
3640
2444
|
var GenericPollOperation = _GenericPollOperation;
|
|
3641
|
-
|
|
2445
|
+
exports.GenericPollOperation = GenericPollOperation;
|
|
3642
2446
|
}
|
|
3643
2447
|
});
|
|
3644
2448
|
|
|
3645
2449
|
// ../../node_modules/.store/@azure-core-lro-npm-2.7.2-8c7fa05bf6/package/dist/commonjs/legacy/poller.js
|
|
3646
2450
|
var require_poller3 = __commonJS({
|
|
3647
|
-
"../../node_modules/.store/@azure-core-lro-npm-2.7.2-8c7fa05bf6/package/dist/commonjs/legacy/poller.js"(
|
|
2451
|
+
"../../node_modules/.store/@azure-core-lro-npm-2.7.2-8c7fa05bf6/package/dist/commonjs/legacy/poller.js"(exports) {
|
|
3648
2452
|
"use strict";
|
|
3649
|
-
Object.defineProperty(
|
|
3650
|
-
|
|
2453
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2454
|
+
exports.Poller = exports.PollerCancelledError = exports.PollerStoppedError = void 0;
|
|
3651
2455
|
var _PollerStoppedError = class _PollerStoppedError extends Error {
|
|
3652
2456
|
constructor(message) {
|
|
3653
2457
|
super(message);
|
|
@@ -3657,7 +2461,7 @@ var require_poller3 = __commonJS({
|
|
|
3657
2461
|
};
|
|
3658
2462
|
__name(_PollerStoppedError, "PollerStoppedError");
|
|
3659
2463
|
var PollerStoppedError = _PollerStoppedError;
|
|
3660
|
-
|
|
2464
|
+
exports.PollerStoppedError = PollerStoppedError;
|
|
3661
2465
|
var _PollerCancelledError = class _PollerCancelledError extends Error {
|
|
3662
2466
|
constructor(message) {
|
|
3663
2467
|
super(message);
|
|
@@ -3667,7 +2471,7 @@ var require_poller3 = __commonJS({
|
|
|
3667
2471
|
};
|
|
3668
2472
|
__name(_PollerCancelledError, "PollerCancelledError");
|
|
3669
2473
|
var PollerCancelledError = _PollerCancelledError;
|
|
3670
|
-
|
|
2474
|
+
exports.PollerCancelledError = PollerCancelledError;
|
|
3671
2475
|
var _Poller = class _Poller {
|
|
3672
2476
|
/**
|
|
3673
2477
|
* A poller needs to be initialized by passing in at least the basic properties of the `PollOperation<TState, TResult>`.
|
|
@@ -3967,16 +2771,16 @@ var require_poller3 = __commonJS({
|
|
|
3967
2771
|
};
|
|
3968
2772
|
__name(_Poller, "Poller");
|
|
3969
2773
|
var Poller = _Poller;
|
|
3970
|
-
|
|
2774
|
+
exports.Poller = Poller;
|
|
3971
2775
|
}
|
|
3972
2776
|
});
|
|
3973
2777
|
|
|
3974
2778
|
// ../../node_modules/.store/@azure-core-lro-npm-2.7.2-8c7fa05bf6/package/dist/commonjs/legacy/lroEngine/lroEngine.js
|
|
3975
2779
|
var require_lroEngine = __commonJS({
|
|
3976
|
-
"../../node_modules/.store/@azure-core-lro-npm-2.7.2-8c7fa05bf6/package/dist/commonjs/legacy/lroEngine/lroEngine.js"(
|
|
2780
|
+
"../../node_modules/.store/@azure-core-lro-npm-2.7.2-8c7fa05bf6/package/dist/commonjs/legacy/lroEngine/lroEngine.js"(exports) {
|
|
3977
2781
|
"use strict";
|
|
3978
|
-
Object.defineProperty(
|
|
3979
|
-
|
|
2782
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2783
|
+
exports.LroEngine = void 0;
|
|
3980
2784
|
var operation_js_1 = require_operation3();
|
|
3981
2785
|
var constants_js_1 = require_constants();
|
|
3982
2786
|
var poller_js_1 = require_poller3();
|
|
@@ -4000,18 +2804,18 @@ var require_lroEngine = __commonJS({
|
|
|
4000
2804
|
};
|
|
4001
2805
|
__name(_LroEngine, "LroEngine");
|
|
4002
2806
|
var LroEngine = _LroEngine;
|
|
4003
|
-
|
|
2807
|
+
exports.LroEngine = LroEngine;
|
|
4004
2808
|
}
|
|
4005
2809
|
});
|
|
4006
2810
|
|
|
4007
2811
|
// ../../node_modules/.store/@azure-core-lro-npm-2.7.2-8c7fa05bf6/package/dist/commonjs/legacy/lroEngine/index.js
|
|
4008
2812
|
var require_lroEngine2 = __commonJS({
|
|
4009
|
-
"../../node_modules/.store/@azure-core-lro-npm-2.7.2-8c7fa05bf6/package/dist/commonjs/legacy/lroEngine/index.js"(
|
|
2813
|
+
"../../node_modules/.store/@azure-core-lro-npm-2.7.2-8c7fa05bf6/package/dist/commonjs/legacy/lroEngine/index.js"(exports) {
|
|
4010
2814
|
"use strict";
|
|
4011
|
-
Object.defineProperty(
|
|
4012
|
-
|
|
2815
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2816
|
+
exports.LroEngine = void 0;
|
|
4013
2817
|
var lroEngine_js_1 = require_lroEngine();
|
|
4014
|
-
Object.defineProperty(
|
|
2818
|
+
Object.defineProperty(exports, "LroEngine", { enumerable: true, get: /* @__PURE__ */ __name(function() {
|
|
4015
2819
|
return lroEngine_js_1.LroEngine;
|
|
4016
2820
|
}, "get") });
|
|
4017
2821
|
}
|
|
@@ -4019,34 +2823,34 @@ var require_lroEngine2 = __commonJS({
|
|
|
4019
2823
|
|
|
4020
2824
|
// ../../node_modules/.store/@azure-core-lro-npm-2.7.2-8c7fa05bf6/package/dist/commonjs/legacy/pollOperation.js
|
|
4021
2825
|
var require_pollOperation = __commonJS({
|
|
4022
|
-
"../../node_modules/.store/@azure-core-lro-npm-2.7.2-8c7fa05bf6/package/dist/commonjs/legacy/pollOperation.js"(
|
|
2826
|
+
"../../node_modules/.store/@azure-core-lro-npm-2.7.2-8c7fa05bf6/package/dist/commonjs/legacy/pollOperation.js"(exports) {
|
|
4023
2827
|
"use strict";
|
|
4024
|
-
Object.defineProperty(
|
|
2828
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4025
2829
|
}
|
|
4026
2830
|
});
|
|
4027
2831
|
|
|
4028
2832
|
// ../../node_modules/.store/@azure-core-lro-npm-2.7.2-8c7fa05bf6/package/dist/commonjs/index.js
|
|
4029
2833
|
var require_commonjs10 = __commonJS({
|
|
4030
|
-
"../../node_modules/.store/@azure-core-lro-npm-2.7.2-8c7fa05bf6/package/dist/commonjs/index.js"(
|
|
2834
|
+
"../../node_modules/.store/@azure-core-lro-npm-2.7.2-8c7fa05bf6/package/dist/commonjs/index.js"(exports) {
|
|
4031
2835
|
"use strict";
|
|
4032
|
-
Object.defineProperty(
|
|
4033
|
-
|
|
2836
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2837
|
+
exports.createHttpPoller = void 0;
|
|
4034
2838
|
var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
|
|
4035
2839
|
var poller_js_1 = require_poller2();
|
|
4036
|
-
Object.defineProperty(
|
|
2840
|
+
Object.defineProperty(exports, "createHttpPoller", { enumerable: true, get: /* @__PURE__ */ __name(function() {
|
|
4037
2841
|
return poller_js_1.createHttpPoller;
|
|
4038
2842
|
}, "get") });
|
|
4039
|
-
tslib_1.__exportStar(require_lroEngine2(),
|
|
4040
|
-
tslib_1.__exportStar(require_poller3(),
|
|
4041
|
-
tslib_1.__exportStar(require_pollOperation(),
|
|
2843
|
+
tslib_1.__exportStar(require_lroEngine2(), exports);
|
|
2844
|
+
tslib_1.__exportStar(require_poller3(), exports);
|
|
2845
|
+
tslib_1.__exportStar(require_pollOperation(), exports);
|
|
4042
2846
|
}
|
|
4043
2847
|
});
|
|
4044
2848
|
|
|
4045
2849
|
// ../../node_modules/.store/@azure-storage-blob-npm-12.27.0-f292814f19/package/dist/index.js
|
|
4046
2850
|
var require_dist = __commonJS({
|
|
4047
|
-
"../../node_modules/.store/@azure-storage-blob-npm-12.27.0-f292814f19/package/dist/index.js"(
|
|
2851
|
+
"../../node_modules/.store/@azure-storage-blob-npm-12.27.0-f292814f19/package/dist/index.js"(exports) {
|
|
4048
2852
|
"use strict";
|
|
4049
|
-
Object.defineProperty(
|
|
2853
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4050
2854
|
var coreRestPipeline = require_commonjs5();
|
|
4051
2855
|
var tslib = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
|
|
4052
2856
|
var coreAuth = require_commonjs7();
|
|
@@ -4823,16 +3627,16 @@ var require_dist = __commonJS({
|
|
|
4823
3627
|
throw new TypeError(`Unexpected response object ${response}`);
|
|
4824
3628
|
}
|
|
4825
3629
|
__name(assertResponse, "assertResponse");
|
|
4826
|
-
|
|
3630
|
+
exports.StorageRetryPolicyType = void 0;
|
|
4827
3631
|
(function(StorageRetryPolicyType2) {
|
|
4828
3632
|
StorageRetryPolicyType2[StorageRetryPolicyType2["EXPONENTIAL"] = 0] = "EXPONENTIAL";
|
|
4829
3633
|
StorageRetryPolicyType2[StorageRetryPolicyType2["FIXED"] = 1] = "FIXED";
|
|
4830
|
-
})(
|
|
3634
|
+
})(exports.StorageRetryPolicyType || (exports.StorageRetryPolicyType = {}));
|
|
4831
3635
|
var DEFAULT_RETRY_OPTIONS$1 = {
|
|
4832
3636
|
maxRetryDelayInMs: 120 * 1e3,
|
|
4833
3637
|
maxTries: 4,
|
|
4834
3638
|
retryDelayInMs: 4 * 1e3,
|
|
4835
|
-
retryPolicyType:
|
|
3639
|
+
retryPolicyType: exports.StorageRetryPolicyType.EXPONENTIAL,
|
|
4836
3640
|
secondaryHost: "",
|
|
4837
3641
|
tryTimeoutInMs: void 0
|
|
4838
3642
|
// Use server side default timeout strategy
|
|
@@ -4962,10 +3766,10 @@ var require_dist = __commonJS({
|
|
|
4962
3766
|
let delayTimeInMs = 0;
|
|
4963
3767
|
if (isPrimaryRetry) {
|
|
4964
3768
|
switch (this.retryOptions.retryPolicyType) {
|
|
4965
|
-
case
|
|
3769
|
+
case exports.StorageRetryPolicyType.EXPONENTIAL:
|
|
4966
3770
|
delayTimeInMs = Math.min((Math.pow(2, attempt - 1) - 1) * this.retryOptions.retryDelayInMs, this.retryOptions.maxRetryDelayInMs);
|
|
4967
3771
|
break;
|
|
4968
|
-
case
|
|
3772
|
+
case exports.StorageRetryPolicyType.FIXED:
|
|
4969
3773
|
delayTimeInMs = this.retryOptions.retryDelayInMs;
|
|
4970
3774
|
break;
|
|
4971
3775
|
}
|
|
@@ -19642,11 +18446,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`;
|
|
|
19642
18446
|
return ipRange.end ? `${ipRange.start}-${ipRange.end}` : ipRange.start;
|
|
19643
18447
|
}
|
|
19644
18448
|
__name(ipRangeToString, "ipRangeToString");
|
|
19645
|
-
|
|
18449
|
+
exports.SASProtocol = void 0;
|
|
19646
18450
|
(function(SASProtocol) {
|
|
19647
18451
|
SASProtocol["Https"] = "https";
|
|
19648
18452
|
SASProtocol["HttpsAndHttp"] = "https,http";
|
|
19649
|
-
})(
|
|
18453
|
+
})(exports.SASProtocol || (exports.SASProtocol = {}));
|
|
19650
18454
|
var _SASQueryParameters = class _SASQueryParameters {
|
|
19651
18455
|
/**
|
|
19652
18456
|
* Optional. IP range allowed for this SAS.
|
|
@@ -21929,14 +20733,14 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`;
|
|
|
21929
20733
|
};
|
|
21930
20734
|
__name(_BlobQueryResponse, "BlobQueryResponse");
|
|
21931
20735
|
var BlobQueryResponse = _BlobQueryResponse;
|
|
21932
|
-
|
|
20736
|
+
exports.BlockBlobTier = void 0;
|
|
21933
20737
|
(function(BlockBlobTier) {
|
|
21934
20738
|
BlockBlobTier["Hot"] = "Hot";
|
|
21935
20739
|
BlockBlobTier["Cool"] = "Cool";
|
|
21936
20740
|
BlockBlobTier["Cold"] = "Cold";
|
|
21937
20741
|
BlockBlobTier["Archive"] = "Archive";
|
|
21938
|
-
})(
|
|
21939
|
-
|
|
20742
|
+
})(exports.BlockBlobTier || (exports.BlockBlobTier = {}));
|
|
20743
|
+
exports.PremiumPageBlobTier = void 0;
|
|
21940
20744
|
(function(PremiumPageBlobTier) {
|
|
21941
20745
|
PremiumPageBlobTier["P4"] = "P4";
|
|
21942
20746
|
PremiumPageBlobTier["P6"] = "P6";
|
|
@@ -21949,7 +20753,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`;
|
|
|
21949
20753
|
PremiumPageBlobTier["P60"] = "P60";
|
|
21950
20754
|
PremiumPageBlobTier["P70"] = "P70";
|
|
21951
20755
|
PremiumPageBlobTier["P80"] = "P80";
|
|
21952
|
-
})(
|
|
20756
|
+
})(exports.PremiumPageBlobTier || (exports.PremiumPageBlobTier = {}));
|
|
21953
20757
|
function toAccessTier(tier2) {
|
|
21954
20758
|
if (tier2 === void 0) {
|
|
21955
20759
|
return void 0;
|
|
@@ -21966,11 +20770,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`;
|
|
|
21966
20770
|
}
|
|
21967
20771
|
}
|
|
21968
20772
|
__name(ensureCpkIfSpecified, "ensureCpkIfSpecified");
|
|
21969
|
-
|
|
20773
|
+
exports.StorageBlobAudience = void 0;
|
|
21970
20774
|
(function(StorageBlobAudience) {
|
|
21971
20775
|
StorageBlobAudience["StorageOAuthScopes"] = "https://storage.azure.com/.default";
|
|
21972
20776
|
StorageBlobAudience["DiskComputeOAuthScopes"] = "https://disk.compute.azure.com/.default";
|
|
21973
|
-
})(
|
|
20777
|
+
})(exports.StorageBlobAudience || (exports.StorageBlobAudience = {}));
|
|
21974
20778
|
function getBlobServiceAccountAudience(storageAccountName) {
|
|
21975
20779
|
return `https://${storageAccountName}.blob.core.windows.net/.default`;
|
|
21976
20780
|
}
|
|
@@ -27673,50 +26477,50 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`;
|
|
|
27673
26477
|
};
|
|
27674
26478
|
__name(_BlobServiceClient, "BlobServiceClient");
|
|
27675
26479
|
var BlobServiceClient = _BlobServiceClient;
|
|
27676
|
-
|
|
26480
|
+
exports.KnownEncryptionAlgorithmType = void 0;
|
|
27677
26481
|
(function(KnownEncryptionAlgorithmType) {
|
|
27678
26482
|
KnownEncryptionAlgorithmType["AES256"] = "AES256";
|
|
27679
|
-
})(
|
|
27680
|
-
Object.defineProperty(
|
|
26483
|
+
})(exports.KnownEncryptionAlgorithmType || (exports.KnownEncryptionAlgorithmType = {}));
|
|
26484
|
+
Object.defineProperty(exports, "RestError", {
|
|
27681
26485
|
enumerable: true,
|
|
27682
26486
|
get: /* @__PURE__ */ __name(function() {
|
|
27683
26487
|
return coreRestPipeline.RestError;
|
|
27684
26488
|
}, "get")
|
|
27685
26489
|
});
|
|
27686
|
-
|
|
27687
|
-
|
|
27688
|
-
|
|
27689
|
-
|
|
27690
|
-
|
|
27691
|
-
|
|
27692
|
-
|
|
27693
|
-
|
|
27694
|
-
|
|
27695
|
-
|
|
27696
|
-
|
|
27697
|
-
|
|
27698
|
-
|
|
27699
|
-
|
|
27700
|
-
|
|
27701
|
-
|
|
27702
|
-
|
|
27703
|
-
|
|
27704
|
-
|
|
27705
|
-
|
|
27706
|
-
|
|
27707
|
-
|
|
27708
|
-
|
|
27709
|
-
|
|
27710
|
-
|
|
27711
|
-
|
|
27712
|
-
|
|
27713
|
-
|
|
27714
|
-
|
|
27715
|
-
|
|
27716
|
-
|
|
27717
|
-
|
|
27718
|
-
|
|
27719
|
-
|
|
26490
|
+
exports.AccountSASPermissions = AccountSASPermissions;
|
|
26491
|
+
exports.AccountSASResourceTypes = AccountSASResourceTypes;
|
|
26492
|
+
exports.AccountSASServices = AccountSASServices;
|
|
26493
|
+
exports.AnonymousCredential = AnonymousCredential;
|
|
26494
|
+
exports.AnonymousCredentialPolicy = AnonymousCredentialPolicy;
|
|
26495
|
+
exports.AppendBlobClient = AppendBlobClient;
|
|
26496
|
+
exports.BaseRequestPolicy = BaseRequestPolicy;
|
|
26497
|
+
exports.BlobBatch = BlobBatch;
|
|
26498
|
+
exports.BlobBatchClient = BlobBatchClient;
|
|
26499
|
+
exports.BlobClient = BlobClient;
|
|
26500
|
+
exports.BlobLeaseClient = BlobLeaseClient;
|
|
26501
|
+
exports.BlobSASPermissions = BlobSASPermissions;
|
|
26502
|
+
exports.BlobServiceClient = BlobServiceClient;
|
|
26503
|
+
exports.BlockBlobClient = BlockBlobClient;
|
|
26504
|
+
exports.ContainerClient = ContainerClient;
|
|
26505
|
+
exports.ContainerSASPermissions = ContainerSASPermissions;
|
|
26506
|
+
exports.Credential = Credential;
|
|
26507
|
+
exports.CredentialPolicy = CredentialPolicy;
|
|
26508
|
+
exports.PageBlobClient = PageBlobClient;
|
|
26509
|
+
exports.Pipeline = Pipeline;
|
|
26510
|
+
exports.SASQueryParameters = SASQueryParameters;
|
|
26511
|
+
exports.StorageBrowserPolicy = StorageBrowserPolicy;
|
|
26512
|
+
exports.StorageBrowserPolicyFactory = StorageBrowserPolicyFactory;
|
|
26513
|
+
exports.StorageOAuthScopes = StorageOAuthScopes;
|
|
26514
|
+
exports.StorageRetryPolicy = StorageRetryPolicy;
|
|
26515
|
+
exports.StorageRetryPolicyFactory = StorageRetryPolicyFactory;
|
|
26516
|
+
exports.StorageSharedKeyCredential = StorageSharedKeyCredential;
|
|
26517
|
+
exports.StorageSharedKeyCredentialPolicy = StorageSharedKeyCredentialPolicy;
|
|
26518
|
+
exports.generateAccountSASQueryParameters = generateAccountSASQueryParameters;
|
|
26519
|
+
exports.generateBlobSASQueryParameters = generateBlobSASQueryParameters;
|
|
26520
|
+
exports.getBlobServiceAccountAudience = getBlobServiceAccountAudience;
|
|
26521
|
+
exports.isPipelineLike = isPipelineLike;
|
|
26522
|
+
exports.logger = logger;
|
|
26523
|
+
exports.newPipeline = newPipeline;
|
|
27720
26524
|
}
|
|
27721
26525
|
});
|
|
27722
26526
|
|