@utilix-tech/sdk 0.62.0 → 0.64.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/README.md +26 -5
- package/dist/{chunk-43WFN3CW.js → chunk-4HNHEOJL.js} +123 -1
- package/dist/{chunk-43L7H3L2.js → chunk-IANBS5Y3.js} +51 -1
- package/dist/{chunk-JW4NG2GN.js → chunk-JPFHEZ4P.js} +92 -1
- package/dist/{code-rxidGgvB.d.ts → code-CKI2Z_NM.d.cts} +49 -2
- package/dist/{code-rxidGgvB.d.cts → code-CKI2Z_NM.d.ts} +49 -2
- package/dist/index.cjs +263 -0
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +3 -3
- package/dist/{network-DewFJy4E.d.ts → network-DZTfMAk0.d.cts} +32 -2
- package/dist/{network-DewFJy4E.d.cts → network-DZTfMAk0.d.ts} +32 -2
- package/dist/tools/code.cjs +91 -0
- package/dist/tools/code.d.cts +1 -1
- package/dist/tools/code.d.ts +1 -1
- package/dist/tools/code.js +1 -1
- package/dist/tools/network.cjs +50 -0
- package/dist/tools/network.d.cts +1 -1
- package/dist/tools/network.d.ts +1 -1
- package/dist/tools/network.js +1 -1
- package/dist/tools/units.cjs +122 -0
- package/dist/tools/units.d.cts +1 -1
- package/dist/tools/units.d.ts +1 -1
- package/dist/tools/units.js +1 -1
- package/dist/{units-izyUpUAb.d.ts → units-DPefgzmH.d.cts} +78 -2
- package/dist/{units-izyUpUAb.d.cts → units-DPefgzmH.d.ts} +78 -2
- package/package.json +1 -1
|
@@ -900,6 +900,32 @@ declare function listCloseCodes(): CloseCodeInfo[];
|
|
|
900
900
|
declare function lookupCloseCode(code: number): CloseCodeInfo | {
|
|
901
901
|
error: string;
|
|
902
902
|
};
|
|
903
|
+
interface MultipartPart {
|
|
904
|
+
name: string | null;
|
|
905
|
+
filename: string | null;
|
|
906
|
+
headers: Record<string, string>;
|
|
907
|
+
value: string;
|
|
908
|
+
isBinary: boolean;
|
|
909
|
+
}
|
|
910
|
+
interface MultipartParseResult {
|
|
911
|
+
boundary: string;
|
|
912
|
+
parts: MultipartPart[];
|
|
913
|
+
}
|
|
914
|
+
/**
|
|
915
|
+
* Extract the `boundary` parameter from a `Content-Type: multipart/form-data;
|
|
916
|
+
* boundary=...` header value. Returns null if the header has no boundary
|
|
917
|
+
* parameter, e.g. because it isn't a multipart Content-Type at all.
|
|
918
|
+
*/
|
|
919
|
+
declare function extractMultipartBoundary(contentType: string): string | null;
|
|
920
|
+
/**
|
|
921
|
+
* Parse a raw multipart/form-data request body into its individual parts:
|
|
922
|
+
* field name, filename (if the part is a file field), headers, and decoded
|
|
923
|
+
* value, per RFC 7578. The body must use the same boundary the request's
|
|
924
|
+
* Content-Type header declared.
|
|
925
|
+
*/
|
|
926
|
+
declare function parseMultipartFormData(body: string, boundary: string): MultipartParseResult | {
|
|
927
|
+
error: string;
|
|
928
|
+
};
|
|
903
929
|
|
|
904
930
|
type network_AcceptLanguageEntry = AcceptLanguageEntry;
|
|
905
931
|
type network_AcceptLanguageResult = AcceptLanguageResult;
|
|
@@ -946,6 +972,8 @@ type network_LinkRel = LinkRel;
|
|
|
946
972
|
type network_ManifestIconInfo = ManifestIconInfo;
|
|
947
973
|
type network_ManifestIssue = ManifestIssue;
|
|
948
974
|
type network_ManifestValidationResult = ManifestValidationResult;
|
|
975
|
+
type network_MultipartParseResult = MultipartParseResult;
|
|
976
|
+
type network_MultipartPart = MultipartPart;
|
|
949
977
|
declare const network_PERMISSIONS_POLICY_FEATURES: typeof PERMISSIONS_POLICY_FEATURES;
|
|
950
978
|
type network_ParsedClientHint = ParsedClientHint;
|
|
951
979
|
type network_ParsedDnsResult = ParsedDnsResult;
|
|
@@ -1009,6 +1037,7 @@ declare const network_buildVaryHeader: typeof buildVaryHeader;
|
|
|
1009
1037
|
declare const network_buildXContentTypeOptionsHeader: typeof buildXContentTypeOptionsHeader;
|
|
1010
1038
|
declare const network_checkSetCookieHeader: typeof checkSetCookieHeader;
|
|
1011
1039
|
declare const network_countryCodeToFlag: typeof countryCodeToFlag;
|
|
1040
|
+
declare const network_extractMultipartBoundary: typeof extractMultipartBoundary;
|
|
1012
1041
|
declare const network_formatCoordinates: typeof formatCoordinates;
|
|
1013
1042
|
declare const network_formatTtl: typeof formatTtl;
|
|
1014
1043
|
declare const network_getByCategory: typeof getByCategory;
|
|
@@ -1032,6 +1061,7 @@ declare const network_parseDnsResponse: typeof parseDnsResponse;
|
|
|
1032
1061
|
declare const network_parseGeoResponse: typeof parseGeoResponse;
|
|
1033
1062
|
declare const network_parseHar: typeof parseHar;
|
|
1034
1063
|
declare const network_parseIpv6Address: typeof parseIpv6Address;
|
|
1064
|
+
declare const network_parseMultipartFormData: typeof parseMultipartFormData;
|
|
1035
1065
|
declare const network_parsePermissionsPolicy: typeof parsePermissionsPolicy;
|
|
1036
1066
|
declare const network_parsePreferHeader: typeof parsePreferHeader;
|
|
1037
1067
|
declare const network_parsePriorityHeader: typeof parsePriorityHeader;
|
|
@@ -1051,7 +1081,7 @@ declare const network_validateManifest: typeof validateManifest;
|
|
|
1051
1081
|
declare const network_validateRobotsTxt: typeof validateRobotsTxt;
|
|
1052
1082
|
declare const network_validateSitemap: typeof validateSitemap;
|
|
1053
1083
|
declare namespace network {
|
|
1054
|
-
export { type network_AcceptLanguageEntry as AcceptLanguageEntry, type network_AcceptLanguageResult as AcceptLanguageResult, type network_AuthResultEntry as AuthResultEntry, type network_BuildRangeHeaderOptions as BuildRangeHeaderOptions, network_CLIENT_HINTS as CLIENT_HINTS, type network_CacheControlDirective as CacheControlDirective, type network_CacheControlOptions as CacheControlOptions, type network_CacheControlResult as CacheControlResult, type network_ClientHintDef as ClientHintDef, type network_ClientHintValueType as ClientHintValueType, type network_ClientHintsBuildResult as ClientHintsBuildResult, type network_ClientHintsParseResult as ClientHintsParseResult, type network_CloseCodeInfo as CloseCodeInfo, type network_CloseCodeRange as CloseCodeRange, type network_ContentDispositionBuildOptions as ContentDispositionBuildOptions, type network_ContentDispositionBuildResult as ContentDispositionBuildResult, type network_ContentDispositionParseResult as ContentDispositionParseResult, type network_ContentRangeResult as ContentRangeResult, type network_ContentTypeRiskResult as ContentTypeRiskResult, type network_ContentTypeSniffRisk as ContentTypeSniffRisk, type network_CookieAttributes as CookieAttributes, type network_CookieCheckResult as CookieCheckResult, network_DNS_RECORD_TYPES as DNS_RECORD_TYPES, type network_DnsRecord as DnsRecord, type network_DnsRecordType as DnsRecordType, type network_DnsResponse as DnsResponse, type network_EmailHeaderAnalysis as EmailHeaderAnalysis, type network_EmailHeaderField as EmailHeaderField, type network_GeoResult as GeoResult, network_HTTP_HEADERS as HTTP_HEADERS, type network_HarEntry as HarEntry, type network_HarParseResult as HarParseResult, type network_HarSummary as HarSummary, type network_HeaderCategory as HeaderCategory, type network_HttpHeader as HttpHeader, type network_Ipv6AddressType as Ipv6AddressType, type network_Ipv6ParseResult as Ipv6ParseResult, network_LINK_REL_VALUES as LINK_REL_VALUES, type network_LinkHeaderEntry as LinkHeaderEntry, type network_LinkHeaderEntryInput as LinkHeaderEntryInput, type network_LinkHeaderResult as LinkHeaderResult, type network_LinkRel as LinkRel, type network_ManifestIconInfo as ManifestIconInfo, type network_ManifestIssue as ManifestIssue, type network_ManifestValidationResult as ManifestValidationResult, network_PERMISSIONS_POLICY_FEATURES as PERMISSIONS_POLICY_FEATURES, type network_ParsedClientHint as ParsedClientHint, type network_ParsedDnsResult as ParsedDnsResult, type network_ParsedGeoResult as ParsedGeoResult, type network_PermissionsPolicyDirective as PermissionsPolicyDirective, type network_PermissionsPolicyFeatureInput as PermissionsPolicyFeatureInput, type network_PermissionsPolicyResult as PermissionsPolicyResult, type network_PreferParameter as PreferParameter, type network_PreferPreference as PreferPreference, type network_PreferResult as PreferResult, type network_PriorityResult as PriorityResult, network_REFERRER_POLICY_VALUES as REFERRER_POLICY_VALUES, type network_RangeEntry as RangeEntry, type network_RangeEntryInput as RangeEntryInput, type network_RangeHeaderResult as RangeHeaderResult, type network_ReceivedHop as ReceivedHop, type network_ReferrerPolicyEntry as ReferrerPolicyEntry, type network_ReferrerPolicyResult as ReferrerPolicyResult, type network_ReferrerPolicyValue as ReferrerPolicyValue, type network_RetryAfterDateResult as RetryAfterDateResult, type network_RetryAfterResult as RetryAfterResult, type network_RetryAfterSecondsResult as RetryAfterSecondsResult, type network_RobotsGroup as RobotsGroup, type network_RobotsIssue as RobotsIssue, type network_RobotsRule as RobotsRule, type network_RobotsValidationResult as RobotsValidationResult, network_STATUS_CODES as STATUS_CODES, type network_SameSiteValue as SameSiteValue, type network_SitemapIndexEntry as SitemapIndexEntry, type network_SitemapIssue as SitemapIssue, type network_SitemapSplitFile as SitemapSplitFile, type network_SitemapUrlEntry as SitemapUrlEntry, type network_SitemapValidationResult as SitemapValidationResult, type network_SplitSitemapOptions as SplitSitemapOptions, type network_SplitSitemapResult as SplitSitemapResult, type network_StatusCode as StatusCode, type network_UaDeviceType as UaDeviceType, type network_UserAgentInfo as UserAgentInfo, type network_VaryHeaderEntry as VaryHeaderEntry, type network_VaryHeaderResult as VaryHeaderResult, type network_XContentTypeOptionsHeader as XContentTypeOptionsHeader, type network_XContentTypeOptionsParseResult as XContentTypeOptionsParseResult, network_X_CONTENT_TYPE_OPTIONS_HEADER as X_CONTENT_TYPE_OPTIONS_HEADER, network_analyzeEmailHeaders as analyzeEmailHeaders, network_assessContentTypeRisk as assessContentTypeRisk, network_buildAcceptLanguage as buildAcceptLanguage, network_buildCacheControl as buildCacheControl, network_buildClientHints as buildClientHints, network_buildContentDisposition as buildContentDisposition, network_buildDnsQueryUrl as buildDnsQueryUrl, network_buildGeoUrl as buildGeoUrl, network_buildLinkHeader as buildLinkHeader, network_buildMapUrl as buildMapUrl, network_buildPermissionsPolicy as buildPermissionsPolicy, network_buildPreferHeader as buildPreferHeader, network_buildPriorityHeader as buildPriorityHeader, network_buildRangeHeader as buildRangeHeader, network_buildReferrerPolicy as buildReferrerPolicy, network_buildRetryAfterHeader as buildRetryAfterHeader, network_buildVaryHeader as buildVaryHeader, network_buildXContentTypeOptionsHeader as buildXContentTypeOptionsHeader, network_checkSetCookieHeader as checkSetCookieHeader, network_countryCodeToFlag as countryCodeToFlag, network_formatCoordinates as formatCoordinates, network_formatTtl as formatTtl, network_getByCategory as getByCategory, network_getHeader as getHeader, network_getHeadersByCategory as getHeadersByCategory, network_getStatusByCategory as getStatusByCategory, network_getStatusCode as getStatusCode, network_isClientError as isClientError, network_isServerError as isServerError, network_isSuccess as isSuccess, network_isValidIp as isValidIp, network_isValidIpv4 as isValidIpv4, network_isValidIpv6 as isValidIpv6, network_listCloseCodes as listCloseCodes, network_lookupCloseCode as lookupCloseCode, network_parseAcceptLanguage as parseAcceptLanguage, network_parseClientHintHeaders as parseClientHintHeaders, network_parseContentDisposition as parseContentDisposition, network_parseContentRangeHeader as parseContentRangeHeader, network_parseDnsResponse as parseDnsResponse, network_parseGeoResponse as parseGeoResponse, network_parseHar as parseHar, network_parseIpv6Address as parseIpv6Address, network_parsePermissionsPolicy as parsePermissionsPolicy, network_parsePreferHeader as parsePreferHeader, network_parsePriorityHeader as parsePriorityHeader, network_parseRetryAfterHeader as parseRetryAfterHeader, network_parseUserAgent as parseUserAgent, network_parseVaryHeader as parseVaryHeader, network_parseXContentTypeOptionsHeader as parseXContentTypeOptionsHeader, network_searchHeaders as searchHeaders, network_searchStatusCodes as searchStatusCodes, network_splitSitemap as splitSitemap, network_statusCodeToText as statusCodeToText, network_typeNumberToLabel as typeNumberToLabel, network_validateDomain as validateDomain, network_validateHeaderName as validateHeaderName, network_validateHeaderValue as validateHeaderValue, network_validateManifest as validateManifest, network_validateRobotsTxt as validateRobotsTxt, network_validateSitemap as validateSitemap };
|
|
1084
|
+
export { type network_AcceptLanguageEntry as AcceptLanguageEntry, type network_AcceptLanguageResult as AcceptLanguageResult, type network_AuthResultEntry as AuthResultEntry, type network_BuildRangeHeaderOptions as BuildRangeHeaderOptions, network_CLIENT_HINTS as CLIENT_HINTS, type network_CacheControlDirective as CacheControlDirective, type network_CacheControlOptions as CacheControlOptions, type network_CacheControlResult as CacheControlResult, type network_ClientHintDef as ClientHintDef, type network_ClientHintValueType as ClientHintValueType, type network_ClientHintsBuildResult as ClientHintsBuildResult, type network_ClientHintsParseResult as ClientHintsParseResult, type network_CloseCodeInfo as CloseCodeInfo, type network_CloseCodeRange as CloseCodeRange, type network_ContentDispositionBuildOptions as ContentDispositionBuildOptions, type network_ContentDispositionBuildResult as ContentDispositionBuildResult, type network_ContentDispositionParseResult as ContentDispositionParseResult, type network_ContentRangeResult as ContentRangeResult, type network_ContentTypeRiskResult as ContentTypeRiskResult, type network_ContentTypeSniffRisk as ContentTypeSniffRisk, type network_CookieAttributes as CookieAttributes, type network_CookieCheckResult as CookieCheckResult, network_DNS_RECORD_TYPES as DNS_RECORD_TYPES, type network_DnsRecord as DnsRecord, type network_DnsRecordType as DnsRecordType, type network_DnsResponse as DnsResponse, type network_EmailHeaderAnalysis as EmailHeaderAnalysis, type network_EmailHeaderField as EmailHeaderField, type network_GeoResult as GeoResult, network_HTTP_HEADERS as HTTP_HEADERS, type network_HarEntry as HarEntry, type network_HarParseResult as HarParseResult, type network_HarSummary as HarSummary, type network_HeaderCategory as HeaderCategory, type network_HttpHeader as HttpHeader, type network_Ipv6AddressType as Ipv6AddressType, type network_Ipv6ParseResult as Ipv6ParseResult, network_LINK_REL_VALUES as LINK_REL_VALUES, type network_LinkHeaderEntry as LinkHeaderEntry, type network_LinkHeaderEntryInput as LinkHeaderEntryInput, type network_LinkHeaderResult as LinkHeaderResult, type network_LinkRel as LinkRel, type network_ManifestIconInfo as ManifestIconInfo, type network_ManifestIssue as ManifestIssue, type network_ManifestValidationResult as ManifestValidationResult, type network_MultipartParseResult as MultipartParseResult, type network_MultipartPart as MultipartPart, network_PERMISSIONS_POLICY_FEATURES as PERMISSIONS_POLICY_FEATURES, type network_ParsedClientHint as ParsedClientHint, type network_ParsedDnsResult as ParsedDnsResult, type network_ParsedGeoResult as ParsedGeoResult, type network_PermissionsPolicyDirective as PermissionsPolicyDirective, type network_PermissionsPolicyFeatureInput as PermissionsPolicyFeatureInput, type network_PermissionsPolicyResult as PermissionsPolicyResult, type network_PreferParameter as PreferParameter, type network_PreferPreference as PreferPreference, type network_PreferResult as PreferResult, type network_PriorityResult as PriorityResult, network_REFERRER_POLICY_VALUES as REFERRER_POLICY_VALUES, type network_RangeEntry as RangeEntry, type network_RangeEntryInput as RangeEntryInput, type network_RangeHeaderResult as RangeHeaderResult, type network_ReceivedHop as ReceivedHop, type network_ReferrerPolicyEntry as ReferrerPolicyEntry, type network_ReferrerPolicyResult as ReferrerPolicyResult, type network_ReferrerPolicyValue as ReferrerPolicyValue, type network_RetryAfterDateResult as RetryAfterDateResult, type network_RetryAfterResult as RetryAfterResult, type network_RetryAfterSecondsResult as RetryAfterSecondsResult, type network_RobotsGroup as RobotsGroup, type network_RobotsIssue as RobotsIssue, type network_RobotsRule as RobotsRule, type network_RobotsValidationResult as RobotsValidationResult, network_STATUS_CODES as STATUS_CODES, type network_SameSiteValue as SameSiteValue, type network_SitemapIndexEntry as SitemapIndexEntry, type network_SitemapIssue as SitemapIssue, type network_SitemapSplitFile as SitemapSplitFile, type network_SitemapUrlEntry as SitemapUrlEntry, type network_SitemapValidationResult as SitemapValidationResult, type network_SplitSitemapOptions as SplitSitemapOptions, type network_SplitSitemapResult as SplitSitemapResult, type network_StatusCode as StatusCode, type network_UaDeviceType as UaDeviceType, type network_UserAgentInfo as UserAgentInfo, type network_VaryHeaderEntry as VaryHeaderEntry, type network_VaryHeaderResult as VaryHeaderResult, type network_XContentTypeOptionsHeader as XContentTypeOptionsHeader, type network_XContentTypeOptionsParseResult as XContentTypeOptionsParseResult, network_X_CONTENT_TYPE_OPTIONS_HEADER as X_CONTENT_TYPE_OPTIONS_HEADER, network_analyzeEmailHeaders as analyzeEmailHeaders, network_assessContentTypeRisk as assessContentTypeRisk, network_buildAcceptLanguage as buildAcceptLanguage, network_buildCacheControl as buildCacheControl, network_buildClientHints as buildClientHints, network_buildContentDisposition as buildContentDisposition, network_buildDnsQueryUrl as buildDnsQueryUrl, network_buildGeoUrl as buildGeoUrl, network_buildLinkHeader as buildLinkHeader, network_buildMapUrl as buildMapUrl, network_buildPermissionsPolicy as buildPermissionsPolicy, network_buildPreferHeader as buildPreferHeader, network_buildPriorityHeader as buildPriorityHeader, network_buildRangeHeader as buildRangeHeader, network_buildReferrerPolicy as buildReferrerPolicy, network_buildRetryAfterHeader as buildRetryAfterHeader, network_buildVaryHeader as buildVaryHeader, network_buildXContentTypeOptionsHeader as buildXContentTypeOptionsHeader, network_checkSetCookieHeader as checkSetCookieHeader, network_countryCodeToFlag as countryCodeToFlag, network_extractMultipartBoundary as extractMultipartBoundary, network_formatCoordinates as formatCoordinates, network_formatTtl as formatTtl, network_getByCategory as getByCategory, network_getHeader as getHeader, network_getHeadersByCategory as getHeadersByCategory, network_getStatusByCategory as getStatusByCategory, network_getStatusCode as getStatusCode, network_isClientError as isClientError, network_isServerError as isServerError, network_isSuccess as isSuccess, network_isValidIp as isValidIp, network_isValidIpv4 as isValidIpv4, network_isValidIpv6 as isValidIpv6, network_listCloseCodes as listCloseCodes, network_lookupCloseCode as lookupCloseCode, network_parseAcceptLanguage as parseAcceptLanguage, network_parseClientHintHeaders as parseClientHintHeaders, network_parseContentDisposition as parseContentDisposition, network_parseContentRangeHeader as parseContentRangeHeader, network_parseDnsResponse as parseDnsResponse, network_parseGeoResponse as parseGeoResponse, network_parseHar as parseHar, network_parseIpv6Address as parseIpv6Address, network_parseMultipartFormData as parseMultipartFormData, network_parsePermissionsPolicy as parsePermissionsPolicy, network_parsePreferHeader as parsePreferHeader, network_parsePriorityHeader as parsePriorityHeader, network_parseRetryAfterHeader as parseRetryAfterHeader, network_parseUserAgent as parseUserAgent, network_parseVaryHeader as parseVaryHeader, network_parseXContentTypeOptionsHeader as parseXContentTypeOptionsHeader, network_searchHeaders as searchHeaders, network_searchStatusCodes as searchStatusCodes, network_splitSitemap as splitSitemap, network_statusCodeToText as statusCodeToText, network_typeNumberToLabel as typeNumberToLabel, network_validateDomain as validateDomain, network_validateHeaderName as validateHeaderName, network_validateHeaderValue as validateHeaderValue, network_validateManifest as validateManifest, network_validateRobotsTxt as validateRobotsTxt, network_validateSitemap as validateSitemap };
|
|
1055
1085
|
}
|
|
1056
1086
|
|
|
1057
|
-
export { type
|
|
1087
|
+
export { type PermissionsPolicyFeatureInput as $, type AcceptLanguageEntry as A, type BuildRangeHeaderOptions as B, CLIENT_HINTS as C, DNS_RECORD_TYPES as D, type EmailHeaderAnalysis as E, type HarSummary as F, type GeoResult as G, HTTP_HEADERS as H, type HeaderCategory as I, type HttpHeader as J, type Ipv6AddressType as K, type Ipv6ParseResult as L, LINK_REL_VALUES as M, type LinkHeaderEntry as N, type LinkHeaderEntryInput as O, type LinkHeaderResult as P, type LinkRel as Q, type ManifestIconInfo as R, type ManifestIssue as S, type ManifestValidationResult as T, type MultipartParseResult as U, type MultipartPart as V, PERMISSIONS_POLICY_FEATURES as W, type ParsedClientHint as X, type ParsedDnsResult as Y, type ParsedGeoResult as Z, type PermissionsPolicyDirective as _, type AcceptLanguageResult as a, getStatusByCategory as a$, type PermissionsPolicyResult as a0, type PreferParameter as a1, type PreferPreference as a2, type PreferResult as a3, type PriorityResult as a4, REFERRER_POLICY_VALUES as a5, type RangeEntry as a6, type RangeEntryInput as a7, type RangeHeaderResult as a8, type ReceivedHop as a9, X_CONTENT_TYPE_OPTIONS_HEADER as aA, analyzeEmailHeaders as aB, assessContentTypeRisk as aC, buildAcceptLanguage as aD, buildCacheControl as aE, buildClientHints as aF, buildContentDisposition as aG, buildDnsQueryUrl as aH, buildGeoUrl as aI, buildLinkHeader as aJ, buildMapUrl as aK, buildPermissionsPolicy as aL, buildPreferHeader as aM, buildPriorityHeader as aN, buildRangeHeader as aO, buildReferrerPolicy as aP, buildRetryAfterHeader as aQ, buildVaryHeader as aR, buildXContentTypeOptionsHeader as aS, checkSetCookieHeader as aT, countryCodeToFlag as aU, extractMultipartBoundary as aV, formatCoordinates as aW, formatTtl as aX, getByCategory as aY, getHeader as aZ, getHeadersByCategory as a_, type ReferrerPolicyEntry as aa, type ReferrerPolicyResult as ab, type ReferrerPolicyValue as ac, type RetryAfterDateResult as ad, type RetryAfterResult as ae, type RetryAfterSecondsResult as af, type RobotsGroup as ag, type RobotsIssue as ah, type RobotsRule as ai, type RobotsValidationResult as aj, STATUS_CODES as ak, type SameSiteValue as al, type SitemapIndexEntry as am, type SitemapIssue as an, type SitemapSplitFile as ao, type SitemapUrlEntry as ap, type SitemapValidationResult as aq, type SplitSitemapOptions as ar, type SplitSitemapResult as as, type StatusCode as at, type UaDeviceType as au, type UserAgentInfo as av, type VaryHeaderEntry as aw, type VaryHeaderResult as ax, type XContentTypeOptionsHeader as ay, type XContentTypeOptionsParseResult as az, type AuthResultEntry as b, getStatusCode as b0, isClientError as b1, isServerError as b2, isSuccess as b3, isValidIp as b4, isValidIpv4 as b5, isValidIpv6 as b6, listCloseCodes as b7, lookupCloseCode as b8, parseAcceptLanguage as b9, parseClientHintHeaders as ba, parseContentDisposition as bb, parseContentRangeHeader as bc, parseDnsResponse as bd, parseGeoResponse as be, parseHar as bf, parseIpv6Address as bg, parseMultipartFormData as bh, parsePermissionsPolicy as bi, parsePreferHeader as bj, parsePriorityHeader as bk, parseRetryAfterHeader as bl, parseUserAgent as bm, parseVaryHeader as bn, parseXContentTypeOptionsHeader as bo, searchHeaders as bp, searchStatusCodes as bq, splitSitemap as br, statusCodeToText as bs, typeNumberToLabel as bt, validateDomain as bu, validateHeaderName as bv, validateHeaderValue as bw, validateManifest as bx, validateRobotsTxt as by, validateSitemap as bz, type CacheControlDirective as c, type CacheControlOptions as d, type CacheControlResult as e, type ClientHintDef as f, type ClientHintValueType as g, type ClientHintsBuildResult as h, type ClientHintsParseResult as i, type CloseCodeInfo as j, type CloseCodeRange as k, type ContentDispositionBuildOptions as l, type ContentDispositionBuildResult as m, network as n, type ContentDispositionParseResult as o, type ContentRangeResult as p, type ContentTypeRiskResult as q, type ContentTypeSniffRisk as r, type CookieAttributes as s, type CookieCheckResult as t, type DnsRecord as u, type DnsRecordType as v, type DnsResponse as w, type EmailHeaderField as x, type HarEntry as y, type HarParseResult as z };
|
package/dist/tools/code.cjs
CHANGED
|
@@ -3337,6 +3337,96 @@ function validatePackageExports(packageJsonText) {
|
|
|
3337
3337
|
const valid = !issues.some((i) => i.severity === "error");
|
|
3338
3338
|
return { parsed: true, exportsShape, subpaths, issues, valid };
|
|
3339
3339
|
}
|
|
3340
|
+
var DEPENDENCY_SECTIONS = ["dependencies", "devDependencies", "peerDependencies", "optionalDependencies"];
|
|
3341
|
+
var EXACT_SEMVER_RE = /^\d+\.\d+\.\d+(-[0-9A-Za-z.-]+)?(\+[0-9A-Za-z.-]+)?$/;
|
|
3342
|
+
function classifyDependencyRange(version) {
|
|
3343
|
+
const v = version.trim();
|
|
3344
|
+
if (v === "" || v === "*" || v.toLowerCase() === "x") return "wildcard";
|
|
3345
|
+
if (v.startsWith("workspace:")) return "workspace";
|
|
3346
|
+
if (v.startsWith("file:")) return "file";
|
|
3347
|
+
if (v.startsWith("link:")) return "link";
|
|
3348
|
+
if (v.startsWith("http://") || v.startsWith("https://")) return "url";
|
|
3349
|
+
if (v.startsWith("git+") || v.startsWith("git://") || v.startsWith("github:") || v.endsWith(".git") || /^[\w-]+\/[\w.-]+$/.test(v)) return "git";
|
|
3350
|
+
if (v.startsWith("^")) return "caret";
|
|
3351
|
+
if (v.startsWith("~")) return "tilde";
|
|
3352
|
+
if (v.includes("||") || v.includes(" ") || v.startsWith(">") || v.startsWith("<") || v.startsWith("=")) return "range";
|
|
3353
|
+
if (EXACT_SEMVER_RE.test(v)) return "exact";
|
|
3354
|
+
if (/^[A-Za-z][\w.-]*$/.test(v)) return "tag";
|
|
3355
|
+
return "unknown";
|
|
3356
|
+
}
|
|
3357
|
+
function auditDependencyRanges(packageJsonText) {
|
|
3358
|
+
if (!packageJsonText || !packageJsonText.trim()) return { error: "Input is empty" };
|
|
3359
|
+
let parsed;
|
|
3360
|
+
try {
|
|
3361
|
+
parsed = JSON.parse(packageJsonText);
|
|
3362
|
+
} catch (e) {
|
|
3363
|
+
return { error: `Invalid JSON: ${e.message}` };
|
|
3364
|
+
}
|
|
3365
|
+
if (typeof parsed !== "object" || parsed === null || Array.isArray(parsed)) {
|
|
3366
|
+
return { error: "Root of package.json must be an object" };
|
|
3367
|
+
}
|
|
3368
|
+
const obj = parsed;
|
|
3369
|
+
const presentSections = DEPENDENCY_SECTIONS.filter((s) => obj[s] && typeof obj[s] === "object");
|
|
3370
|
+
if (presentSections.length === 0) {
|
|
3371
|
+
return { error: "package.json has no dependencies, devDependencies, peerDependencies, or optionalDependencies field" };
|
|
3372
|
+
}
|
|
3373
|
+
const dependencies = [];
|
|
3374
|
+
const issues = [];
|
|
3375
|
+
const byName = /* @__PURE__ */ new Map();
|
|
3376
|
+
for (const section of presentSections) {
|
|
3377
|
+
const map = obj[section];
|
|
3378
|
+
for (const [name, versionRaw] of Object.entries(map)) {
|
|
3379
|
+
const version = typeof versionRaw === "string" ? versionRaw : String(versionRaw);
|
|
3380
|
+
const rangeType = classifyDependencyRange(version);
|
|
3381
|
+
const entryIssues = [];
|
|
3382
|
+
if (rangeType === "wildcard") {
|
|
3383
|
+
entryIssues.push("no real version constraint; any version, including breaking ones, could be installed");
|
|
3384
|
+
}
|
|
3385
|
+
if (rangeType === "tag" && version.trim().toLowerCase() === "latest") {
|
|
3386
|
+
entryIssues.push('"latest" is not reproducible; a fresh install can pull in a different, potentially breaking version at any time');
|
|
3387
|
+
}
|
|
3388
|
+
if (rangeType === "git" || rangeType === "url") {
|
|
3389
|
+
entryIssues.push(`not resolved from the npm registry (${rangeType}); can't be checked against registry advisories the same way`);
|
|
3390
|
+
}
|
|
3391
|
+
if (rangeType === "file" || rangeType === "link") {
|
|
3392
|
+
entryIssues.push(`local ${rangeType === "file" ? "path" : "symlink"} dependency; not portable to a machine or CI runner without the same local path`);
|
|
3393
|
+
}
|
|
3394
|
+
const entry = { name, version, section, rangeType, issues: entryIssues };
|
|
3395
|
+
dependencies.push(entry);
|
|
3396
|
+
for (const issue of entryIssues) {
|
|
3397
|
+
issues.push({ severity: "warning", name, message: issue });
|
|
3398
|
+
}
|
|
3399
|
+
const existing = byName.get(name);
|
|
3400
|
+
if (existing) existing.push(entry);
|
|
3401
|
+
else byName.set(name, [entry]);
|
|
3402
|
+
}
|
|
3403
|
+
}
|
|
3404
|
+
const duplicates = [];
|
|
3405
|
+
for (const [name, entries] of byName) {
|
|
3406
|
+
if (entries.length < 2) continue;
|
|
3407
|
+
const versions = new Set(entries.map((e) => e.version));
|
|
3408
|
+
const sameVersion = versions.size === 1;
|
|
3409
|
+
duplicates.push({ name, sections: entries.map((e) => e.section), sameVersion });
|
|
3410
|
+
if (!sameVersion) {
|
|
3411
|
+
issues.push({ severity: "error", name, message: `listed with different version ranges in ${entries.map((e) => `${e.section} ("${e.version}")`).join(" and ")}` });
|
|
3412
|
+
} else {
|
|
3413
|
+
issues.push({ severity: "warning", name, message: `listed in more than one section (${entries.map((e) => e.section).join(", ")}) with the same range; redundant` });
|
|
3414
|
+
}
|
|
3415
|
+
}
|
|
3416
|
+
const rangeTypeCounts = {};
|
|
3417
|
+
for (const dep of dependencies) {
|
|
3418
|
+
rangeTypeCounts[dep.rangeType] = (rangeTypeCounts[dep.rangeType] ?? 0) + 1;
|
|
3419
|
+
}
|
|
3420
|
+
return {
|
|
3421
|
+
parsed: true,
|
|
3422
|
+
sections: presentSections,
|
|
3423
|
+
totalDependencies: dependencies.length,
|
|
3424
|
+
dependencies,
|
|
3425
|
+
duplicates,
|
|
3426
|
+
rangeTypeCounts,
|
|
3427
|
+
issues
|
|
3428
|
+
};
|
|
3429
|
+
}
|
|
3340
3430
|
|
|
3341
3431
|
exports.ALL_FLAGS = ALL_FLAGS;
|
|
3342
3432
|
exports.CHEATSHEET = CHEATSHEET;
|
|
@@ -3344,6 +3434,7 @@ exports.DEFAULT_COMMIT_TYPES = DEFAULT_COMMIT_TYPES;
|
|
|
3344
3434
|
exports.MIME_TABLE = MIME_TABLE;
|
|
3345
3435
|
exports.OPERATIONS = OPERATIONS;
|
|
3346
3436
|
exports.SQL_DEFAULT_OPTIONS = SQL_DEFAULT_OPTIONS;
|
|
3437
|
+
exports.auditDependencyRanges = auditDependencyRanges;
|
|
3347
3438
|
exports.buildDockerPull = buildDockerPull;
|
|
3348
3439
|
exports.buildDockerRun = buildDockerRun;
|
|
3349
3440
|
exports.buildGitCommand = buildGitCommand;
|
package/dist/tools/code.d.cts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { A as ALL_FLAGS, a as ApiEndpoint, b as ApiInfo, C as CHEATSHEET, d as CheatsheetEntry, e as ConventionalCommitFinding, f as ConventionalCommitFooter, g as ConventionalCommitOptions, h as ConventionalCommitParsed, i as ConventionalCommitResult, j as ConventionalCommitSeverity, k as CssResult, D as DEFAULT_COMMIT_TYPES, l as DockerImageRef, E as EditorConfigIssue,
|
|
1
|
+
export { A as ALL_FLAGS, a as ApiEndpoint, b as ApiInfo, C as CHEATSHEET, d as CheatsheetEntry, e as ConventionalCommitFinding, f as ConventionalCommitFooter, g as ConventionalCommitOptions, h as ConventionalCommitParsed, i as ConventionalCommitResult, j as ConventionalCommitSeverity, k as CssResult, D as DEFAULT_COMMIT_TYPES, l as DependencyAuditDuplicate, m as DependencyAuditEntry, n as DependencyAuditIssue, o as DependencyAuditResult, p as DependencyRangeType, q as DependencySection, r as DockerImageRef, E as EditorConfigIssue, s as EditorConfigProperty, t as EditorConfigSection, u as EditorConfigValidationResult, v as EnvEntry, w as EnvParseResult, x as ExportsIssue, y as ExportsShape, z as ExportsValidationResult, G as GitCommandConfig, B as GitCommandResult, F as GitOperation, H as GithubUrlInfo, I as GithubUrlType, J as GitignoreTestResult, K as GqlFormatResult, L as HtmlFormatResult, M as HtmlMinifyOptions, N as HtmlMinifyResult, O as JsMinifyOptions, P as JsMinifyResult, Q as MIME_TABLE, R as MatchResult, S as MimeEntry, T as MimeLookupResult, U as OPERATIONS, V as ParsedSpec, W as RedosFinding, X as RedosResult, Y as RedosSeverity, Z as RegexError, _ as RegexFlag, $ as RegexMatch, a0 as RegexResult, a1 as RegexSuccess, a2 as SQL_DEFAULT_OPTIONS, a3 as Segment, a4 as SpecVersion, a5 as SqlDialect, a6 as SqlFormatOptions, a7 as TestPatternResult, a8 as TsconfigIssue, a9 as TsconfigValidationResult, aa as auditDependencyRanges, ab as buildDockerPull, ac as buildDockerRun, ad as buildGitCommand, ae as collapseHtmlWhitespace, af as collapseJsWhitespace, ag as countProperties, ah as countRules, ai as detectDialect, aj as detectOperationType, ak as detectRedos, al as envToExport, am as envToJson, an as formatCss, ao as formatGql, ap as formatHtml, aq as formatSql, ar as getEndpointsByTag, as as getHtmlStats, at as getJsStats, au as getMethodColor, av as isValidTag, aw as lintConventionalCommit, ax as lookupMime, ay as minifyCss, az as minifyGql, aA as minifyHtml, aB as minifyJs, aC as minifySql, aD as normalizeRef, aE as parseDockerImage, aF as parseEnv, aG as parseGitCommand, aH as parseGithubUrl, aI as parseSpec, aJ as removeConsoleCalls, aK as removeEmptyAttributes, aL as removeHtmlComments, aM as removeJsComments, aN as removeRedundantAttributes, aO as searchCheatsheet, aP as searchEndpoints, aQ as splitStatements, aR as testGitignorePatterns, aS as testPattern, aT as testRegex, aU as validateEditorConfig, aV as validateEnvKey, aW as validatePackageExports, aX as validateTsconfig } from '../code-CKI2Z_NM.cjs';
|
package/dist/tools/code.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { A as ALL_FLAGS, a as ApiEndpoint, b as ApiInfo, C as CHEATSHEET, d as CheatsheetEntry, e as ConventionalCommitFinding, f as ConventionalCommitFooter, g as ConventionalCommitOptions, h as ConventionalCommitParsed, i as ConventionalCommitResult, j as ConventionalCommitSeverity, k as CssResult, D as DEFAULT_COMMIT_TYPES, l as DockerImageRef, E as EditorConfigIssue,
|
|
1
|
+
export { A as ALL_FLAGS, a as ApiEndpoint, b as ApiInfo, C as CHEATSHEET, d as CheatsheetEntry, e as ConventionalCommitFinding, f as ConventionalCommitFooter, g as ConventionalCommitOptions, h as ConventionalCommitParsed, i as ConventionalCommitResult, j as ConventionalCommitSeverity, k as CssResult, D as DEFAULT_COMMIT_TYPES, l as DependencyAuditDuplicate, m as DependencyAuditEntry, n as DependencyAuditIssue, o as DependencyAuditResult, p as DependencyRangeType, q as DependencySection, r as DockerImageRef, E as EditorConfigIssue, s as EditorConfigProperty, t as EditorConfigSection, u as EditorConfigValidationResult, v as EnvEntry, w as EnvParseResult, x as ExportsIssue, y as ExportsShape, z as ExportsValidationResult, G as GitCommandConfig, B as GitCommandResult, F as GitOperation, H as GithubUrlInfo, I as GithubUrlType, J as GitignoreTestResult, K as GqlFormatResult, L as HtmlFormatResult, M as HtmlMinifyOptions, N as HtmlMinifyResult, O as JsMinifyOptions, P as JsMinifyResult, Q as MIME_TABLE, R as MatchResult, S as MimeEntry, T as MimeLookupResult, U as OPERATIONS, V as ParsedSpec, W as RedosFinding, X as RedosResult, Y as RedosSeverity, Z as RegexError, _ as RegexFlag, $ as RegexMatch, a0 as RegexResult, a1 as RegexSuccess, a2 as SQL_DEFAULT_OPTIONS, a3 as Segment, a4 as SpecVersion, a5 as SqlDialect, a6 as SqlFormatOptions, a7 as TestPatternResult, a8 as TsconfigIssue, a9 as TsconfigValidationResult, aa as auditDependencyRanges, ab as buildDockerPull, ac as buildDockerRun, ad as buildGitCommand, ae as collapseHtmlWhitespace, af as collapseJsWhitespace, ag as countProperties, ah as countRules, ai as detectDialect, aj as detectOperationType, ak as detectRedos, al as envToExport, am as envToJson, an as formatCss, ao as formatGql, ap as formatHtml, aq as formatSql, ar as getEndpointsByTag, as as getHtmlStats, at as getJsStats, au as getMethodColor, av as isValidTag, aw as lintConventionalCommit, ax as lookupMime, ay as minifyCss, az as minifyGql, aA as minifyHtml, aB as minifyJs, aC as minifySql, aD as normalizeRef, aE as parseDockerImage, aF as parseEnv, aG as parseGitCommand, aH as parseGithubUrl, aI as parseSpec, aJ as removeConsoleCalls, aK as removeEmptyAttributes, aL as removeHtmlComments, aM as removeJsComments, aN as removeRedundantAttributes, aO as searchCheatsheet, aP as searchEndpoints, aQ as splitStatements, aR as testGitignorePatterns, aS as testPattern, aT as testRegex, aU as validateEditorConfig, aV as validateEnvKey, aW as validatePackageExports, aX as validateTsconfig } from '../code-CKI2Z_NM.js';
|
package/dist/tools/code.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { ALL_FLAGS, CHEATSHEET, DEFAULT_COMMIT_TYPES, MIME_TABLE, OPERATIONS, SQL_DEFAULT_OPTIONS, buildDockerPull, buildDockerRun, buildGitCommand, collapseHtmlWhitespace, collapseJsWhitespace, countProperties, countRules, detectDialect, detectOperationType, detectRedos, envToExport, envToJson, formatCss, formatGql, formatHtml, formatSql, getEndpointsByTag, getHtmlStats, getJsStats, getMethodColor, isValidTag, lintConventionalCommit, lookupMime, minifyCss, minifyGql, minifyHtml, minifyJs, minifySql, normalizeRef, parseDockerImage, parseEnv, parseGitCommand, parseGithubUrl, parseSpec, removeConsoleCalls, removeEmptyAttributes, removeHtmlComments, removeJsComments, removeRedundantAttributes, searchCheatsheet, searchEndpoints, splitStatements, testGitignorePatterns, testPattern, testRegex, validateEditorConfig, validateEnvKey, validatePackageExports, validateTsconfig } from '../chunk-
|
|
1
|
+
export { ALL_FLAGS, CHEATSHEET, DEFAULT_COMMIT_TYPES, MIME_TABLE, OPERATIONS, SQL_DEFAULT_OPTIONS, auditDependencyRanges, buildDockerPull, buildDockerRun, buildGitCommand, collapseHtmlWhitespace, collapseJsWhitespace, countProperties, countRules, detectDialect, detectOperationType, detectRedos, envToExport, envToJson, formatCss, formatGql, formatHtml, formatSql, getEndpointsByTag, getHtmlStats, getJsStats, getMethodColor, isValidTag, lintConventionalCommit, lookupMime, minifyCss, minifyGql, minifyHtml, minifyJs, minifySql, normalizeRef, parseDockerImage, parseEnv, parseGitCommand, parseGithubUrl, parseSpec, removeConsoleCalls, removeEmptyAttributes, removeHtmlComments, removeJsComments, removeRedundantAttributes, searchCheatsheet, searchEndpoints, splitStatements, testGitignorePatterns, testPattern, testRegex, validateEditorConfig, validateEnvKey, validatePackageExports, validateTsconfig } from '../chunk-JPFHEZ4P.js';
|
|
2
2
|
import '../chunk-MLKGABMK.js';
|
package/dist/tools/network.cjs
CHANGED
|
@@ -3042,6 +3042,54 @@ function lookupCloseCode(code) {
|
|
|
3042
3042
|
}
|
|
3043
3043
|
return { error: `${code} is outside the defined close code ranges (0-4999); codes 5000 and above have no assigned meaning` };
|
|
3044
3044
|
}
|
|
3045
|
+
function extractMultipartBoundary(contentType) {
|
|
3046
|
+
if (!contentType) return null;
|
|
3047
|
+
const match = contentType.match(/boundary=(?:"([^"]*)"|([^;\s]+))/i);
|
|
3048
|
+
if (!match) return null;
|
|
3049
|
+
return match[1] ?? match[2] ?? null;
|
|
3050
|
+
}
|
|
3051
|
+
function parseMultipartFormData(body, boundary) {
|
|
3052
|
+
if (!body || !body.trim()) return { error: "Body is empty" };
|
|
3053
|
+
if (!boundary || !boundary.trim()) return { error: "Boundary is required" };
|
|
3054
|
+
const normalized = body.replace(/\r\n/g, "\n");
|
|
3055
|
+
const delimiter = `--${boundary}`;
|
|
3056
|
+
const segments = normalized.split(delimiter);
|
|
3057
|
+
if (segments.length < 3) {
|
|
3058
|
+
return { error: `No parts found for boundary "${boundary}"; check that it matches the boundary used in the body` };
|
|
3059
|
+
}
|
|
3060
|
+
const parts = [];
|
|
3061
|
+
for (let i = 1; i < segments.length; i++) {
|
|
3062
|
+
let segment = segments[i];
|
|
3063
|
+
if (segment.startsWith("--")) break;
|
|
3064
|
+
segment = segment.replace(/^\n/, "").replace(/\n$/, "");
|
|
3065
|
+
const headerEnd = segment.indexOf("\n\n");
|
|
3066
|
+
if (headerEnd === -1) continue;
|
|
3067
|
+
const headerBlock = segment.slice(0, headerEnd);
|
|
3068
|
+
const value = segment.slice(headerEnd + 2);
|
|
3069
|
+
const headers = {};
|
|
3070
|
+
for (const line of headerBlock.split("\n")) {
|
|
3071
|
+
const colon = line.indexOf(":");
|
|
3072
|
+
if (colon === -1) continue;
|
|
3073
|
+
headers[line.slice(0, colon).trim().toLowerCase()] = line.slice(colon + 1).trim();
|
|
3074
|
+
}
|
|
3075
|
+
const disposition = headers["content-disposition"] ?? "";
|
|
3076
|
+
const nameMatch = disposition.match(/name="([^"]*)"/);
|
|
3077
|
+
const filenameMatch = disposition.match(/filename="([^"]*)"/);
|
|
3078
|
+
const partContentType = headers["content-type"] ?? "";
|
|
3079
|
+
const isBinary = !!filenameMatch && !partContentType.startsWith("text/") && !partContentType.includes("json") && !partContentType.includes("xml");
|
|
3080
|
+
parts.push({
|
|
3081
|
+
name: nameMatch ? nameMatch[1] : null,
|
|
3082
|
+
filename: filenameMatch ? filenameMatch[1] : null,
|
|
3083
|
+
headers,
|
|
3084
|
+
value,
|
|
3085
|
+
isBinary
|
|
3086
|
+
});
|
|
3087
|
+
}
|
|
3088
|
+
if (parts.length === 0) {
|
|
3089
|
+
return { error: `No parts found for boundary "${boundary}"; check that it matches the boundary used in the body` };
|
|
3090
|
+
}
|
|
3091
|
+
return { boundary, parts };
|
|
3092
|
+
}
|
|
3045
3093
|
|
|
3046
3094
|
exports.CLIENT_HINTS = CLIENT_HINTS;
|
|
3047
3095
|
exports.DNS_RECORD_TYPES = DNS_RECORD_TYPES;
|
|
@@ -3071,6 +3119,7 @@ exports.buildVaryHeader = buildVaryHeader;
|
|
|
3071
3119
|
exports.buildXContentTypeOptionsHeader = buildXContentTypeOptionsHeader;
|
|
3072
3120
|
exports.checkSetCookieHeader = checkSetCookieHeader;
|
|
3073
3121
|
exports.countryCodeToFlag = countryCodeToFlag;
|
|
3122
|
+
exports.extractMultipartBoundary = extractMultipartBoundary;
|
|
3074
3123
|
exports.formatCoordinates = formatCoordinates;
|
|
3075
3124
|
exports.formatTtl = formatTtl;
|
|
3076
3125
|
exports.getByCategory = getByCategory;
|
|
@@ -3094,6 +3143,7 @@ exports.parseDnsResponse = parseDnsResponse;
|
|
|
3094
3143
|
exports.parseGeoResponse = parseGeoResponse;
|
|
3095
3144
|
exports.parseHar = parseHar;
|
|
3096
3145
|
exports.parseIpv6Address = parseIpv6Address;
|
|
3146
|
+
exports.parseMultipartFormData = parseMultipartFormData;
|
|
3097
3147
|
exports.parsePermissionsPolicy = parsePermissionsPolicy;
|
|
3098
3148
|
exports.parsePreferHeader = parsePreferHeader;
|
|
3099
3149
|
exports.parsePriorityHeader = parsePriorityHeader;
|
package/dist/tools/network.d.cts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { A as AcceptLanguageEntry, a as AcceptLanguageResult, b as AuthResultEntry, B as BuildRangeHeaderOptions, C as CLIENT_HINTS, c as CacheControlDirective, d as CacheControlOptions, e as CacheControlResult, f as ClientHintDef, g as ClientHintValueType, h as ClientHintsBuildResult, i as ClientHintsParseResult, j as CloseCodeInfo, k as CloseCodeRange, l as ContentDispositionBuildOptions, m as ContentDispositionBuildResult, o as ContentDispositionParseResult, p as ContentRangeResult, q as ContentTypeRiskResult, r as ContentTypeSniffRisk, s as CookieAttributes, t as CookieCheckResult, D as DNS_RECORD_TYPES, u as DnsRecord, v as DnsRecordType, w as DnsResponse, E as EmailHeaderAnalysis, x as EmailHeaderField, G as GeoResult, H as HTTP_HEADERS, y as HarEntry, z as HarParseResult, F as HarSummary, I as HeaderCategory, J as HttpHeader, K as Ipv6AddressType, L as Ipv6ParseResult, M as LINK_REL_VALUES, N as LinkHeaderEntry, O as LinkHeaderEntryInput, P as LinkHeaderResult, Q as LinkRel, R as ManifestIconInfo, S as ManifestIssue, T as ManifestValidationResult, U as
|
|
1
|
+
export { A as AcceptLanguageEntry, a as AcceptLanguageResult, b as AuthResultEntry, B as BuildRangeHeaderOptions, C as CLIENT_HINTS, c as CacheControlDirective, d as CacheControlOptions, e as CacheControlResult, f as ClientHintDef, g as ClientHintValueType, h as ClientHintsBuildResult, i as ClientHintsParseResult, j as CloseCodeInfo, k as CloseCodeRange, l as ContentDispositionBuildOptions, m as ContentDispositionBuildResult, o as ContentDispositionParseResult, p as ContentRangeResult, q as ContentTypeRiskResult, r as ContentTypeSniffRisk, s as CookieAttributes, t as CookieCheckResult, D as DNS_RECORD_TYPES, u as DnsRecord, v as DnsRecordType, w as DnsResponse, E as EmailHeaderAnalysis, x as EmailHeaderField, G as GeoResult, H as HTTP_HEADERS, y as HarEntry, z as HarParseResult, F as HarSummary, I as HeaderCategory, J as HttpHeader, K as Ipv6AddressType, L as Ipv6ParseResult, M as LINK_REL_VALUES, N as LinkHeaderEntry, O as LinkHeaderEntryInput, P as LinkHeaderResult, Q as LinkRel, R as ManifestIconInfo, S as ManifestIssue, T as ManifestValidationResult, U as MultipartParseResult, V as MultipartPart, W as PERMISSIONS_POLICY_FEATURES, X as ParsedClientHint, Y as ParsedDnsResult, Z as ParsedGeoResult, _ as PermissionsPolicyDirective, $ as PermissionsPolicyFeatureInput, a0 as PermissionsPolicyResult, a1 as PreferParameter, a2 as PreferPreference, a3 as PreferResult, a4 as PriorityResult, a5 as REFERRER_POLICY_VALUES, a6 as RangeEntry, a7 as RangeEntryInput, a8 as RangeHeaderResult, a9 as ReceivedHop, aa as ReferrerPolicyEntry, ab as ReferrerPolicyResult, ac as ReferrerPolicyValue, ad as RetryAfterDateResult, ae as RetryAfterResult, af as RetryAfterSecondsResult, ag as RobotsGroup, ah as RobotsIssue, ai as RobotsRule, aj as RobotsValidationResult, ak as STATUS_CODES, al as SameSiteValue, am as SitemapIndexEntry, an as SitemapIssue, ao as SitemapSplitFile, ap as SitemapUrlEntry, aq as SitemapValidationResult, ar as SplitSitemapOptions, as as SplitSitemapResult, at as StatusCode, au as UaDeviceType, av as UserAgentInfo, aw as VaryHeaderEntry, ax as VaryHeaderResult, ay as XContentTypeOptionsHeader, az as XContentTypeOptionsParseResult, aA as X_CONTENT_TYPE_OPTIONS_HEADER, aB as analyzeEmailHeaders, aC as assessContentTypeRisk, aD as buildAcceptLanguage, aE as buildCacheControl, aF as buildClientHints, aG as buildContentDisposition, aH as buildDnsQueryUrl, aI as buildGeoUrl, aJ as buildLinkHeader, aK as buildMapUrl, aL as buildPermissionsPolicy, aM as buildPreferHeader, aN as buildPriorityHeader, aO as buildRangeHeader, aP as buildReferrerPolicy, aQ as buildRetryAfterHeader, aR as buildVaryHeader, aS as buildXContentTypeOptionsHeader, aT as checkSetCookieHeader, aU as countryCodeToFlag, aV as extractMultipartBoundary, aW as formatCoordinates, aX as formatTtl, aY as getByCategory, aZ as getHeader, a_ as getHeadersByCategory, a$ as getStatusByCategory, b0 as getStatusCode, b1 as isClientError, b2 as isServerError, b3 as isSuccess, b4 as isValidIp, b5 as isValidIpv4, b6 as isValidIpv6, b7 as listCloseCodes, b8 as lookupCloseCode, b9 as parseAcceptLanguage, ba as parseClientHintHeaders, bb as parseContentDisposition, bc as parseContentRangeHeader, bd as parseDnsResponse, be as parseGeoResponse, bf as parseHar, bg as parseIpv6Address, bh as parseMultipartFormData, bi as parsePermissionsPolicy, bj as parsePreferHeader, bk as parsePriorityHeader, bl as parseRetryAfterHeader, bm as parseUserAgent, bn as parseVaryHeader, bo as parseXContentTypeOptionsHeader, bp as searchHeaders, bq as searchStatusCodes, br as splitSitemap, bs as statusCodeToText, bt as typeNumberToLabel, bu as validateDomain, bv as validateHeaderName, bw as validateHeaderValue, bx as validateManifest, by as validateRobotsTxt, bz as validateSitemap } from '../network-DZTfMAk0.cjs';
|
package/dist/tools/network.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { A as AcceptLanguageEntry, a as AcceptLanguageResult, b as AuthResultEntry, B as BuildRangeHeaderOptions, C as CLIENT_HINTS, c as CacheControlDirective, d as CacheControlOptions, e as CacheControlResult, f as ClientHintDef, g as ClientHintValueType, h as ClientHintsBuildResult, i as ClientHintsParseResult, j as CloseCodeInfo, k as CloseCodeRange, l as ContentDispositionBuildOptions, m as ContentDispositionBuildResult, o as ContentDispositionParseResult, p as ContentRangeResult, q as ContentTypeRiskResult, r as ContentTypeSniffRisk, s as CookieAttributes, t as CookieCheckResult, D as DNS_RECORD_TYPES, u as DnsRecord, v as DnsRecordType, w as DnsResponse, E as EmailHeaderAnalysis, x as EmailHeaderField, G as GeoResult, H as HTTP_HEADERS, y as HarEntry, z as HarParseResult, F as HarSummary, I as HeaderCategory, J as HttpHeader, K as Ipv6AddressType, L as Ipv6ParseResult, M as LINK_REL_VALUES, N as LinkHeaderEntry, O as LinkHeaderEntryInput, P as LinkHeaderResult, Q as LinkRel, R as ManifestIconInfo, S as ManifestIssue, T as ManifestValidationResult, U as
|
|
1
|
+
export { A as AcceptLanguageEntry, a as AcceptLanguageResult, b as AuthResultEntry, B as BuildRangeHeaderOptions, C as CLIENT_HINTS, c as CacheControlDirective, d as CacheControlOptions, e as CacheControlResult, f as ClientHintDef, g as ClientHintValueType, h as ClientHintsBuildResult, i as ClientHintsParseResult, j as CloseCodeInfo, k as CloseCodeRange, l as ContentDispositionBuildOptions, m as ContentDispositionBuildResult, o as ContentDispositionParseResult, p as ContentRangeResult, q as ContentTypeRiskResult, r as ContentTypeSniffRisk, s as CookieAttributes, t as CookieCheckResult, D as DNS_RECORD_TYPES, u as DnsRecord, v as DnsRecordType, w as DnsResponse, E as EmailHeaderAnalysis, x as EmailHeaderField, G as GeoResult, H as HTTP_HEADERS, y as HarEntry, z as HarParseResult, F as HarSummary, I as HeaderCategory, J as HttpHeader, K as Ipv6AddressType, L as Ipv6ParseResult, M as LINK_REL_VALUES, N as LinkHeaderEntry, O as LinkHeaderEntryInput, P as LinkHeaderResult, Q as LinkRel, R as ManifestIconInfo, S as ManifestIssue, T as ManifestValidationResult, U as MultipartParseResult, V as MultipartPart, W as PERMISSIONS_POLICY_FEATURES, X as ParsedClientHint, Y as ParsedDnsResult, Z as ParsedGeoResult, _ as PermissionsPolicyDirective, $ as PermissionsPolicyFeatureInput, a0 as PermissionsPolicyResult, a1 as PreferParameter, a2 as PreferPreference, a3 as PreferResult, a4 as PriorityResult, a5 as REFERRER_POLICY_VALUES, a6 as RangeEntry, a7 as RangeEntryInput, a8 as RangeHeaderResult, a9 as ReceivedHop, aa as ReferrerPolicyEntry, ab as ReferrerPolicyResult, ac as ReferrerPolicyValue, ad as RetryAfterDateResult, ae as RetryAfterResult, af as RetryAfterSecondsResult, ag as RobotsGroup, ah as RobotsIssue, ai as RobotsRule, aj as RobotsValidationResult, ak as STATUS_CODES, al as SameSiteValue, am as SitemapIndexEntry, an as SitemapIssue, ao as SitemapSplitFile, ap as SitemapUrlEntry, aq as SitemapValidationResult, ar as SplitSitemapOptions, as as SplitSitemapResult, at as StatusCode, au as UaDeviceType, av as UserAgentInfo, aw as VaryHeaderEntry, ax as VaryHeaderResult, ay as XContentTypeOptionsHeader, az as XContentTypeOptionsParseResult, aA as X_CONTENT_TYPE_OPTIONS_HEADER, aB as analyzeEmailHeaders, aC as assessContentTypeRisk, aD as buildAcceptLanguage, aE as buildCacheControl, aF as buildClientHints, aG as buildContentDisposition, aH as buildDnsQueryUrl, aI as buildGeoUrl, aJ as buildLinkHeader, aK as buildMapUrl, aL as buildPermissionsPolicy, aM as buildPreferHeader, aN as buildPriorityHeader, aO as buildRangeHeader, aP as buildReferrerPolicy, aQ as buildRetryAfterHeader, aR as buildVaryHeader, aS as buildXContentTypeOptionsHeader, aT as checkSetCookieHeader, aU as countryCodeToFlag, aV as extractMultipartBoundary, aW as formatCoordinates, aX as formatTtl, aY as getByCategory, aZ as getHeader, a_ as getHeadersByCategory, a$ as getStatusByCategory, b0 as getStatusCode, b1 as isClientError, b2 as isServerError, b3 as isSuccess, b4 as isValidIp, b5 as isValidIpv4, b6 as isValidIpv6, b7 as listCloseCodes, b8 as lookupCloseCode, b9 as parseAcceptLanguage, ba as parseClientHintHeaders, bb as parseContentDisposition, bc as parseContentRangeHeader, bd as parseDnsResponse, be as parseGeoResponse, bf as parseHar, bg as parseIpv6Address, bh as parseMultipartFormData, bi as parsePermissionsPolicy, bj as parsePreferHeader, bk as parsePriorityHeader, bl as parseRetryAfterHeader, bm as parseUserAgent, bn as parseVaryHeader, bo as parseXContentTypeOptionsHeader, bp as searchHeaders, bq as searchStatusCodes, br as splitSitemap, bs as statusCodeToText, bt as typeNumberToLabel, bu as validateDomain, bv as validateHeaderName, bw as validateHeaderValue, bx as validateManifest, by as validateRobotsTxt, bz as validateSitemap } from '../network-DZTfMAk0.js';
|
package/dist/tools/network.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { CLIENT_HINTS, DNS_RECORD_TYPES, HTTP_HEADERS, LINK_REL_VALUES, PERMISSIONS_POLICY_FEATURES, REFERRER_POLICY_VALUES, STATUS_CODES, X_CONTENT_TYPE_OPTIONS_HEADER, analyzeEmailHeaders, assessContentTypeRisk, buildAcceptLanguage, buildCacheControl, buildClientHints, buildContentDisposition, buildDnsQueryUrl, buildGeoUrl, buildLinkHeader, buildMapUrl, buildPermissionsPolicy, buildPreferHeader, buildPriorityHeader, buildRangeHeader, buildReferrerPolicy, buildRetryAfterHeader, buildVaryHeader, buildXContentTypeOptionsHeader, checkSetCookieHeader, countryCodeToFlag, formatCoordinates, formatTtl, getByCategory, getHeader, getHeadersByCategory, getStatusByCategory, getStatusCode, isClientError, isServerError, isSuccess, isValidIp, isValidIpv4, isValidIpv6, listCloseCodes, lookupCloseCode, parseAcceptLanguage, parseClientHintHeaders, parseContentDisposition, parseContentRangeHeader, parseDnsResponse, parseGeoResponse, parseHar, parseIpv6Address, parsePermissionsPolicy, parsePreferHeader, parsePriorityHeader, parseRetryAfterHeader, parseUserAgent, parseVaryHeader, parseXContentTypeOptionsHeader, searchHeaders, searchStatusCodes, splitSitemap, statusCodeToText, typeNumberToLabel, validateDomain, validateHeaderName, validateHeaderValue, validateManifest, validateRobotsTxt, validateSitemap } from '../chunk-
|
|
1
|
+
export { CLIENT_HINTS, DNS_RECORD_TYPES, HTTP_HEADERS, LINK_REL_VALUES, PERMISSIONS_POLICY_FEATURES, REFERRER_POLICY_VALUES, STATUS_CODES, X_CONTENT_TYPE_OPTIONS_HEADER, analyzeEmailHeaders, assessContentTypeRisk, buildAcceptLanguage, buildCacheControl, buildClientHints, buildContentDisposition, buildDnsQueryUrl, buildGeoUrl, buildLinkHeader, buildMapUrl, buildPermissionsPolicy, buildPreferHeader, buildPriorityHeader, buildRangeHeader, buildReferrerPolicy, buildRetryAfterHeader, buildVaryHeader, buildXContentTypeOptionsHeader, checkSetCookieHeader, countryCodeToFlag, extractMultipartBoundary, formatCoordinates, formatTtl, getByCategory, getHeader, getHeadersByCategory, getStatusByCategory, getStatusCode, isClientError, isServerError, isSuccess, isValidIp, isValidIpv4, isValidIpv6, listCloseCodes, lookupCloseCode, parseAcceptLanguage, parseClientHintHeaders, parseContentDisposition, parseContentRangeHeader, parseDnsResponse, parseGeoResponse, parseHar, parseIpv6Address, parseMultipartFormData, parsePermissionsPolicy, parsePreferHeader, parsePriorityHeader, parseRetryAfterHeader, parseUserAgent, parseVaryHeader, parseXContentTypeOptionsHeader, searchHeaders, searchStatusCodes, splitSitemap, statusCodeToText, typeNumberToLabel, validateDomain, validateHeaderName, validateHeaderValue, validateManifest, validateRobotsTxt, validateSitemap } from '../chunk-IANBS5Y3.js';
|
|
2
2
|
import '../chunk-MLKGABMK.js';
|
package/dist/tools/units.cjs
CHANGED
|
@@ -2279,6 +2279,126 @@ function calculateFreelancerRate(input) {
|
|
|
2279
2279
|
monthlyRevenueTarget: round22(requiredAnnualRevenue / 12)
|
|
2280
2280
|
};
|
|
2281
2281
|
}
|
|
2282
|
+
var DEBT_PAYOFF_MAX_MONTHS = 1200;
|
|
2283
|
+
function _simulateDebtPayoff(debts, order, extraMonthlyPayment) {
|
|
2284
|
+
const round22 = (n) => Math.round(n * 100) / 100;
|
|
2285
|
+
const balances = debts.map((d) => d.balance);
|
|
2286
|
+
const totalMinPayment = debts.reduce((sum, d) => sum + d.minPayment, 0);
|
|
2287
|
+
const totalBudget = totalMinPayment + extraMonthlyPayment;
|
|
2288
|
+
let totalInterestPaid = 0;
|
|
2289
|
+
let totalPaid = 0;
|
|
2290
|
+
const schedule = [];
|
|
2291
|
+
let month = 0;
|
|
2292
|
+
while (balances.some((b) => b > 5e-3) && month < DEBT_PAYOFF_MAX_MONTHS) {
|
|
2293
|
+
month++;
|
|
2294
|
+
for (let i = 0; i < balances.length; i++) {
|
|
2295
|
+
if (balances[i] <= 0) continue;
|
|
2296
|
+
const interest = balances[i] * debts[i].ratePercent / 100 / 12;
|
|
2297
|
+
balances[i] += interest;
|
|
2298
|
+
totalInterestPaid += interest;
|
|
2299
|
+
}
|
|
2300
|
+
let remainingBudget = totalBudget;
|
|
2301
|
+
for (let i = 0; i < balances.length; i++) {
|
|
2302
|
+
if (balances[i] <= 0) continue;
|
|
2303
|
+
const pay = Math.min(balances[i], debts[i].minPayment);
|
|
2304
|
+
balances[i] -= pay;
|
|
2305
|
+
remainingBudget -= pay;
|
|
2306
|
+
totalPaid += pay;
|
|
2307
|
+
}
|
|
2308
|
+
for (const i of order) {
|
|
2309
|
+
if (remainingBudget <= 0) break;
|
|
2310
|
+
if (balances[i] <= 0) continue;
|
|
2311
|
+
const pay = Math.min(balances[i], remainingBudget);
|
|
2312
|
+
balances[i] -= pay;
|
|
2313
|
+
remainingBudget -= pay;
|
|
2314
|
+
totalPaid += pay;
|
|
2315
|
+
}
|
|
2316
|
+
for (const i of order) {
|
|
2317
|
+
if (balances[i] <= 5e-3 && !schedule.some((s) => s.label === debts[i].label)) {
|
|
2318
|
+
schedule.push({ label: debts[i].label, monthPaidOff: month });
|
|
2319
|
+
}
|
|
2320
|
+
}
|
|
2321
|
+
}
|
|
2322
|
+
if (balances.some((b) => b > 5e-3)) return null;
|
|
2323
|
+
return {
|
|
2324
|
+
order: order.map((i) => debts[i].label),
|
|
2325
|
+
monthsToPayoff: month,
|
|
2326
|
+
totalInterestPaid: round22(totalInterestPaid),
|
|
2327
|
+
totalPaid: round22(totalPaid),
|
|
2328
|
+
schedule
|
|
2329
|
+
};
|
|
2330
|
+
}
|
|
2331
|
+
function planDebtPayoff(debts, extraMonthlyPayment = 0) {
|
|
2332
|
+
if (!Array.isArray(debts) || debts.length === 0) {
|
|
2333
|
+
return { error: "debts must be a non-empty array" };
|
|
2334
|
+
}
|
|
2335
|
+
if (!Number.isFinite(extraMonthlyPayment) || extraMonthlyPayment < 0) {
|
|
2336
|
+
return { error: "extraMonthlyPayment must be a finite, non-negative number" };
|
|
2337
|
+
}
|
|
2338
|
+
const normalized = [];
|
|
2339
|
+
for (let i = 0; i < debts.length; i++) {
|
|
2340
|
+
const d = debts[i];
|
|
2341
|
+
if (typeof d.balance !== "number" || !Number.isFinite(d.balance) || d.balance <= 0) {
|
|
2342
|
+
return { error: `debt ${i + 1}: balance must be a finite number greater than zero` };
|
|
2343
|
+
}
|
|
2344
|
+
if (typeof d.ratePercent !== "number" || !Number.isFinite(d.ratePercent) || d.ratePercent < 0) {
|
|
2345
|
+
return { error: `debt ${i + 1}: ratePercent must be a finite, non-negative number` };
|
|
2346
|
+
}
|
|
2347
|
+
if (typeof d.minPayment !== "number" || !Number.isFinite(d.minPayment) || d.minPayment <= 0) {
|
|
2348
|
+
return { error: `debt ${i + 1}: minPayment must be a finite number greater than zero` };
|
|
2349
|
+
}
|
|
2350
|
+
normalized.push({
|
|
2351
|
+
label: d.label?.trim() || `Debt ${i + 1}`,
|
|
2352
|
+
balance: d.balance,
|
|
2353
|
+
ratePercent: d.ratePercent,
|
|
2354
|
+
minPayment: d.minPayment
|
|
2355
|
+
});
|
|
2356
|
+
}
|
|
2357
|
+
const snowballOrder = normalized.map((_, i) => i).sort((a, b) => normalized[a].balance - normalized[b].balance);
|
|
2358
|
+
const avalancheOrder = normalized.map((_, i) => i).sort((a, b) => normalized[b].ratePercent - normalized[a].ratePercent);
|
|
2359
|
+
const snowball = _simulateDebtPayoff(normalized, snowballOrder, extraMonthlyPayment);
|
|
2360
|
+
const avalanche = _simulateDebtPayoff(normalized, avalancheOrder, extraMonthlyPayment);
|
|
2361
|
+
if (!snowball || !avalanche) {
|
|
2362
|
+
return { error: `debts cannot be paid off within ${DEBT_PAYOFF_MAX_MONTHS} months at this payment level; increase a minimum payment or the extra monthly payment` };
|
|
2363
|
+
}
|
|
2364
|
+
const round22 = (n) => Math.round(n * 100) / 100;
|
|
2365
|
+
const monthsDifference = Math.abs(snowball.monthsToPayoff - avalanche.monthsToPayoff);
|
|
2366
|
+
const interestDifference = round22(Math.abs(snowball.totalInterestPaid - avalanche.totalInterestPaid));
|
|
2367
|
+
return {
|
|
2368
|
+
debts: normalized,
|
|
2369
|
+
totalMonthlyBudget: round22(normalized.reduce((sum, d) => sum + d.minPayment, 0) + extraMonthlyPayment),
|
|
2370
|
+
extraMonthlyPayment,
|
|
2371
|
+
snowball,
|
|
2372
|
+
avalanche,
|
|
2373
|
+
comparison: {
|
|
2374
|
+
fasterStrategy: snowball.monthsToPayoff === avalanche.monthsToPayoff ? "tie" : snowball.monthsToPayoff < avalanche.monthsToPayoff ? "snowball" : "avalanche",
|
|
2375
|
+
monthsDifference,
|
|
2376
|
+
cheaperStrategy: snowball.totalInterestPaid === avalanche.totalInterestPaid ? "tie" : snowball.totalInterestPaid < avalanche.totalInterestPaid ? "snowball" : "avalanche",
|
|
2377
|
+
interestDifference
|
|
2378
|
+
}
|
|
2379
|
+
};
|
|
2380
|
+
}
|
|
2381
|
+
function calculateLoanRefinance(currentBalance, currentRatePercent, currentRemainingMonths, newRatePercent, newTermMonths, closingCosts) {
|
|
2382
|
+
const current = calculateLoan(currentBalance, currentRatePercent, currentRemainingMonths);
|
|
2383
|
+
if ("error" in current) return current;
|
|
2384
|
+
const refinanced = calculateLoan(currentBalance, newRatePercent, newTermMonths);
|
|
2385
|
+
if ("error" in refinanced) return refinanced;
|
|
2386
|
+
if (!Number.isFinite(closingCosts) || closingCosts < 0) {
|
|
2387
|
+
return { error: "Closing costs must be zero or a positive number" };
|
|
2388
|
+
}
|
|
2389
|
+
const monthlySavings = round2(current.monthlyPayment - refinanced.monthlyPayment);
|
|
2390
|
+
const breakEvenMonths = monthlySavings > 0 ? Math.ceil(closingCosts / monthlySavings) : null;
|
|
2391
|
+
return {
|
|
2392
|
+
currentMonthlyPayment: current.monthlyPayment,
|
|
2393
|
+
newMonthlyPayment: refinanced.monthlyPayment,
|
|
2394
|
+
monthlySavings,
|
|
2395
|
+
closingCosts: round2(closingCosts),
|
|
2396
|
+
breakEvenMonths,
|
|
2397
|
+
currentTotalInterest: current.totalInterest,
|
|
2398
|
+
newTotalInterest: refinanced.totalInterest,
|
|
2399
|
+
totalInterestSavings: round2(current.totalInterest - refinanced.totalInterest)
|
|
2400
|
+
};
|
|
2401
|
+
}
|
|
2282
2402
|
|
|
2283
2403
|
exports.BASE_LABELS = BASE_LABELS;
|
|
2284
2404
|
exports.BASE_PREFIXES = BASE_PREFIXES;
|
|
@@ -2314,6 +2434,7 @@ exports.calculateExtraPaymentPayoff = calculateExtraPaymentPayoff;
|
|
|
2314
2434
|
exports.calculateFreelancerRate = calculateFreelancerRate;
|
|
2315
2435
|
exports.calculateGpa = calculateGpa;
|
|
2316
2436
|
exports.calculateLoan = calculateLoan;
|
|
2437
|
+
exports.calculateLoanRefinance = calculateLoanRefinance;
|
|
2317
2438
|
exports.calculateMarginMarkup = calculateMarginMarkup;
|
|
2318
2439
|
exports.calculateMovingAverages = calculateMovingAverages;
|
|
2319
2440
|
exports.calculatePaybackPeriod = calculatePaybackPeriod;
|
|
@@ -2364,6 +2485,7 @@ exports.parseSemver = parseSemver;
|
|
|
2364
2485
|
exports.permissionsToChmod = permissionsToChmod;
|
|
2365
2486
|
exports.permissionsToOctal = permissionsToOctal;
|
|
2366
2487
|
exports.permissionsToSymbolic = permissionsToSymbolic;
|
|
2488
|
+
exports.planDebtPayoff = planDebtPayoff;
|
|
2367
2489
|
exports.ptToPx = ptToPx;
|
|
2368
2490
|
exports.pxToAll = pxToAll;
|
|
2369
2491
|
exports.pxToViewport = pxToViewport;
|
package/dist/tools/units.d.cts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { A as AmortizationRow, a as AprApyDirection, b as AprApyResult, c as AspectRatioResult, B as BASE_LABELS, d as BASE_PREFIXES, e as BYTE_UNITS, f as BarcodeFormat, g as BarcodeValidationResult, h as BaseConvertResult, i as BlendedLoanRateResult, j as BreakEvenInput, k as BreakEvenResult, l as ByteConvertResult, m as ByteUnit, C as COMMON_CURRENCIES, n as COMMON_LOCALES, o as COMMON_PERMISSIONS, p as COMMON_RATIOS, q as COMMON_SIZES, r as COMMON_TAX_RATES, s as COMMON_TIP_PERCENTAGES, t as COMMON_VIEWPORTS, v as CardValidationResult, w as CashBreakdownResult, x as CashChangeResult, y as CashDenominationItem, z as CashRoundingMode, D as CashRoundingResult, E as CdMaturityResult, F as CompareUnitPricesResult, G as CompoundInterestResult, H as CompoundYearRow, I as CreditAccountInput, J as CreditAccountResult, K as CreditUtilizationResult, L as DebtItemInput, M as DebtItemResult, N as
|
|
1
|
+
export { A as AmortizationRow, a as AprApyDirection, b as AprApyResult, c as AspectRatioResult, B as BASE_LABELS, d as BASE_PREFIXES, e as BYTE_UNITS, f as BarcodeFormat, g as BarcodeValidationResult, h as BaseConvertResult, i as BlendedLoanRateResult, j as BreakEvenInput, k as BreakEvenResult, l as ByteConvertResult, m as ByteUnit, C as COMMON_CURRENCIES, n as COMMON_LOCALES, o as COMMON_PERMISSIONS, p as COMMON_RATIOS, q as COMMON_SIZES, r as COMMON_TAX_RATES, s as COMMON_TIP_PERCENTAGES, t as COMMON_VIEWPORTS, v as CardValidationResult, w as CashBreakdownResult, x as CashChangeResult, y as CashDenominationItem, z as CashRoundingMode, D as CashRoundingResult, E as CdMaturityResult, F as CompareUnitPricesResult, G as CompoundInterestResult, H as CompoundYearRow, I as CreditAccountInput, J as CreditAccountResult, K as CreditUtilizationResult, L as DebtItemInput, M as DebtItemResult, N as DebtPayoffComparison, O as DebtPayoffInput, P as DebtPayoffPlanResult, Q as DebtPayoffScheduleEntry, R as DebtPayoffStrategy, S as DebtPayoffStrategyResult, T as DebtToIncomeRatioResult, U as DepreciationMethod, V as DepreciationResult, W as DepreciationYear, X as Dimensions, Y as DiscountField, Z as DiscountInput, _ as DiscountResult, $ as DtiTier, a0 as EmiResult, a1 as EmiTenureUnit, a2 as EmiYearlyBreakdownRow, a3 as ExtraPaymentPayoffResult, a4 as FilePermissions, a5 as FormatOptions, a6 as FreelancerRateInput, a7 as FreelancerRateResult, a8 as GPA_GRADE_POINTS, a9 as GpaCourse, aa as GpaCourseResult, ab as GpaResult, ac as IbanValidationResult, ad as IpConversion, ae as IsbnFormat, af as IsbnResult, ag as LoanBalanceInput, ah as LoanBalanceResult, ai as LoanRefinanceResult, aj as LoanResult, ak as MarginMarkupField, al as MarginMarkupInput, am as MarginMarkupResult, an as MovingAveragePoint, ao as MovingAverageResult, ap as NotationStyle, aq as NumberBase, ar as PaybackPeriodInput, as as PaybackPeriodResult, at as PercentChangeDirection, au as PercentageChangeResult, av as Permission, aw as PxConvertResult, ax as RoiInput, ay as RoiResult, az as RuleOf72Direction, aA as RuleOf72Result, aB as SavingsGoalInput, aC as SavingsGoalMode, aD as SavingsGoalResult, aE as SemverVersion, aF as SimpleInterestResult, aG as SubnetInfo, aH as SuccessiveDiscountResult, aI as SuccessiveDiscountStep, aJ as TaxDirection, aK as TaxResult, aL as TimeValueDirection, aM as TimeValueResult, aN as TipSplitResult, aO as USD_DENOMINATIONS, aP as UnitPriceItem, aQ as UnitPriceResult, aR as UtilizationTier, aS as VideoBitrateInput, aT as VideoBitrateMode, aU as VideoBitrateResult, aV as ViewportConvertResult, aW as applySuccessiveDiscounts, aX as autoFormat, aY as bumpVersion, aZ as calcAspectRatio, a_ as calcSubnet, a$ as calculateBlendedLoanRate, b0 as calculateBreakEven, b1 as calculateCashBreakdown, b2 as calculateCashRounding, b3 as calculateCdMaturity, b4 as calculateChange, b5 as calculateCompoundInterest, b6 as calculateCreditUtilization, b7 as calculateDebtToIncomeRatio, b8 as calculateDepreciationSchedule, b9 as calculateDiscount, ba as calculateEmi, bb as calculateExtraPaymentPayoff, bc as calculateFreelancerRate, bd as calculateGpa, be as calculateLoan, bf as calculateLoanRefinance, bg as calculateMarginMarkup, bh as calculateMovingAverages, bi as calculatePaybackPeriod, bj as calculatePercentageChange, bk as calculateRoi, bl as calculateRuleOf72, bm as calculateSavingsGoal, bn as calculateSimpleInterest, bo as calculateTax, bp as calculateTimeValue, bq as calculateTipSplit, br as calculateVideoBitrate, bs as compareSemver, bt as compareUnitPrices, bu as convert, bv as convertAprApy, bw as convertBytes, bx as convertIp, by as coverBox, bz as decimalToIp, bA as decimalToIpCidr, bB as describePermissions, bC as fitIntoBox, bD as formatNumber, bE as formatValue, bF as formatVwValue, bG as formatWithSeparator, bH as gcd, bI as ipFromBinary, bJ as ipFromDecimal, bK as ipFromHex, bL as ipToBinary, bM as ipToDecimal, bN as ipToDecimalCidr, bO as ipToHex, bP as ipToOctal, bQ as isValid, bR as isValidCidr, bS as isValidIp, bT as isValidIpv4, bU as marginToMarkup, bV as markupToMargin, bW as octalToPermissions, bX as parseFileSize, bY as parseInput, bZ as parseNumberString, b_ as parseSemver, b$ as permissionsToChmod, c0 as permissionsToOctal, c1 as permissionsToSymbolic, c2 as planDebtPayoff, c3 as ptToPx, c4 as pxToAll, c5 as pxToViewport, c6 as remToPx, c7 as satisfiesRange, c8 as scaleByHeight, c9 as scaleByWidth, ca as sortVersions, cb as splitSubnet, cc as symbolicToPermissions, cd as validateBarcode, ce as validateCardNumber, cf as validateIban, cg as validateIsbn, ch as viewportToPx } from '../units-DPefgzmH.cjs';
|
package/dist/tools/units.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { A as AmortizationRow, a as AprApyDirection, b as AprApyResult, c as AspectRatioResult, B as BASE_LABELS, d as BASE_PREFIXES, e as BYTE_UNITS, f as BarcodeFormat, g as BarcodeValidationResult, h as BaseConvertResult, i as BlendedLoanRateResult, j as BreakEvenInput, k as BreakEvenResult, l as ByteConvertResult, m as ByteUnit, C as COMMON_CURRENCIES, n as COMMON_LOCALES, o as COMMON_PERMISSIONS, p as COMMON_RATIOS, q as COMMON_SIZES, r as COMMON_TAX_RATES, s as COMMON_TIP_PERCENTAGES, t as COMMON_VIEWPORTS, v as CardValidationResult, w as CashBreakdownResult, x as CashChangeResult, y as CashDenominationItem, z as CashRoundingMode, D as CashRoundingResult, E as CdMaturityResult, F as CompareUnitPricesResult, G as CompoundInterestResult, H as CompoundYearRow, I as CreditAccountInput, J as CreditAccountResult, K as CreditUtilizationResult, L as DebtItemInput, M as DebtItemResult, N as
|
|
1
|
+
export { A as AmortizationRow, a as AprApyDirection, b as AprApyResult, c as AspectRatioResult, B as BASE_LABELS, d as BASE_PREFIXES, e as BYTE_UNITS, f as BarcodeFormat, g as BarcodeValidationResult, h as BaseConvertResult, i as BlendedLoanRateResult, j as BreakEvenInput, k as BreakEvenResult, l as ByteConvertResult, m as ByteUnit, C as COMMON_CURRENCIES, n as COMMON_LOCALES, o as COMMON_PERMISSIONS, p as COMMON_RATIOS, q as COMMON_SIZES, r as COMMON_TAX_RATES, s as COMMON_TIP_PERCENTAGES, t as COMMON_VIEWPORTS, v as CardValidationResult, w as CashBreakdownResult, x as CashChangeResult, y as CashDenominationItem, z as CashRoundingMode, D as CashRoundingResult, E as CdMaturityResult, F as CompareUnitPricesResult, G as CompoundInterestResult, H as CompoundYearRow, I as CreditAccountInput, J as CreditAccountResult, K as CreditUtilizationResult, L as DebtItemInput, M as DebtItemResult, N as DebtPayoffComparison, O as DebtPayoffInput, P as DebtPayoffPlanResult, Q as DebtPayoffScheduleEntry, R as DebtPayoffStrategy, S as DebtPayoffStrategyResult, T as DebtToIncomeRatioResult, U as DepreciationMethod, V as DepreciationResult, W as DepreciationYear, X as Dimensions, Y as DiscountField, Z as DiscountInput, _ as DiscountResult, $ as DtiTier, a0 as EmiResult, a1 as EmiTenureUnit, a2 as EmiYearlyBreakdownRow, a3 as ExtraPaymentPayoffResult, a4 as FilePermissions, a5 as FormatOptions, a6 as FreelancerRateInput, a7 as FreelancerRateResult, a8 as GPA_GRADE_POINTS, a9 as GpaCourse, aa as GpaCourseResult, ab as GpaResult, ac as IbanValidationResult, ad as IpConversion, ae as IsbnFormat, af as IsbnResult, ag as LoanBalanceInput, ah as LoanBalanceResult, ai as LoanRefinanceResult, aj as LoanResult, ak as MarginMarkupField, al as MarginMarkupInput, am as MarginMarkupResult, an as MovingAveragePoint, ao as MovingAverageResult, ap as NotationStyle, aq as NumberBase, ar as PaybackPeriodInput, as as PaybackPeriodResult, at as PercentChangeDirection, au as PercentageChangeResult, av as Permission, aw as PxConvertResult, ax as RoiInput, ay as RoiResult, az as RuleOf72Direction, aA as RuleOf72Result, aB as SavingsGoalInput, aC as SavingsGoalMode, aD as SavingsGoalResult, aE as SemverVersion, aF as SimpleInterestResult, aG as SubnetInfo, aH as SuccessiveDiscountResult, aI as SuccessiveDiscountStep, aJ as TaxDirection, aK as TaxResult, aL as TimeValueDirection, aM as TimeValueResult, aN as TipSplitResult, aO as USD_DENOMINATIONS, aP as UnitPriceItem, aQ as UnitPriceResult, aR as UtilizationTier, aS as VideoBitrateInput, aT as VideoBitrateMode, aU as VideoBitrateResult, aV as ViewportConvertResult, aW as applySuccessiveDiscounts, aX as autoFormat, aY as bumpVersion, aZ as calcAspectRatio, a_ as calcSubnet, a$ as calculateBlendedLoanRate, b0 as calculateBreakEven, b1 as calculateCashBreakdown, b2 as calculateCashRounding, b3 as calculateCdMaturity, b4 as calculateChange, b5 as calculateCompoundInterest, b6 as calculateCreditUtilization, b7 as calculateDebtToIncomeRatio, b8 as calculateDepreciationSchedule, b9 as calculateDiscount, ba as calculateEmi, bb as calculateExtraPaymentPayoff, bc as calculateFreelancerRate, bd as calculateGpa, be as calculateLoan, bf as calculateLoanRefinance, bg as calculateMarginMarkup, bh as calculateMovingAverages, bi as calculatePaybackPeriod, bj as calculatePercentageChange, bk as calculateRoi, bl as calculateRuleOf72, bm as calculateSavingsGoal, bn as calculateSimpleInterest, bo as calculateTax, bp as calculateTimeValue, bq as calculateTipSplit, br as calculateVideoBitrate, bs as compareSemver, bt as compareUnitPrices, bu as convert, bv as convertAprApy, bw as convertBytes, bx as convertIp, by as coverBox, bz as decimalToIp, bA as decimalToIpCidr, bB as describePermissions, bC as fitIntoBox, bD as formatNumber, bE as formatValue, bF as formatVwValue, bG as formatWithSeparator, bH as gcd, bI as ipFromBinary, bJ as ipFromDecimal, bK as ipFromHex, bL as ipToBinary, bM as ipToDecimal, bN as ipToDecimalCidr, bO as ipToHex, bP as ipToOctal, bQ as isValid, bR as isValidCidr, bS as isValidIp, bT as isValidIpv4, bU as marginToMarkup, bV as markupToMargin, bW as octalToPermissions, bX as parseFileSize, bY as parseInput, bZ as parseNumberString, b_ as parseSemver, b$ as permissionsToChmod, c0 as permissionsToOctal, c1 as permissionsToSymbolic, c2 as planDebtPayoff, c3 as ptToPx, c4 as pxToAll, c5 as pxToViewport, c6 as remToPx, c7 as satisfiesRange, c8 as scaleByHeight, c9 as scaleByWidth, ca as sortVersions, cb as splitSubnet, cc as symbolicToPermissions, cd as validateBarcode, ce as validateCardNumber, cf as validateIban, cg as validateIsbn, ch as viewportToPx } from '../units-DPefgzmH.js';
|
package/dist/tools/units.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { BASE_LABELS, BASE_PREFIXES, BYTE_UNITS, COMMON_CURRENCIES, COMMON_LOCALES, COMMON_PERMISSIONS, COMMON_RATIOS, COMMON_SIZES, COMMON_TAX_RATES, COMMON_TIP_PERCENTAGES, COMMON_VIEWPORTS, GPA_GRADE_POINTS, USD_DENOMINATIONS, applySuccessiveDiscounts, autoFormat, bumpVersion, calcAspectRatio, calcSubnet, calculateBlendedLoanRate, calculateBreakEven, calculateCashBreakdown, calculateCashRounding, calculateCdMaturity, calculateChange, calculateCompoundInterest, calculateCreditUtilization, calculateDebtToIncomeRatio, calculateDepreciationSchedule, calculateDiscount, calculateEmi, calculateExtraPaymentPayoff, calculateFreelancerRate, calculateGpa, calculateLoan, calculateMarginMarkup, calculateMovingAverages, calculatePaybackPeriod, calculatePercentageChange, calculateRoi, calculateRuleOf72, calculateSavingsGoal, calculateSimpleInterest, calculateTax, calculateTimeValue, calculateTipSplit, calculateVideoBitrate, compareSemver, compareUnitPrices, convert, convertAprApy, convertBytes, convertIp, coverBox, decimalToIp, decimalToIpCidr, describePermissions, fitIntoBox, formatNumber, formatValue, formatVwValue, formatWithSeparator, gcd, ipFromBinary, ipFromDecimal, ipFromHex, ipToBinary, ipToDecimal, ipToDecimalCidr, ipToHex, ipToOctal, isValid, isValidCidr, isValidIp, isValidIpv4, marginToMarkup, markupToMargin, octalToPermissions, parseFileSize, parseInput, parseNumberString, parseSemver, permissionsToChmod, permissionsToOctal, permissionsToSymbolic, ptToPx, pxToAll, pxToViewport, remToPx, satisfiesRange, scaleByHeight, scaleByWidth, sortVersions, splitSubnet, symbolicToPermissions, validateBarcode, validateCardNumber, validateIban, validateIsbn, viewportToPx } from '../chunk-
|
|
1
|
+
export { BASE_LABELS, BASE_PREFIXES, BYTE_UNITS, COMMON_CURRENCIES, COMMON_LOCALES, COMMON_PERMISSIONS, COMMON_RATIOS, COMMON_SIZES, COMMON_TAX_RATES, COMMON_TIP_PERCENTAGES, COMMON_VIEWPORTS, GPA_GRADE_POINTS, USD_DENOMINATIONS, applySuccessiveDiscounts, autoFormat, bumpVersion, calcAspectRatio, calcSubnet, calculateBlendedLoanRate, calculateBreakEven, calculateCashBreakdown, calculateCashRounding, calculateCdMaturity, calculateChange, calculateCompoundInterest, calculateCreditUtilization, calculateDebtToIncomeRatio, calculateDepreciationSchedule, calculateDiscount, calculateEmi, calculateExtraPaymentPayoff, calculateFreelancerRate, calculateGpa, calculateLoan, calculateLoanRefinance, calculateMarginMarkup, calculateMovingAverages, calculatePaybackPeriod, calculatePercentageChange, calculateRoi, calculateRuleOf72, calculateSavingsGoal, calculateSimpleInterest, calculateTax, calculateTimeValue, calculateTipSplit, calculateVideoBitrate, compareSemver, compareUnitPrices, convert, convertAprApy, convertBytes, convertIp, coverBox, decimalToIp, decimalToIpCidr, describePermissions, fitIntoBox, formatNumber, formatValue, formatVwValue, formatWithSeparator, gcd, ipFromBinary, ipFromDecimal, ipFromHex, ipToBinary, ipToDecimal, ipToDecimalCidr, ipToHex, ipToOctal, isValid, isValidCidr, isValidIp, isValidIpv4, marginToMarkup, markupToMargin, octalToPermissions, parseFileSize, parseInput, parseNumberString, parseSemver, permissionsToChmod, permissionsToOctal, permissionsToSymbolic, planDebtPayoff, ptToPx, pxToAll, pxToViewport, remToPx, satisfiesRange, scaleByHeight, scaleByWidth, sortVersions, splitSubnet, symbolicToPermissions, validateBarcode, validateCardNumber, validateIban, validateIsbn, viewportToPx } from '../chunk-4HNHEOJL.js';
|
|
2
2
|
import '../chunk-MLKGABMK.js';
|