@zimic/http 0.1.0-canary.12 → 0.1.0-canary.14
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/{chunk-6UNIPPBC.mjs → chunk-SSSE2VVN.mjs} +53 -75
- package/dist/chunk-SSSE2VVN.mjs.map +1 -0
- package/dist/{chunk-343XY3VF.js → chunk-WHT4TCQM.js} +53 -75
- package/dist/chunk-WHT4TCQM.js.map +1 -0
- package/dist/cli.js +8 -8
- package/dist/cli.js.map +1 -1
- package/dist/cli.mjs +2 -2
- package/dist/cli.mjs.map +1 -1
- package/dist/index.d.ts +2 -18
- package/dist/index.js +13 -15
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +13 -15
- package/dist/index.mjs.map +1 -1
- package/dist/typegen.js +2 -2
- package/dist/typegen.mjs +1 -1
- package/package.json +3 -2
- package/src/formData/HttpFormData.ts +2 -2
- package/src/formData/types.ts +1 -1
- package/src/headers/HttpHeaders.ts +1 -1
- package/src/headers/types.ts +1 -1
- package/src/pathParams/types.ts +1 -1
- package/src/searchParams/HttpSearchParams.ts +1 -1
- package/src/searchParams/types.ts +1 -1
- package/src/typegen/openapi/generate.ts +1 -2
- package/src/typegen/openapi/transform/components.ts +2 -3
- package/src/typegen/openapi/transform/filters.ts +3 -3
- package/src/typegen/openapi/transform/io.ts +3 -5
- package/src/typegen/openapi/transform/methods.ts +2 -2
- package/src/typegen/openapi/transform/operations.ts +2 -3
- package/src/typegen/openapi/transform/paths.ts +2 -3
- package/src/types/requests.ts +2 -1
- package/src/types/schema.ts +1 -1
- package/src/utils/console.ts +1 -1
- package/src/utils/files.ts +4 -24
- package/src/utils/prettier.ts +1 -1
- package/src/utils/time.ts +1 -1
- package/dist/chunk-343XY3VF.js.map +0 -1
- package/dist/chunk-6UNIPPBC.mjs.map +0 -1
- package/src/types/arrays.d.ts +0 -4
- package/src/types/objects.d.ts +0 -14
- package/src/types/strings.d.ts +0 -9
- package/src/types/utils.ts +0 -40
- package/src/utils/data.ts +0 -13
- package/src/utils/imports.ts +0 -12
- package/src/utils/urls.ts +0 -52
|
@@ -6,15 +6,17 @@ import chalk from 'chalk';
|
|
|
6
6
|
var __defProp = Object.defineProperty;
|
|
7
7
|
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
8
8
|
|
|
9
|
-
//
|
|
9
|
+
// ../zimic-utils/dist/chunk-PAWJFY3S.mjs
|
|
10
|
+
var __defProp2 = Object.defineProperty;
|
|
11
|
+
var __name2 = /* @__PURE__ */ __name((target, value) => __defProp2(target, "name", { value, configurable: true }), "__name");
|
|
12
|
+
|
|
13
|
+
// ../zimic-utils/dist/chunk-3O5CS47X.mjs
|
|
10
14
|
function isDefined(value) {
|
|
11
15
|
return value !== undefined && value !== null;
|
|
12
16
|
}
|
|
13
17
|
__name(isDefined, "isDefined");
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
17
|
-
__name(isNonEmpty, "isNonEmpty");
|
|
18
|
+
__name2(isDefined, "isDefined");
|
|
19
|
+
var isDefined_default = isDefined;
|
|
18
20
|
function isNeverType(type) {
|
|
19
21
|
return type.kind === ts3.SyntaxKind.NeverKeyword;
|
|
20
22
|
}
|
|
@@ -50,7 +52,7 @@ __name(createImportDeclaration, "createImportDeclaration");
|
|
|
50
52
|
var HTTP_METHODS = Object.freeze(["GET", "POST", "PUT", "PATCH", "DELETE", "HEAD", "OPTIONS"]);
|
|
51
53
|
function logWithPrefix(message, options) {
|
|
52
54
|
const { method } = options;
|
|
53
|
-
console[method](chalk.cyan("[zimic]"), message);
|
|
55
|
+
console[method](chalk.cyan("[@zimic/http]"), message);
|
|
54
56
|
}
|
|
55
57
|
__name(logWithPrefix, "logWithPrefix");
|
|
56
58
|
function createOperationsIdentifierText(serviceName) {
|
|
@@ -94,7 +96,7 @@ function normalizeOperation(operation, context) {
|
|
|
94
96
|
__name(normalizeOperation, "normalizeOperation");
|
|
95
97
|
function normalizeOperations(operations, context) {
|
|
96
98
|
const newIdentifier = createOperationsIdentifier(context.serviceName);
|
|
97
|
-
const newMembers = operations.members.map((operation) => normalizeOperation(operation, context)).filter(
|
|
99
|
+
const newMembers = operations.members.map((operation) => normalizeOperation(operation, context)).filter(isDefined_default);
|
|
98
100
|
return ts3.factory.updateInterfaceDeclaration(
|
|
99
101
|
operations,
|
|
100
102
|
operations.modifiers,
|
|
@@ -119,7 +121,7 @@ function removeOperationIfUnreferenced(operation, context) {
|
|
|
119
121
|
}
|
|
120
122
|
__name(removeOperationIfUnreferenced, "removeOperationIfUnreferenced");
|
|
121
123
|
function removeUnreferencedOperations(operations, context) {
|
|
122
|
-
const newMembers = operations.members.map((operation) => removeOperationIfUnreferenced(operation, context)).filter(
|
|
124
|
+
const newMembers = operations.members.map((operation) => removeOperationIfUnreferenced(operation, context)).filter(isDefined_default);
|
|
123
125
|
context.referencedTypes.operations.clear();
|
|
124
126
|
if (newMembers.length === 0) {
|
|
125
127
|
return undefined;
|
|
@@ -311,16 +313,16 @@ function normalizeContentType(contentType, context, options) {
|
|
|
311
313
|
if (!ts3.isTypeLiteralNode(contentType)) {
|
|
312
314
|
return contentType;
|
|
313
315
|
}
|
|
314
|
-
const newHeader = contentType.members.map((member) => normalizeRequestHeaders(member, context)).find(
|
|
316
|
+
const newHeader = contentType.members.map((member) => normalizeRequestHeaders(member, context)).find(isDefined_default);
|
|
315
317
|
const newBodyMembers = contentType.members.flatMap((body) => {
|
|
316
318
|
if (isContentPropertySignature(body)) {
|
|
317
|
-
return body.type.members.map((member) => normalizeRequestBodyMember(member, context, { questionToken: bodyQuestionToken })).filter(
|
|
319
|
+
return body.type.members.map((member) => normalizeRequestBodyMember(member, context, { questionToken: bodyQuestionToken })).filter(isDefined_default);
|
|
318
320
|
}
|
|
319
321
|
return [];
|
|
320
322
|
});
|
|
321
323
|
if (newBodyMembers.length <= 1) {
|
|
322
324
|
const newBodyMemberPropertySignatures = newBodyMembers.map((bodyMember) => bodyMember.propertySignature);
|
|
323
|
-
const newMembers = [newHeader, ...newBodyMemberPropertySignatures].filter(
|
|
325
|
+
const newMembers = [newHeader, ...newBodyMemberPropertySignatures].filter(isDefined_default);
|
|
324
326
|
return ts3.factory.updateTypeLiteralNode(contentType, ts3.factory.createNodeArray(newMembers));
|
|
325
327
|
} else {
|
|
326
328
|
const bodyMemberUnionTypes = newBodyMembers.map((bodyMember) => {
|
|
@@ -425,7 +427,7 @@ function normalizeResponses(responses, context) {
|
|
|
425
427
|
}
|
|
426
428
|
const newIdentifier = ts3.factory.createIdentifier("response");
|
|
427
429
|
const newQuestionToken = undefined;
|
|
428
|
-
const newMembers = responses.type.members.map((response) => normalizeResponse(response, context), context).filter(
|
|
430
|
+
const newMembers = responses.type.members.map((response) => normalizeResponse(response, context), context).filter(isDefined_default);
|
|
429
431
|
const sortedNewMembers = Array.from(newMembers).sort((response, otherResponse) => {
|
|
430
432
|
return response.statusCode.value.localeCompare(otherResponse.statusCode.value);
|
|
431
433
|
});
|
|
@@ -562,7 +564,7 @@ function mergeRequestHeadersMembers(members) {
|
|
|
562
564
|
if (firstHeadersIndex !== undefined) {
|
|
563
565
|
mergedHeadersMembers[firstHeadersIndex] = mergedHeaders;
|
|
564
566
|
}
|
|
565
|
-
return mergedHeadersMembers.filter(
|
|
567
|
+
return mergedHeadersMembers.filter(isDefined_default);
|
|
566
568
|
}
|
|
567
569
|
__name(mergeRequestHeadersMembers, "mergeRequestHeadersMembers");
|
|
568
570
|
function mergeRequestAndParameterTypes(requestType, methodMembers, context) {
|
|
@@ -582,12 +584,12 @@ function mergeRequestAndParameterTypes(requestType, methodMembers, context) {
|
|
|
582
584
|
__name(mergeRequestAndParameterTypes, "mergeRequestAndParameterTypes");
|
|
583
585
|
function normalizeRequestTypeWithParameters(requestType, methodMembers, context) {
|
|
584
586
|
if (ts3.isUnionTypeNode(requestType)) {
|
|
585
|
-
const newTypes = requestType.types.map((type) => normalizeRequestTypeWithParameters(type, methodMembers, context)).filter(
|
|
587
|
+
const newTypes = requestType.types.map((type) => normalizeRequestTypeWithParameters(type, methodMembers, context)).filter(isDefined_default);
|
|
586
588
|
return ts3.factory.updateUnionTypeNode(requestType, ts3.factory.createNodeArray(newTypes));
|
|
587
589
|
}
|
|
588
590
|
if (ts3.isIndexedAccessTypeNode(requestType)) {
|
|
589
591
|
const newType = normalizeRequestTypeWithParameters(ts3.factory.createTypeLiteralNode([]), methodMembers, context);
|
|
590
|
-
return ts3.factory.createIntersectionTypeNode([requestType, newType].filter(
|
|
592
|
+
return ts3.factory.createIntersectionTypeNode([requestType, newType].filter(isDefined_default));
|
|
591
593
|
}
|
|
592
594
|
return mergeRequestAndParameterTypes(requestType, methodMembers, context);
|
|
593
595
|
}
|
|
@@ -616,7 +618,7 @@ function normalizeMethodMemberWithParameters(methodMember, methodMembers, contex
|
|
|
616
618
|
}
|
|
617
619
|
__name(normalizeMethodMemberWithParameters, "normalizeMethodMemberWithParameters");
|
|
618
620
|
function normalizeTypeLiteralMethodType(methodType, context) {
|
|
619
|
-
const newMembers = methodType.members.map((member) => normalizeMethodMember(member, context)).filter(
|
|
621
|
+
const newMembers = methodType.members.map((member) => normalizeMethodMember(member, context)).filter(isDefined_default).map((member, _index, partialMembers) => normalizeMethodMemberWithParameters(member, partialMembers, context)).filter(isDefined_default);
|
|
620
622
|
return ts3.factory.updateTypeLiteralNode(methodType, ts3.factory.createNodeArray(newMembers));
|
|
621
623
|
}
|
|
622
624
|
__name(normalizeTypeLiteralMethodType, "normalizeTypeLiteralMethodType");
|
|
@@ -688,7 +690,7 @@ function normalizePath(path4, context, options = {}) {
|
|
|
688
690
|
const newIdentifier = isComponent2 ? path4.name : ts3.factory.createStringLiteral(newPathName);
|
|
689
691
|
let newType;
|
|
690
692
|
if (ts3.isTypeLiteralNode(path4.type)) {
|
|
691
|
-
const newMethods = path4.type.members.map((method) => normalizeMethod(method, context, { pathName: newPathName })).filter(
|
|
693
|
+
const newMethods = path4.type.members.map((method) => normalizeMethod(method, context, { pathName: newPathName })).filter(isDefined_default);
|
|
692
694
|
if (newMethods.length === 0) {
|
|
693
695
|
return undefined;
|
|
694
696
|
}
|
|
@@ -714,7 +716,7 @@ __name(wrapPathsType, "wrapPathsType");
|
|
|
714
716
|
function normalizePaths(pathsOrTypeAlias, context) {
|
|
715
717
|
const newIdentifier = createPathsIdentifier(context.serviceName);
|
|
716
718
|
const paths = ts3.isTypeAliasDeclaration(pathsOrTypeAlias) ? ts3.factory.createInterfaceDeclaration(pathsOrTypeAlias.modifiers, pathsOrTypeAlias.name, undefined, undefined, []) : pathsOrTypeAlias;
|
|
717
|
-
const newMembers = paths.members.map((path4) => normalizePath(path4, context)).filter(
|
|
719
|
+
const newMembers = paths.members.map((path4) => normalizePath(path4, context)).filter(isDefined_default);
|
|
718
720
|
const newType = ts3.factory.createTypeLiteralNode(newMembers);
|
|
719
721
|
return ts3.factory.createTypeAliasDeclaration(
|
|
720
722
|
paths.modifiers,
|
|
@@ -927,7 +929,7 @@ function normalizeComponentGroup(componentGroup, context) {
|
|
|
927
929
|
}
|
|
928
930
|
const componentGroupName = normalizeComponentGroupName(componentGroup.name.text);
|
|
929
931
|
const newIdentifier = ts3.factory.createIdentifier(componentGroupName);
|
|
930
|
-
const newComponents = componentGroup.type.members.map((component) => normalizeComponent(component, componentGroupName, context)).filter(
|
|
932
|
+
const newComponents = componentGroup.type.members.map((component) => normalizeComponent(component, componentGroupName, context)).filter(isDefined_default);
|
|
931
933
|
const newType = ts3.factory.updateTypeLiteralNode(componentGroup.type, ts3.factory.createNodeArray(newComponents));
|
|
932
934
|
return ts3.factory.updatePropertySignature(
|
|
933
935
|
componentGroup,
|
|
@@ -940,7 +942,7 @@ function normalizeComponentGroup(componentGroup, context) {
|
|
|
940
942
|
__name(normalizeComponentGroup, "normalizeComponentGroup");
|
|
941
943
|
function normalizeComponents(components, context) {
|
|
942
944
|
const newIdentifier = createComponentsIdentifier(context.serviceName);
|
|
943
|
-
const newMembers = components.members.map((componentGroup) => normalizeComponentGroup(componentGroup, context)).filter(
|
|
945
|
+
const newMembers = components.members.map((componentGroup) => normalizeComponentGroup(componentGroup, context)).filter(isDefined_default);
|
|
944
946
|
return ts3.factory.updateInterfaceDeclaration(
|
|
945
947
|
components,
|
|
946
948
|
components.modifiers,
|
|
@@ -1003,7 +1005,7 @@ function removeUnreferencedComponentsInGroup(componentGroup, context) {
|
|
|
1003
1005
|
return undefined;
|
|
1004
1006
|
}
|
|
1005
1007
|
const componentGroupName = normalizeComponentGroupName(componentGroup.name.text);
|
|
1006
|
-
const newComponents = componentGroup.type.members.map((component) => removeComponentIfUnreferenced(component, componentGroupName, context)).filter(
|
|
1008
|
+
const newComponents = componentGroup.type.members.map((component) => removeComponentIfUnreferenced(component, componentGroupName, context)).filter(isDefined_default);
|
|
1007
1009
|
if (newComponents.length === 0) {
|
|
1008
1010
|
return undefined;
|
|
1009
1011
|
}
|
|
@@ -1017,7 +1019,7 @@ function removeUnreferencedComponentsInGroup(componentGroup, context) {
|
|
|
1017
1019
|
}
|
|
1018
1020
|
__name(removeUnreferencedComponentsInGroup, "removeUnreferencedComponentsInGroup");
|
|
1019
1021
|
function removeUnreferencedComponents(components, context) {
|
|
1020
|
-
const newComponentGroups = components.members.map((componentGroup) => removeUnreferencedComponentsInGroup(componentGroup, context)).filter(
|
|
1022
|
+
const newComponentGroups = components.members.map((componentGroup) => removeUnreferencedComponentsInGroup(componentGroup, context)).filter(isDefined_default);
|
|
1021
1023
|
context.referencedTypes.components.clear();
|
|
1022
1024
|
if (newComponentGroups.length === 0) {
|
|
1023
1025
|
return undefined;
|
|
@@ -1039,52 +1041,28 @@ function convertToPascalCase(value) {
|
|
|
1039
1041
|
}
|
|
1040
1042
|
__name(convertToPascalCase, "convertToPascalCase");
|
|
1041
1043
|
|
|
1042
|
-
//
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
__name(this, "InvalidURLError");
|
|
1046
|
-
}
|
|
1047
|
-
constructor(url) {
|
|
1048
|
-
super(`Invalid URL: '${url}'`);
|
|
1049
|
-
this.name = "InvalidURL";
|
|
1050
|
-
}
|
|
1051
|
-
};
|
|
1052
|
-
function createURLOrThrow(rawURL) {
|
|
1053
|
-
try {
|
|
1054
|
-
const url = new URL(rawURL);
|
|
1055
|
-
Object.defineProperty(url, "raw", {
|
|
1056
|
-
value: rawURL.toString(),
|
|
1057
|
-
writable: false,
|
|
1058
|
-
enumerable: true,
|
|
1059
|
-
configurable: false
|
|
1060
|
-
});
|
|
1061
|
-
return url;
|
|
1062
|
-
} catch {
|
|
1063
|
-
throw new InvalidURLError(rawURL);
|
|
1064
|
-
}
|
|
1065
|
-
}
|
|
1066
|
-
__name(createURLOrThrow, "createURLOrThrow");
|
|
1067
|
-
function createURL(rawURL) {
|
|
1068
|
-
const url = createURLOrThrow(rawURL);
|
|
1069
|
-
return url;
|
|
1070
|
-
}
|
|
1071
|
-
__name(createURL, "createURL");
|
|
1072
|
-
function createFileURL(filePath) {
|
|
1073
|
-
return createURL(`file://${filePath}`);
|
|
1044
|
+
// ../zimic-utils/dist/data/isNonEmpty.mjs
|
|
1045
|
+
function isNonEmpty(value) {
|
|
1046
|
+
return isDefined_default(value) && value !== "";
|
|
1074
1047
|
}
|
|
1075
|
-
__name(
|
|
1048
|
+
__name(isNonEmpty, "isNonEmpty");
|
|
1049
|
+
__name2(isNonEmpty, "isNonEmpty");
|
|
1050
|
+
var isNonEmpty_default = isNonEmpty;
|
|
1051
|
+
|
|
1052
|
+
// ../zimic-utils/dist/url/createRegExpFromWildcardPath.mjs
|
|
1076
1053
|
function prepareURLForRegex(url) {
|
|
1077
1054
|
const encodedURL = encodeURI(url);
|
|
1078
1055
|
return encodedURL.replace(/([.()*?+$\\])/g, "\\$1");
|
|
1079
1056
|
}
|
|
1080
1057
|
__name(prepareURLForRegex, "prepareURLForRegex");
|
|
1081
|
-
|
|
1058
|
+
__name2(prepareURLForRegex, "prepareURLForRegex");
|
|
1059
|
+
function createRegExpFromWildcardPath(path4, options) {
|
|
1082
1060
|
const pathWithReplacedWildcards = prepareURLForRegex(path4).replace(/^\/+|\/+$/g, "").replace(/\\\*/g, "*").replace(/\*\*\/\*/g, "**").replace(/(^|[^*])\*([^*]|$)/g, "$1[^/]*$2").replace(/\*\*/g, ".*");
|
|
1083
1061
|
return new RegExp(`^${options.prefix}/*${pathWithReplacedWildcards}/*$`);
|
|
1084
1062
|
}
|
|
1085
|
-
__name(
|
|
1086
|
-
|
|
1087
|
-
|
|
1063
|
+
__name(createRegExpFromWildcardPath, "createRegExpFromWildcardPath");
|
|
1064
|
+
__name2(createRegExpFromWildcardPath, "createRegExpFromWildcardPath");
|
|
1065
|
+
var createRegExpFromWildcardPath_default = createRegExpFromWildcardPath;
|
|
1088
1066
|
var HTTP_METHOD_OPTIONS = HTTP_METHODS.join("|");
|
|
1089
1067
|
var MODIFIER_GROUP = "(?<modifier>!?)";
|
|
1090
1068
|
var METHOD_FILTER_GROUP = `(?<method>(?:\\*|(?:${HTTP_METHOD_OPTIONS})(?:,\\s*(?:${HTTP_METHOD_OPTIONS}))*))`;
|
|
@@ -1103,7 +1081,7 @@ function parseRawFilter(rawFilter) {
|
|
|
1103
1081
|
const methodFilterGroup = `(?:${filteredMethodsOrWildcard.toUpperCase().replace(/,/g, "|").replace(/\*/g, ".*")}) `;
|
|
1104
1082
|
const isNegativeMatch = filterModifier === "!";
|
|
1105
1083
|
return {
|
|
1106
|
-
expression:
|
|
1084
|
+
expression: createRegExpFromWildcardPath_default(filteredPath, { prefix: methodFilterGroup }),
|
|
1107
1085
|
isNegativeMatch
|
|
1108
1086
|
};
|
|
1109
1087
|
}
|
|
@@ -1132,7 +1110,7 @@ async function readPathFiltersFromFile(filePath) {
|
|
|
1132
1110
|
}
|
|
1133
1111
|
__name(readPathFiltersFromFile, "readPathFiltersFromFile");
|
|
1134
1112
|
function ignoreEmptyFilters(filters) {
|
|
1135
|
-
return filters.map((line) => line.trim()).filter(
|
|
1113
|
+
return filters.map((line) => line.trim()).filter(isNonEmpty_default);
|
|
1136
1114
|
}
|
|
1137
1115
|
__name(ignoreEmptyFilters, "ignoreEmptyFilters");
|
|
1138
1116
|
|
|
@@ -1171,20 +1149,20 @@ function createImportDeclarations(context) {
|
|
|
1171
1149
|
}
|
|
1172
1150
|
__name(createImportDeclarations, "createImportDeclarations");
|
|
1173
1151
|
|
|
1174
|
-
//
|
|
1152
|
+
// ../zimic-utils/dist/import/createCachedDynamicImport.mjs
|
|
1175
1153
|
function createCachedDynamicImport(importModuleDynamically) {
|
|
1176
1154
|
let cachedImportResult;
|
|
1177
|
-
return /* @__PURE__ */ __name(async function importModuleDynamicallyWithCache() {
|
|
1155
|
+
return /* @__PURE__ */ __name2(/* @__PURE__ */ __name(async function importModuleDynamicallyWithCache() {
|
|
1178
1156
|
if (cachedImportResult === undefined) {
|
|
1179
1157
|
cachedImportResult = await importModuleDynamically();
|
|
1180
1158
|
}
|
|
1181
1159
|
return cachedImportResult;
|
|
1182
|
-
}, "importModuleDynamicallyWithCache");
|
|
1160
|
+
}, "importModuleDynamicallyWithCache"), "importModuleDynamicallyWithCache");
|
|
1183
1161
|
}
|
|
1184
1162
|
__name(createCachedDynamicImport, "createCachedDynamicImport");
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
var importOpenapiTypeScript =
|
|
1163
|
+
__name2(createCachedDynamicImport, "createCachedDynamicImport");
|
|
1164
|
+
var createCachedDynamicImport_default = createCachedDynamicImport;
|
|
1165
|
+
var importOpenapiTypeScript = createCachedDynamicImport_default(() => import('openapi-typescript'));
|
|
1188
1166
|
function transformSchemaObject(schemaObject) {
|
|
1189
1167
|
if (schemaObject.format === "binary") {
|
|
1190
1168
|
const blobType = createBlobType();
|
|
@@ -1198,9 +1176,9 @@ function transformSchemaObject(schemaObject) {
|
|
|
1198
1176
|
__name(transformSchemaObject, "transformSchemaObject");
|
|
1199
1177
|
function convertFilePathOrURLToURL(filePathOrURL) {
|
|
1200
1178
|
try {
|
|
1201
|
-
return
|
|
1179
|
+
return new URL(filePathOrURL);
|
|
1202
1180
|
} catch {
|
|
1203
|
-
return
|
|
1181
|
+
return new URL(`file://${path.resolve(filePathOrURL)}`);
|
|
1204
1182
|
}
|
|
1205
1183
|
}
|
|
1206
1184
|
__name(convertFilePathOrURLToURL, "convertFilePathOrURLToURL");
|
|
@@ -1264,18 +1242,18 @@ __name(removeUnknownResources, "removeUnknownResources");
|
|
|
1264
1242
|
function normalizeRawNodes(rawNodes, context, options) {
|
|
1265
1243
|
let normalizedNodes = rawNodes.map((node) => isPathsDeclaration(node) ? normalizePaths(node, context) : node);
|
|
1266
1244
|
if (options.prune) {
|
|
1267
|
-
normalizedNodes = normalizedNodes.map((node) => isOperationsDeclaration(node) ? removeUnreferencedOperations(node, context) : node).filter(
|
|
1245
|
+
normalizedNodes = normalizedNodes.map((node) => isOperationsDeclaration(node) ? removeUnreferencedOperations(node, context) : node).filter(isDefined_default);
|
|
1268
1246
|
}
|
|
1269
|
-
normalizedNodes = normalizedNodes.map((node) => isOperationsDeclaration(node) ? normalizeOperations(node, context) : node).filter(
|
|
1247
|
+
normalizedNodes = normalizedNodes.map((node) => isOperationsDeclaration(node) ? normalizeOperations(node, context) : node).filter(isDefined_default);
|
|
1270
1248
|
if (options.prune) {
|
|
1271
1249
|
for (const node of normalizedNodes) {
|
|
1272
1250
|
if (isComponentsDeclaration(node, context)) {
|
|
1273
1251
|
populateReferencedComponents(node, context);
|
|
1274
1252
|
}
|
|
1275
1253
|
}
|
|
1276
|
-
normalizedNodes = normalizedNodes.map((node) => isComponentsDeclaration(node, context) ? removeUnreferencedComponents(node, context) : node).filter(
|
|
1254
|
+
normalizedNodes = normalizedNodes.map((node) => isComponentsDeclaration(node, context) ? removeUnreferencedComponents(node, context) : node).filter(isDefined_default);
|
|
1277
1255
|
}
|
|
1278
|
-
normalizedNodes = normalizedNodes.map((node) => isComponentsDeclaration(node, context) ? normalizeComponents(node, context) : node).map(removeUnknownResources).filter(
|
|
1256
|
+
normalizedNodes = normalizedNodes.map((node) => isComponentsDeclaration(node, context) ? normalizeComponents(node, context) : node).map(removeUnknownResources).filter(isDefined_default);
|
|
1279
1257
|
return normalizedNodes;
|
|
1280
1258
|
}
|
|
1281
1259
|
__name(normalizeRawNodes, "normalizeRawNodes");
|
|
@@ -1367,5 +1345,5 @@ var typegen = Object.freeze(new TypegenNamespace_default());
|
|
|
1367
1345
|
* The root import module is defined at build time. The fallback is not expected to be used. */
|
|
1368
1346
|
|
|
1369
1347
|
export { __name, logWithPrefix, typegen };
|
|
1370
|
-
//# sourceMappingURL=chunk-
|
|
1371
|
-
//# sourceMappingURL=chunk-
|
|
1348
|
+
//# sourceMappingURL=chunk-SSSE2VVN.mjs.map
|
|
1349
|
+
//# sourceMappingURL=chunk-SSSE2VVN.mjs.map
|