@utilix-tech/sdk 0.53.0 → 0.55.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.
Files changed (35) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/README.md +35 -9
  3. package/dist/{chunk-3KIUADK4.js → chunk-56VFNHVO.js} +55 -1
  4. package/dist/{chunk-Y7YY733Z.js → chunk-DEBIH7QS.js} +58 -1
  5. package/dist/{chunk-K4ZERKBD.js → chunk-JW4NG2GN.js} +119 -1
  6. package/dist/{chunk-NKN656TQ.js → chunk-LI63MAZU.js} +39 -1
  7. package/dist/{code-B_gDkRAx.d.cts → code-rxidGgvB.d.cts} +28 -2
  8. package/dist/{code-B_gDkRAx.d.ts → code-rxidGgvB.d.ts} +28 -2
  9. package/dist/{data-CupeugaR.d.cts → data-Cvyg8ZXo.d.cts} +35 -2
  10. package/dist/{data-CupeugaR.d.ts → data-Cvyg8ZXo.d.ts} +35 -2
  11. package/dist/index.cjs +267 -0
  12. package/dist/index.d.cts +4 -4
  13. package/dist/index.d.ts +4 -4
  14. package/dist/index.js +4 -4
  15. package/dist/{network-DelcJeJa.d.cts → network-C6IcHeMB.d.cts} +51 -2
  16. package/dist/{network-DelcJeJa.d.ts → network-C6IcHeMB.d.ts} +51 -2
  17. package/dist/tools/code.cjs +118 -0
  18. package/dist/tools/code.d.cts +1 -1
  19. package/dist/tools/code.d.ts +1 -1
  20. package/dist/tools/code.js +1 -1
  21. package/dist/tools/data.cjs +54 -0
  22. package/dist/tools/data.d.cts +1 -1
  23. package/dist/tools/data.d.ts +1 -1
  24. package/dist/tools/data.js +1 -1
  25. package/dist/tools/network.cjs +57 -0
  26. package/dist/tools/network.d.cts +1 -1
  27. package/dist/tools/network.d.ts +1 -1
  28. package/dist/tools/network.js +1 -1
  29. package/dist/tools/units.cjs +38 -0
  30. package/dist/tools/units.d.cts +1 -1
  31. package/dist/tools/units.d.ts +1 -1
  32. package/dist/tools/units.js +1 -1
  33. package/dist/{units-p-1Ikx7l.d.cts → units-BM1l5LG9.d.cts} +37 -2
  34. package/dist/{units-p-1Ikx7l.d.ts → units-BM1l5LG9.d.ts} +37 -2
  35. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1,8 +1,8 @@
1
1
  export { media_exports as media } from './chunk-226EH3ZI.js';
2
- export { units_exports as units } from './chunk-NKN656TQ.js';
3
- export { network_exports as network } from './chunk-Y7YY733Z.js';
2
+ export { units_exports as units } from './chunk-LI63MAZU.js';
3
+ export { network_exports as network } from './chunk-DEBIH7QS.js';
4
4
  export { api_exports as api } from './chunk-52ZDKSIX.js';
5
- export { code_exports as code } from './chunk-K4ZERKBD.js';
5
+ export { code_exports as code } from './chunk-JW4NG2GN.js';
6
6
  export { color_exports as color } from './chunk-BPVAB4P2.js';
7
7
  export { css_exports as css } from './chunk-6YPV2AB5.js';
8
8
  export { misc_exports as misc } from './chunk-GX7H6TAX.js';
@@ -11,7 +11,7 @@ export { json_exports as json } from './chunk-WVEKRKGU.js';
11
11
  export { encoding_exports as encoding } from './chunk-DOWQZUTP.js';
12
12
  export { hashing_exports as hashing } from './chunk-PET2CGTH.js';
13
13
  export { text_exports as text } from './chunk-P7TXG7CI.js';
14
- export { data_exports as data } from './chunk-3KIUADK4.js';
14
+ export { data_exports as data } from './chunk-56VFNHVO.js';
15
15
  export { generators_exports as generators } from './chunk-3TYWIX3B.js';
16
16
  export { time_exports as time } from './chunk-IEPWZERQ.js';
17
17
  import './chunk-MLKGABMK.js';
@@ -21,6 +21,7 @@
21
21
  * - http-range-header-builder: buildRangeHeader, parseContentRangeHeader
22
22
  * - vary-header-builder: buildVaryHeader, parseVaryHeader
23
23
  * - permissions-policy-builder: buildPermissionsPolicy, parsePermissionsPolicy
24
+ * - x-content-type-options-builder: buildXContentTypeOptionsHeader, parseXContentTypeOptionsHeader, assessContentTypeRisk
24
25
  */
25
26
  declare const DNS_RECORD_TYPES: readonly ["A", "AAAA", "CNAME", "MX", "TXT", "NS", "SOA", "PTR", "SRV", "CAA"];
26
27
  type DnsRecordType = typeof DNS_RECORD_TYPES[number];
@@ -702,6 +703,46 @@ declare function buildContentDisposition(options?: ContentDispositionBuildOption
702
703
  declare function parseContentDisposition(header: string): ContentDispositionParseResult | {
703
704
  error: string;
704
705
  };
706
+ declare const X_CONTENT_TYPE_OPTIONS_HEADER = "X-Content-Type-Options: nosniff";
707
+ interface XContentTypeOptionsHeader {
708
+ header: string;
709
+ value: 'nosniff';
710
+ explanation: string;
711
+ }
712
+ /**
713
+ * Build the X-Content-Type-Options header. There is only one valid value,
714
+ * so this simply returns the fixed header plus a plain-English explanation
715
+ * of the MIME-sniffing attack it prevents.
716
+ */
717
+ declare function buildXContentTypeOptionsHeader(): XContentTypeOptionsHeader;
718
+ interface XContentTypeOptionsParseResult {
719
+ raw: string;
720
+ valid: boolean;
721
+ message: string;
722
+ }
723
+ /**
724
+ * Validate a pasted X-Content-Type-Options header value. The header only
725
+ * has one correct value ("nosniff"); anything else is either a typo or a
726
+ * no-op the browser ignores.
727
+ */
728
+ declare function parseXContentTypeOptionsHeader(rawHeader: string): XContentTypeOptionsParseResult | {
729
+ error: string;
730
+ };
731
+ type ContentTypeSniffRisk = 'high' | 'medium' | 'low';
732
+ interface ContentTypeRiskResult {
733
+ contentType: string;
734
+ risk: ContentTypeSniffRisk;
735
+ reason: string;
736
+ }
737
+ /**
738
+ * Assess how risky it is to serve a given Content-Type without the
739
+ * X-Content-Type-Options: nosniff header, based on well-known MIME-sniffing
740
+ * attack surfaces. This is a heuristic classification, not a security scan
741
+ * of an actual response.
742
+ */
743
+ declare function assessContentTypeRisk(contentType: string): ContentTypeRiskResult | {
744
+ error: string;
745
+ };
705
746
 
706
747
  type network_AuthResultEntry = AuthResultEntry;
707
748
  type network_BuildRangeHeaderOptions = BuildRangeHeaderOptions;
@@ -717,6 +758,8 @@ type network_ContentDispositionBuildOptions = ContentDispositionBuildOptions;
717
758
  type network_ContentDispositionBuildResult = ContentDispositionBuildResult;
718
759
  type network_ContentDispositionParseResult = ContentDispositionParseResult;
719
760
  type network_ContentRangeResult = ContentRangeResult;
761
+ type network_ContentTypeRiskResult = ContentTypeRiskResult;
762
+ type network_ContentTypeSniffRisk = ContentTypeSniffRisk;
720
763
  type network_CookieAttributes = CookieAttributes;
721
764
  type network_CookieCheckResult = CookieCheckResult;
722
765
  declare const network_DNS_RECORD_TYPES: typeof DNS_RECORD_TYPES;
@@ -775,7 +818,11 @@ type network_UaDeviceType = UaDeviceType;
775
818
  type network_UserAgentInfo = UserAgentInfo;
776
819
  type network_VaryHeaderEntry = VaryHeaderEntry;
777
820
  type network_VaryHeaderResult = VaryHeaderResult;
821
+ type network_XContentTypeOptionsHeader = XContentTypeOptionsHeader;
822
+ type network_XContentTypeOptionsParseResult = XContentTypeOptionsParseResult;
823
+ declare const network_X_CONTENT_TYPE_OPTIONS_HEADER: typeof X_CONTENT_TYPE_OPTIONS_HEADER;
778
824
  declare const network_analyzeEmailHeaders: typeof analyzeEmailHeaders;
825
+ declare const network_assessContentTypeRisk: typeof assessContentTypeRisk;
779
826
  declare const network_buildCacheControl: typeof buildCacheControl;
780
827
  declare const network_buildClientHints: typeof buildClientHints;
781
828
  declare const network_buildContentDisposition: typeof buildContentDisposition;
@@ -787,6 +834,7 @@ declare const network_buildPermissionsPolicy: typeof buildPermissionsPolicy;
787
834
  declare const network_buildRangeHeader: typeof buildRangeHeader;
788
835
  declare const network_buildReferrerPolicy: typeof buildReferrerPolicy;
789
836
  declare const network_buildVaryHeader: typeof buildVaryHeader;
837
+ declare const network_buildXContentTypeOptionsHeader: typeof buildXContentTypeOptionsHeader;
790
838
  declare const network_checkSetCookieHeader: typeof checkSetCookieHeader;
791
839
  declare const network_countryCodeToFlag: typeof countryCodeToFlag;
792
840
  declare const network_formatCoordinates: typeof formatCoordinates;
@@ -812,6 +860,7 @@ declare const network_parseIpv6Address: typeof parseIpv6Address;
812
860
  declare const network_parsePermissionsPolicy: typeof parsePermissionsPolicy;
813
861
  declare const network_parseUserAgent: typeof parseUserAgent;
814
862
  declare const network_parseVaryHeader: typeof parseVaryHeader;
863
+ declare const network_parseXContentTypeOptionsHeader: typeof parseXContentTypeOptionsHeader;
815
864
  declare const network_searchHeaders: typeof searchHeaders;
816
865
  declare const network_searchStatusCodes: typeof searchStatusCodes;
817
866
  declare const network_splitSitemap: typeof splitSitemap;
@@ -824,7 +873,7 @@ declare const network_validateManifest: typeof validateManifest;
824
873
  declare const network_validateRobotsTxt: typeof validateRobotsTxt;
825
874
  declare const network_validateSitemap: typeof validateSitemap;
826
875
  declare namespace network {
827
- export { 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_ContentDispositionBuildOptions as ContentDispositionBuildOptions, type network_ContentDispositionBuildResult as ContentDispositionBuildResult, type network_ContentDispositionParseResult as ContentDispositionParseResult, type network_ContentRangeResult as ContentRangeResult, 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, 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_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, network_analyzeEmailHeaders as analyzeEmailHeaders, 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_buildRangeHeader as buildRangeHeader, network_buildReferrerPolicy as buildReferrerPolicy, network_buildVaryHeader as buildVaryHeader, 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_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_parseUserAgent as parseUserAgent, network_parseVaryHeader as parseVaryHeader, 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 };
876
+ export { 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_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, 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_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_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_buildRangeHeader as buildRangeHeader, network_buildReferrerPolicy as buildReferrerPolicy, 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_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_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 };
828
877
  }
829
878
 
830
- export { type ReferrerPolicyResult as $, type AuthResultEntry as A, type BuildRangeHeaderOptions as B, CLIENT_HINTS as C, DNS_RECORD_TYPES as D, type EmailHeaderAnalysis as E, type LinkHeaderResult as F, type GeoResult as G, HTTP_HEADERS as H, type Ipv6AddressType as I, type LinkRel as J, type ManifestIssue as K, LINK_REL_VALUES as L, type ManifestIconInfo as M, type ManifestValidationResult as N, type ParsedClientHint as O, PERMISSIONS_POLICY_FEATURES as P, type ParsedDnsResult as Q, type ParsedGeoResult as R, type PermissionsPolicyDirective as S, type PermissionsPolicyFeatureInput as T, type PermissionsPolicyResult as U, REFERRER_POLICY_VALUES as V, type RangeEntry as W, type RangeEntryInput as X, type RangeHeaderResult as Y, type ReceivedHop as Z, type ReferrerPolicyEntry as _, type CacheControlDirective as a, validateHeaderValue as a$, type ReferrerPolicyValue as a0, type RobotsGroup as a1, type RobotsIssue as a2, type RobotsRule as a3, type RobotsValidationResult as a4, STATUS_CODES as a5, type SameSiteValue as a6, type SitemapIndexEntry as a7, type SitemapIssue as a8, type SitemapSplitFile as a9, getHeader as aA, getHeadersByCategory as aB, getStatusByCategory as aC, getStatusCode as aD, isClientError as aE, isServerError as aF, isSuccess as aG, isValidIp as aH, isValidIpv4 as aI, isValidIpv6 as aJ, parseClientHintHeaders as aK, parseContentDisposition as aL, parseContentRangeHeader as aM, parseDnsResponse as aN, parseGeoResponse as aO, parseHar as aP, parseIpv6Address as aQ, parsePermissionsPolicy as aR, parseUserAgent as aS, parseVaryHeader as aT, searchHeaders as aU, searchStatusCodes as aV, splitSitemap as aW, statusCodeToText as aX, typeNumberToLabel as aY, validateDomain as aZ, validateHeaderName as a_, type SitemapUrlEntry as aa, type SitemapValidationResult as ab, type SplitSitemapOptions as ac, type SplitSitemapResult as ad, type StatusCode as ae, type UaDeviceType as af, type UserAgentInfo as ag, type VaryHeaderEntry as ah, type VaryHeaderResult as ai, analyzeEmailHeaders as aj, buildCacheControl as ak, buildClientHints as al, buildContentDisposition as am, buildDnsQueryUrl as an, buildGeoUrl as ao, buildLinkHeader as ap, buildMapUrl as aq, buildPermissionsPolicy as ar, buildRangeHeader as as, buildReferrerPolicy as at, buildVaryHeader as au, checkSetCookieHeader as av, countryCodeToFlag as aw, formatCoordinates as ax, formatTtl as ay, getByCategory as az, type CacheControlOptions as b, validateManifest as b0, validateRobotsTxt as b1, validateSitemap as b2, type CacheControlResult as c, type ClientHintDef as d, type ClientHintValueType as e, type ClientHintsBuildResult as f, type ClientHintsParseResult as g, type ContentDispositionBuildOptions as h, type ContentDispositionBuildResult as i, type ContentDispositionParseResult as j, type ContentRangeResult as k, type CookieAttributes as l, type CookieCheckResult as m, network as n, type DnsRecord as o, type DnsRecordType as p, type DnsResponse as q, type EmailHeaderField as r, type HarEntry as s, type HarParseResult as t, type HarSummary as u, type HeaderCategory as v, type HttpHeader as w, type Ipv6ParseResult as x, type LinkHeaderEntry as y, type LinkHeaderEntryInput as z };
879
+ export { type ReceivedHop as $, type AuthResultEntry as A, type BuildRangeHeaderOptions as B, CLIENT_HINTS as C, DNS_RECORD_TYPES as D, type EmailHeaderAnalysis as E, type LinkHeaderEntry as F, type GeoResult as G, HTTP_HEADERS as H, type Ipv6AddressType as I, type LinkHeaderEntryInput as J, type LinkHeaderResult as K, LINK_REL_VALUES as L, type LinkRel as M, type ManifestIconInfo as N, type ManifestIssue as O, type ManifestValidationResult as P, PERMISSIONS_POLICY_FEATURES as Q, type ParsedClientHint as R, type ParsedDnsResult as S, type ParsedGeoResult as T, type PermissionsPolicyDirective as U, type PermissionsPolicyFeatureInput as V, type PermissionsPolicyResult as W, REFERRER_POLICY_VALUES as X, type RangeEntry as Y, type RangeEntryInput as Z, type RangeHeaderResult as _, type CacheControlDirective as a, parseXContentTypeOptionsHeader as a$, type ReferrerPolicyEntry as a0, type ReferrerPolicyResult as a1, type ReferrerPolicyValue as a2, type RobotsGroup as a3, type RobotsIssue as a4, type RobotsRule as a5, type RobotsValidationResult as a6, STATUS_CODES as a7, type SameSiteValue as a8, type SitemapIndexEntry as a9, buildVaryHeader as aA, buildXContentTypeOptionsHeader as aB, checkSetCookieHeader as aC, countryCodeToFlag as aD, formatCoordinates as aE, formatTtl as aF, getByCategory as aG, getHeader as aH, getHeadersByCategory as aI, getStatusByCategory as aJ, getStatusCode as aK, isClientError as aL, isServerError as aM, isSuccess as aN, isValidIp as aO, isValidIpv4 as aP, isValidIpv6 as aQ, parseClientHintHeaders as aR, parseContentDisposition as aS, parseContentRangeHeader as aT, parseDnsResponse as aU, parseGeoResponse as aV, parseHar as aW, parseIpv6Address as aX, parsePermissionsPolicy as aY, parseUserAgent as aZ, parseVaryHeader as a_, type SitemapIssue as aa, type SitemapSplitFile as ab, type SitemapUrlEntry as ac, type SitemapValidationResult as ad, type SplitSitemapOptions as ae, type SplitSitemapResult as af, type StatusCode as ag, type UaDeviceType as ah, type UserAgentInfo as ai, type VaryHeaderEntry as aj, type VaryHeaderResult as ak, type XContentTypeOptionsHeader as al, type XContentTypeOptionsParseResult as am, X_CONTENT_TYPE_OPTIONS_HEADER as an, analyzeEmailHeaders as ao, assessContentTypeRisk as ap, buildCacheControl as aq, buildClientHints as ar, buildContentDisposition as as, buildDnsQueryUrl as at, buildGeoUrl as au, buildLinkHeader as av, buildMapUrl as aw, buildPermissionsPolicy as ax, buildRangeHeader as ay, buildReferrerPolicy as az, type CacheControlOptions as b, searchHeaders as b0, searchStatusCodes as b1, splitSitemap as b2, statusCodeToText as b3, typeNumberToLabel as b4, validateDomain as b5, validateHeaderName as b6, validateHeaderValue as b7, validateManifest as b8, validateRobotsTxt as b9, validateSitemap as ba, type CacheControlResult as c, type ClientHintDef as d, type ClientHintValueType as e, type ClientHintsBuildResult as f, type ClientHintsParseResult as g, type ContentDispositionBuildOptions as h, type ContentDispositionBuildResult as i, type ContentDispositionParseResult as j, type ContentRangeResult as k, type ContentTypeRiskResult as l, type ContentTypeSniffRisk as m, network as n, type CookieAttributes as o, type CookieCheckResult as p, type DnsRecord as q, type DnsRecordType as r, type DnsResponse as s, type EmailHeaderField as t, type HarEntry as u, type HarParseResult as v, type HarSummary as w, type HeaderCategory as x, type HttpHeader as y, type Ipv6ParseResult as z };
@@ -21,6 +21,7 @@
21
21
  * - http-range-header-builder: buildRangeHeader, parseContentRangeHeader
22
22
  * - vary-header-builder: buildVaryHeader, parseVaryHeader
23
23
  * - permissions-policy-builder: buildPermissionsPolicy, parsePermissionsPolicy
24
+ * - x-content-type-options-builder: buildXContentTypeOptionsHeader, parseXContentTypeOptionsHeader, assessContentTypeRisk
24
25
  */
25
26
  declare const DNS_RECORD_TYPES: readonly ["A", "AAAA", "CNAME", "MX", "TXT", "NS", "SOA", "PTR", "SRV", "CAA"];
26
27
  type DnsRecordType = typeof DNS_RECORD_TYPES[number];
@@ -702,6 +703,46 @@ declare function buildContentDisposition(options?: ContentDispositionBuildOption
702
703
  declare function parseContentDisposition(header: string): ContentDispositionParseResult | {
703
704
  error: string;
704
705
  };
706
+ declare const X_CONTENT_TYPE_OPTIONS_HEADER = "X-Content-Type-Options: nosniff";
707
+ interface XContentTypeOptionsHeader {
708
+ header: string;
709
+ value: 'nosniff';
710
+ explanation: string;
711
+ }
712
+ /**
713
+ * Build the X-Content-Type-Options header. There is only one valid value,
714
+ * so this simply returns the fixed header plus a plain-English explanation
715
+ * of the MIME-sniffing attack it prevents.
716
+ */
717
+ declare function buildXContentTypeOptionsHeader(): XContentTypeOptionsHeader;
718
+ interface XContentTypeOptionsParseResult {
719
+ raw: string;
720
+ valid: boolean;
721
+ message: string;
722
+ }
723
+ /**
724
+ * Validate a pasted X-Content-Type-Options header value. The header only
725
+ * has one correct value ("nosniff"); anything else is either a typo or a
726
+ * no-op the browser ignores.
727
+ */
728
+ declare function parseXContentTypeOptionsHeader(rawHeader: string): XContentTypeOptionsParseResult | {
729
+ error: string;
730
+ };
731
+ type ContentTypeSniffRisk = 'high' | 'medium' | 'low';
732
+ interface ContentTypeRiskResult {
733
+ contentType: string;
734
+ risk: ContentTypeSniffRisk;
735
+ reason: string;
736
+ }
737
+ /**
738
+ * Assess how risky it is to serve a given Content-Type without the
739
+ * X-Content-Type-Options: nosniff header, based on well-known MIME-sniffing
740
+ * attack surfaces. This is a heuristic classification, not a security scan
741
+ * of an actual response.
742
+ */
743
+ declare function assessContentTypeRisk(contentType: string): ContentTypeRiskResult | {
744
+ error: string;
745
+ };
705
746
 
706
747
  type network_AuthResultEntry = AuthResultEntry;
707
748
  type network_BuildRangeHeaderOptions = BuildRangeHeaderOptions;
@@ -717,6 +758,8 @@ type network_ContentDispositionBuildOptions = ContentDispositionBuildOptions;
717
758
  type network_ContentDispositionBuildResult = ContentDispositionBuildResult;
718
759
  type network_ContentDispositionParseResult = ContentDispositionParseResult;
719
760
  type network_ContentRangeResult = ContentRangeResult;
761
+ type network_ContentTypeRiskResult = ContentTypeRiskResult;
762
+ type network_ContentTypeSniffRisk = ContentTypeSniffRisk;
720
763
  type network_CookieAttributes = CookieAttributes;
721
764
  type network_CookieCheckResult = CookieCheckResult;
722
765
  declare const network_DNS_RECORD_TYPES: typeof DNS_RECORD_TYPES;
@@ -775,7 +818,11 @@ type network_UaDeviceType = UaDeviceType;
775
818
  type network_UserAgentInfo = UserAgentInfo;
776
819
  type network_VaryHeaderEntry = VaryHeaderEntry;
777
820
  type network_VaryHeaderResult = VaryHeaderResult;
821
+ type network_XContentTypeOptionsHeader = XContentTypeOptionsHeader;
822
+ type network_XContentTypeOptionsParseResult = XContentTypeOptionsParseResult;
823
+ declare const network_X_CONTENT_TYPE_OPTIONS_HEADER: typeof X_CONTENT_TYPE_OPTIONS_HEADER;
778
824
  declare const network_analyzeEmailHeaders: typeof analyzeEmailHeaders;
825
+ declare const network_assessContentTypeRisk: typeof assessContentTypeRisk;
779
826
  declare const network_buildCacheControl: typeof buildCacheControl;
780
827
  declare const network_buildClientHints: typeof buildClientHints;
781
828
  declare const network_buildContentDisposition: typeof buildContentDisposition;
@@ -787,6 +834,7 @@ declare const network_buildPermissionsPolicy: typeof buildPermissionsPolicy;
787
834
  declare const network_buildRangeHeader: typeof buildRangeHeader;
788
835
  declare const network_buildReferrerPolicy: typeof buildReferrerPolicy;
789
836
  declare const network_buildVaryHeader: typeof buildVaryHeader;
837
+ declare const network_buildXContentTypeOptionsHeader: typeof buildXContentTypeOptionsHeader;
790
838
  declare const network_checkSetCookieHeader: typeof checkSetCookieHeader;
791
839
  declare const network_countryCodeToFlag: typeof countryCodeToFlag;
792
840
  declare const network_formatCoordinates: typeof formatCoordinates;
@@ -812,6 +860,7 @@ declare const network_parseIpv6Address: typeof parseIpv6Address;
812
860
  declare const network_parsePermissionsPolicy: typeof parsePermissionsPolicy;
813
861
  declare const network_parseUserAgent: typeof parseUserAgent;
814
862
  declare const network_parseVaryHeader: typeof parseVaryHeader;
863
+ declare const network_parseXContentTypeOptionsHeader: typeof parseXContentTypeOptionsHeader;
815
864
  declare const network_searchHeaders: typeof searchHeaders;
816
865
  declare const network_searchStatusCodes: typeof searchStatusCodes;
817
866
  declare const network_splitSitemap: typeof splitSitemap;
@@ -824,7 +873,7 @@ declare const network_validateManifest: typeof validateManifest;
824
873
  declare const network_validateRobotsTxt: typeof validateRobotsTxt;
825
874
  declare const network_validateSitemap: typeof validateSitemap;
826
875
  declare namespace network {
827
- export { 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_ContentDispositionBuildOptions as ContentDispositionBuildOptions, type network_ContentDispositionBuildResult as ContentDispositionBuildResult, type network_ContentDispositionParseResult as ContentDispositionParseResult, type network_ContentRangeResult as ContentRangeResult, 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, 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_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, network_analyzeEmailHeaders as analyzeEmailHeaders, 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_buildRangeHeader as buildRangeHeader, network_buildReferrerPolicy as buildReferrerPolicy, network_buildVaryHeader as buildVaryHeader, 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_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_parseUserAgent as parseUserAgent, network_parseVaryHeader as parseVaryHeader, 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 };
876
+ export { 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_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, 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_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_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_buildRangeHeader as buildRangeHeader, network_buildReferrerPolicy as buildReferrerPolicy, 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_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_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 };
828
877
  }
829
878
 
830
- export { type ReferrerPolicyResult as $, type AuthResultEntry as A, type BuildRangeHeaderOptions as B, CLIENT_HINTS as C, DNS_RECORD_TYPES as D, type EmailHeaderAnalysis as E, type LinkHeaderResult as F, type GeoResult as G, HTTP_HEADERS as H, type Ipv6AddressType as I, type LinkRel as J, type ManifestIssue as K, LINK_REL_VALUES as L, type ManifestIconInfo as M, type ManifestValidationResult as N, type ParsedClientHint as O, PERMISSIONS_POLICY_FEATURES as P, type ParsedDnsResult as Q, type ParsedGeoResult as R, type PermissionsPolicyDirective as S, type PermissionsPolicyFeatureInput as T, type PermissionsPolicyResult as U, REFERRER_POLICY_VALUES as V, type RangeEntry as W, type RangeEntryInput as X, type RangeHeaderResult as Y, type ReceivedHop as Z, type ReferrerPolicyEntry as _, type CacheControlDirective as a, validateHeaderValue as a$, type ReferrerPolicyValue as a0, type RobotsGroup as a1, type RobotsIssue as a2, type RobotsRule as a3, type RobotsValidationResult as a4, STATUS_CODES as a5, type SameSiteValue as a6, type SitemapIndexEntry as a7, type SitemapIssue as a8, type SitemapSplitFile as a9, getHeader as aA, getHeadersByCategory as aB, getStatusByCategory as aC, getStatusCode as aD, isClientError as aE, isServerError as aF, isSuccess as aG, isValidIp as aH, isValidIpv4 as aI, isValidIpv6 as aJ, parseClientHintHeaders as aK, parseContentDisposition as aL, parseContentRangeHeader as aM, parseDnsResponse as aN, parseGeoResponse as aO, parseHar as aP, parseIpv6Address as aQ, parsePermissionsPolicy as aR, parseUserAgent as aS, parseVaryHeader as aT, searchHeaders as aU, searchStatusCodes as aV, splitSitemap as aW, statusCodeToText as aX, typeNumberToLabel as aY, validateDomain as aZ, validateHeaderName as a_, type SitemapUrlEntry as aa, type SitemapValidationResult as ab, type SplitSitemapOptions as ac, type SplitSitemapResult as ad, type StatusCode as ae, type UaDeviceType as af, type UserAgentInfo as ag, type VaryHeaderEntry as ah, type VaryHeaderResult as ai, analyzeEmailHeaders as aj, buildCacheControl as ak, buildClientHints as al, buildContentDisposition as am, buildDnsQueryUrl as an, buildGeoUrl as ao, buildLinkHeader as ap, buildMapUrl as aq, buildPermissionsPolicy as ar, buildRangeHeader as as, buildReferrerPolicy as at, buildVaryHeader as au, checkSetCookieHeader as av, countryCodeToFlag as aw, formatCoordinates as ax, formatTtl as ay, getByCategory as az, type CacheControlOptions as b, validateManifest as b0, validateRobotsTxt as b1, validateSitemap as b2, type CacheControlResult as c, type ClientHintDef as d, type ClientHintValueType as e, type ClientHintsBuildResult as f, type ClientHintsParseResult as g, type ContentDispositionBuildOptions as h, type ContentDispositionBuildResult as i, type ContentDispositionParseResult as j, type ContentRangeResult as k, type CookieAttributes as l, type CookieCheckResult as m, network as n, type DnsRecord as o, type DnsRecordType as p, type DnsResponse as q, type EmailHeaderField as r, type HarEntry as s, type HarParseResult as t, type HarSummary as u, type HeaderCategory as v, type HttpHeader as w, type Ipv6ParseResult as x, type LinkHeaderEntry as y, type LinkHeaderEntryInput as z };
879
+ export { type ReceivedHop as $, type AuthResultEntry as A, type BuildRangeHeaderOptions as B, CLIENT_HINTS as C, DNS_RECORD_TYPES as D, type EmailHeaderAnalysis as E, type LinkHeaderEntry as F, type GeoResult as G, HTTP_HEADERS as H, type Ipv6AddressType as I, type LinkHeaderEntryInput as J, type LinkHeaderResult as K, LINK_REL_VALUES as L, type LinkRel as M, type ManifestIconInfo as N, type ManifestIssue as O, type ManifestValidationResult as P, PERMISSIONS_POLICY_FEATURES as Q, type ParsedClientHint as R, type ParsedDnsResult as S, type ParsedGeoResult as T, type PermissionsPolicyDirective as U, type PermissionsPolicyFeatureInput as V, type PermissionsPolicyResult as W, REFERRER_POLICY_VALUES as X, type RangeEntry as Y, type RangeEntryInput as Z, type RangeHeaderResult as _, type CacheControlDirective as a, parseXContentTypeOptionsHeader as a$, type ReferrerPolicyEntry as a0, type ReferrerPolicyResult as a1, type ReferrerPolicyValue as a2, type RobotsGroup as a3, type RobotsIssue as a4, type RobotsRule as a5, type RobotsValidationResult as a6, STATUS_CODES as a7, type SameSiteValue as a8, type SitemapIndexEntry as a9, buildVaryHeader as aA, buildXContentTypeOptionsHeader as aB, checkSetCookieHeader as aC, countryCodeToFlag as aD, formatCoordinates as aE, formatTtl as aF, getByCategory as aG, getHeader as aH, getHeadersByCategory as aI, getStatusByCategory as aJ, getStatusCode as aK, isClientError as aL, isServerError as aM, isSuccess as aN, isValidIp as aO, isValidIpv4 as aP, isValidIpv6 as aQ, parseClientHintHeaders as aR, parseContentDisposition as aS, parseContentRangeHeader as aT, parseDnsResponse as aU, parseGeoResponse as aV, parseHar as aW, parseIpv6Address as aX, parsePermissionsPolicy as aY, parseUserAgent as aZ, parseVaryHeader as a_, type SitemapIssue as aa, type SitemapSplitFile as ab, type SitemapUrlEntry as ac, type SitemapValidationResult as ad, type SplitSitemapOptions as ae, type SplitSitemapResult as af, type StatusCode as ag, type UaDeviceType as ah, type UserAgentInfo as ai, type VaryHeaderEntry as aj, type VaryHeaderResult as ak, type XContentTypeOptionsHeader as al, type XContentTypeOptionsParseResult as am, X_CONTENT_TYPE_OPTIONS_HEADER as an, analyzeEmailHeaders as ao, assessContentTypeRisk as ap, buildCacheControl as aq, buildClientHints as ar, buildContentDisposition as as, buildDnsQueryUrl as at, buildGeoUrl as au, buildLinkHeader as av, buildMapUrl as aw, buildPermissionsPolicy as ax, buildRangeHeader as ay, buildReferrerPolicy as az, type CacheControlOptions as b, searchHeaders as b0, searchStatusCodes as b1, splitSitemap as b2, statusCodeToText as b3, typeNumberToLabel as b4, validateDomain as b5, validateHeaderName as b6, validateHeaderValue as b7, validateManifest as b8, validateRobotsTxt as b9, validateSitemap as ba, type CacheControlResult as c, type ClientHintDef as d, type ClientHintValueType as e, type ClientHintsBuildResult as f, type ClientHintsParseResult as g, type ContentDispositionBuildOptions as h, type ContentDispositionBuildResult as i, type ContentDispositionParseResult as j, type ContentRangeResult as k, type ContentTypeRiskResult as l, type ContentTypeSniffRisk as m, network as n, type CookieAttributes as o, type CookieCheckResult as p, type DnsRecord as q, type DnsRecordType as r, type DnsResponse as s, type EmailHeaderField as t, type HarEntry as u, type HarParseResult as v, type HarSummary as w, type HeaderCategory as x, type HttpHeader as y, type Ipv6ParseResult as z };
@@ -3220,6 +3220,123 @@ function validateTsconfig(text) {
3220
3220
  const valid = !issues.some((i) => i.severity === "error");
3221
3221
  return { parsed: true, topLevelKeys, compilerOptionKeys, issues, valid };
3222
3222
  }
3223
+ function collectExportsStringLeaves(value, out = []) {
3224
+ if (typeof value === "string") out.push(value);
3225
+ else if (Array.isArray(value)) value.forEach((v) => collectExportsStringLeaves(v, out));
3226
+ else if (value && typeof value === "object") Object.values(value).forEach((v) => collectExportsStringLeaves(v, out));
3227
+ return out;
3228
+ }
3229
+ function checkExportsPatternMatch(key, value, path, issues) {
3230
+ const keyHasStar = key.includes("*");
3231
+ const leaves = collectExportsStringLeaves(value);
3232
+ if (keyHasStar) {
3233
+ const bad = leaves.filter((l) => !l.includes("*"));
3234
+ if (bad.length > 0) {
3235
+ issues.push({ severity: "error", path, message: `pattern key "${key}" contains "*" but target ${bad.map((l) => `"${l}"`).join(", ")} has no "*" to receive the matched text` });
3236
+ }
3237
+ } else {
3238
+ const bad = leaves.filter((l) => l.includes("*"));
3239
+ if (bad.length > 0) {
3240
+ issues.push({ severity: "error", path, message: `target ${bad.map((l) => `"${l}"`).join(", ")} contains "*" but key "${key}" has no "*" pattern to match against` });
3241
+ }
3242
+ }
3243
+ }
3244
+ function validateExportsValue(value, path, issues) {
3245
+ if (value === null) return;
3246
+ if (typeof value === "string") {
3247
+ if (!value.startsWith("./")) {
3248
+ issues.push({ severity: "error", path, message: `target "${value}" must start with "./"` });
3249
+ }
3250
+ return;
3251
+ }
3252
+ if (Array.isArray(value)) {
3253
+ if (value.length === 0) {
3254
+ issues.push({ severity: "warning", path, message: "empty fallback array will never resolve" });
3255
+ }
3256
+ value.forEach((v, i) => validateExportsValue(v, `${path}[${i}]`, issues));
3257
+ return;
3258
+ }
3259
+ if (typeof value === "object") {
3260
+ const obj = value;
3261
+ const keys = Object.keys(obj);
3262
+ if (keys.length === 0) {
3263
+ issues.push({ severity: "warning", path, message: "empty object will never resolve" });
3264
+ return;
3265
+ }
3266
+ const hasDotKeys = keys.some((k) => k.startsWith("."));
3267
+ const hasNonDotKeys = keys.some((k) => !k.startsWith("."));
3268
+ if (hasDotKeys && hasNonDotKeys) {
3269
+ issues.push({ severity: "error", path, message: 'cannot mix subpath keys (starting with ".") with condition keys in the same object' });
3270
+ return;
3271
+ }
3272
+ if (hasDotKeys) {
3273
+ for (const key of keys) {
3274
+ const subpath = `${path}["${key}"]`;
3275
+ if (key !== "." && !key.startsWith("./")) {
3276
+ issues.push({ severity: "error", path: subpath, message: `subpath key "${key}" must be "." or start with "./"` });
3277
+ }
3278
+ checkExportsPatternMatch(key, obj[key], subpath, issues);
3279
+ validateExportsValue(obj[key], subpath, issues);
3280
+ }
3281
+ return;
3282
+ }
3283
+ if (keys.includes("types") && keys[0] !== "types") {
3284
+ issues.push({ severity: "warning", path, message: '"types" condition should be listed first so TypeScript resolves it before any other condition matches' });
3285
+ }
3286
+ if (keys.includes("default") && keys[keys.length - 1] !== "default") {
3287
+ issues.push({ severity: "warning", path, message: '"default" condition should be listed last; conditions are matched in order and anything after "default" is unreachable' });
3288
+ }
3289
+ if ((keys.includes("import") || keys.includes("require")) && !keys.includes("default")) {
3290
+ issues.push({ severity: "warning", path, message: 'no "default" fallback condition; resolution fails for any importer using a condition not listed here' });
3291
+ }
3292
+ const requireVal = obj.require;
3293
+ if (typeof requireVal === "string" && requireVal.endsWith(".mjs")) {
3294
+ issues.push({ severity: "error", path: `${path}.require`, message: `"require" condition points to a .mjs file ("${requireVal}"), but .mjs is always treated as ESM and cannot be required` });
3295
+ }
3296
+ const importVal = obj.import;
3297
+ if (typeof importVal === "string" && importVal.endsWith(".cjs")) {
3298
+ issues.push({ severity: "error", path: `${path}.import`, message: `"import" condition points to a .cjs file ("${importVal}"), but .cjs is always treated as CommonJS and cannot be imported as ESM` });
3299
+ }
3300
+ for (const key of keys) {
3301
+ validateExportsValue(obj[key], `${path}.${key}`, issues);
3302
+ }
3303
+ return;
3304
+ }
3305
+ issues.push({ severity: "error", path, message: `unexpected value type at "${path}"` });
3306
+ }
3307
+ function validatePackageExports(packageJsonText) {
3308
+ if (!packageJsonText || !packageJsonText.trim()) return { error: "Input is empty" };
3309
+ let parsed;
3310
+ try {
3311
+ parsed = JSON.parse(packageJsonText);
3312
+ } catch (e) {
3313
+ return { error: `Invalid JSON: ${e.message}` };
3314
+ }
3315
+ if (typeof parsed !== "object" || parsed === null || Array.isArray(parsed)) {
3316
+ return { error: "Root of package.json must be an object" };
3317
+ }
3318
+ const obj = parsed;
3319
+ if (!("exports" in obj)) return { error: 'package.json has no "exports" field' };
3320
+ const exportsValue = obj.exports;
3321
+ const issues = [];
3322
+ let exportsShape;
3323
+ if (exportsValue === null) {
3324
+ exportsShape = "null";
3325
+ } else if (typeof exportsValue === "string") {
3326
+ exportsShape = "string";
3327
+ } else if (Array.isArray(exportsValue)) {
3328
+ exportsShape = "array";
3329
+ } else if (typeof exportsValue === "object") {
3330
+ const keys = Object.keys(exportsValue);
3331
+ exportsShape = keys.some((k) => k.startsWith(".")) ? "subpaths" : "conditions";
3332
+ } else {
3333
+ return { error: '"exports" must be a string, array, object, or null' };
3334
+ }
3335
+ validateExportsValue(exportsValue, "exports", issues);
3336
+ const subpaths = exportsShape === "subpaths" ? Object.keys(exportsValue) : ["."];
3337
+ const valid = !issues.some((i) => i.severity === "error");
3338
+ return { parsed: true, exportsShape, subpaths, issues, valid };
3339
+ }
3223
3340
 
3224
3341
  exports.ALL_FLAGS = ALL_FLAGS;
3225
3342
  exports.CHEATSHEET = CHEATSHEET;
@@ -3274,4 +3391,5 @@ exports.testPattern = testPattern;
3274
3391
  exports.testRegex = testRegex;
3275
3392
  exports.validateEditorConfig = validateEditorConfig;
3276
3393
  exports.validateEnvKey = validateEnvKey;
3394
+ exports.validatePackageExports = validatePackageExports;
3277
3395
  exports.validateTsconfig = validateTsconfig;
@@ -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, m as EditorConfigProperty, n as EditorConfigSection, o as EditorConfigValidationResult, p as EnvEntry, q as EnvParseResult, G as GitCommandConfig, r as GitCommandResult, s as GitOperation, t as GithubUrlInfo, u as GithubUrlType, v as GitignoreTestResult, w as GqlFormatResult, H as HtmlFormatResult, x as HtmlMinifyOptions, y as HtmlMinifyResult, J as JsMinifyOptions, z as JsMinifyResult, M as MIME_TABLE, B as MatchResult, F as MimeEntry, I as MimeLookupResult, O as OPERATIONS, P as ParsedSpec, R as RedosFinding, K as RedosResult, L as RedosSeverity, N as RegexError, Q as RegexFlag, S as RegexMatch, T as RegexResult, U as RegexSuccess, V as SQL_DEFAULT_OPTIONS, W as Segment, X as SpecVersion, Y as SqlDialect, Z as SqlFormatOptions, _ as TestPatternResult, $ as TsconfigIssue, a0 as TsconfigValidationResult, a1 as buildDockerPull, a2 as buildDockerRun, a3 as buildGitCommand, a4 as collapseHtmlWhitespace, a5 as collapseJsWhitespace, a6 as countProperties, a7 as countRules, a8 as detectDialect, a9 as detectOperationType, aa as detectRedos, ab as envToExport, ac as envToJson, ad as formatCss, ae as formatGql, af as formatHtml, ag as formatSql, ah as getEndpointsByTag, ai as getHtmlStats, aj as getJsStats, ak as getMethodColor, al as isValidTag, am as lintConventionalCommit, an as lookupMime, ao as minifyCss, ap as minifyGql, aq as minifyHtml, ar as minifyJs, as as minifySql, at as normalizeRef, au as parseDockerImage, av as parseEnv, aw as parseGitCommand, ax as parseGithubUrl, ay as parseSpec, az as removeConsoleCalls, aA as removeEmptyAttributes, aB as removeHtmlComments, aC as removeJsComments, aD as removeRedundantAttributes, aE as searchCheatsheet, aF as searchEndpoints, aG as splitStatements, aH as testGitignorePatterns, aI as testPattern, aJ as testRegex, aK as validateEditorConfig, aL as validateEnvKey, aM as validateTsconfig } from '../code-B_gDkRAx.cjs';
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, m as EditorConfigProperty, n as EditorConfigSection, o as EditorConfigValidationResult, p as EnvEntry, q as EnvParseResult, r as ExportsIssue, s as ExportsShape, t as ExportsValidationResult, G as GitCommandConfig, u as GitCommandResult, v as GitOperation, w as GithubUrlInfo, x as GithubUrlType, y as GitignoreTestResult, z as GqlFormatResult, H as HtmlFormatResult, B as HtmlMinifyOptions, F as HtmlMinifyResult, J as JsMinifyOptions, I as JsMinifyResult, M as MIME_TABLE, K as MatchResult, L as MimeEntry, N as MimeLookupResult, O as OPERATIONS, P as ParsedSpec, R as RedosFinding, Q as RedosResult, S as RedosSeverity, T as RegexError, U as RegexFlag, V as RegexMatch, W as RegexResult, X as RegexSuccess, Y as SQL_DEFAULT_OPTIONS, Z as Segment, _ as SpecVersion, $ as SqlDialect, a0 as SqlFormatOptions, a1 as TestPatternResult, a2 as TsconfigIssue, a3 as TsconfigValidationResult, a4 as buildDockerPull, a5 as buildDockerRun, a6 as buildGitCommand, a7 as collapseHtmlWhitespace, a8 as collapseJsWhitespace, a9 as countProperties, aa as countRules, ab as detectDialect, ac as detectOperationType, ad as detectRedos, ae as envToExport, af as envToJson, ag as formatCss, ah as formatGql, ai as formatHtml, aj as formatSql, ak as getEndpointsByTag, al as getHtmlStats, am as getJsStats, an as getMethodColor, ao as isValidTag, ap as lintConventionalCommit, aq as lookupMime, ar as minifyCss, as as minifyGql, at as minifyHtml, au as minifyJs, av as minifySql, aw as normalizeRef, ax as parseDockerImage, ay as parseEnv, az as parseGitCommand, aA as parseGithubUrl, aB as parseSpec, aC as removeConsoleCalls, aD as removeEmptyAttributes, aE as removeHtmlComments, aF as removeJsComments, aG as removeRedundantAttributes, aH as searchCheatsheet, aI as searchEndpoints, aJ as splitStatements, aK as testGitignorePatterns, aL as testPattern, aM as testRegex, aN as validateEditorConfig, aO as validateEnvKey, aP as validatePackageExports, aQ as validateTsconfig } from '../code-rxidGgvB.cjs';
@@ -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, m as EditorConfigProperty, n as EditorConfigSection, o as EditorConfigValidationResult, p as EnvEntry, q as EnvParseResult, G as GitCommandConfig, r as GitCommandResult, s as GitOperation, t as GithubUrlInfo, u as GithubUrlType, v as GitignoreTestResult, w as GqlFormatResult, H as HtmlFormatResult, x as HtmlMinifyOptions, y as HtmlMinifyResult, J as JsMinifyOptions, z as JsMinifyResult, M as MIME_TABLE, B as MatchResult, F as MimeEntry, I as MimeLookupResult, O as OPERATIONS, P as ParsedSpec, R as RedosFinding, K as RedosResult, L as RedosSeverity, N as RegexError, Q as RegexFlag, S as RegexMatch, T as RegexResult, U as RegexSuccess, V as SQL_DEFAULT_OPTIONS, W as Segment, X as SpecVersion, Y as SqlDialect, Z as SqlFormatOptions, _ as TestPatternResult, $ as TsconfigIssue, a0 as TsconfigValidationResult, a1 as buildDockerPull, a2 as buildDockerRun, a3 as buildGitCommand, a4 as collapseHtmlWhitespace, a5 as collapseJsWhitespace, a6 as countProperties, a7 as countRules, a8 as detectDialect, a9 as detectOperationType, aa as detectRedos, ab as envToExport, ac as envToJson, ad as formatCss, ae as formatGql, af as formatHtml, ag as formatSql, ah as getEndpointsByTag, ai as getHtmlStats, aj as getJsStats, ak as getMethodColor, al as isValidTag, am as lintConventionalCommit, an as lookupMime, ao as minifyCss, ap as minifyGql, aq as minifyHtml, ar as minifyJs, as as minifySql, at as normalizeRef, au as parseDockerImage, av as parseEnv, aw as parseGitCommand, ax as parseGithubUrl, ay as parseSpec, az as removeConsoleCalls, aA as removeEmptyAttributes, aB as removeHtmlComments, aC as removeJsComments, aD as removeRedundantAttributes, aE as searchCheatsheet, aF as searchEndpoints, aG as splitStatements, aH as testGitignorePatterns, aI as testPattern, aJ as testRegex, aK as validateEditorConfig, aL as validateEnvKey, aM as validateTsconfig } from '../code-B_gDkRAx.js';
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, m as EditorConfigProperty, n as EditorConfigSection, o as EditorConfigValidationResult, p as EnvEntry, q as EnvParseResult, r as ExportsIssue, s as ExportsShape, t as ExportsValidationResult, G as GitCommandConfig, u as GitCommandResult, v as GitOperation, w as GithubUrlInfo, x as GithubUrlType, y as GitignoreTestResult, z as GqlFormatResult, H as HtmlFormatResult, B as HtmlMinifyOptions, F as HtmlMinifyResult, J as JsMinifyOptions, I as JsMinifyResult, M as MIME_TABLE, K as MatchResult, L as MimeEntry, N as MimeLookupResult, O as OPERATIONS, P as ParsedSpec, R as RedosFinding, Q as RedosResult, S as RedosSeverity, T as RegexError, U as RegexFlag, V as RegexMatch, W as RegexResult, X as RegexSuccess, Y as SQL_DEFAULT_OPTIONS, Z as Segment, _ as SpecVersion, $ as SqlDialect, a0 as SqlFormatOptions, a1 as TestPatternResult, a2 as TsconfigIssue, a3 as TsconfigValidationResult, a4 as buildDockerPull, a5 as buildDockerRun, a6 as buildGitCommand, a7 as collapseHtmlWhitespace, a8 as collapseJsWhitespace, a9 as countProperties, aa as countRules, ab as detectDialect, ac as detectOperationType, ad as detectRedos, ae as envToExport, af as envToJson, ag as formatCss, ah as formatGql, ai as formatHtml, aj as formatSql, ak as getEndpointsByTag, al as getHtmlStats, am as getJsStats, an as getMethodColor, ao as isValidTag, ap as lintConventionalCommit, aq as lookupMime, ar as minifyCss, as as minifyGql, at as minifyHtml, au as minifyJs, av as minifySql, aw as normalizeRef, ax as parseDockerImage, ay as parseEnv, az as parseGitCommand, aA as parseGithubUrl, aB as parseSpec, aC as removeConsoleCalls, aD as removeEmptyAttributes, aE as removeHtmlComments, aF as removeJsComments, aG as removeRedundantAttributes, aH as searchCheatsheet, aI as searchEndpoints, aJ as splitStatements, aK as testGitignorePatterns, aL as testPattern, aM as testRegex, aN as validateEditorConfig, aO as validateEnvKey, aP as validatePackageExports, aQ as validateTsconfig } from '../code-rxidGgvB.js';
@@ -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, validateTsconfig } from '../chunk-K4ZERKBD.js';
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-JW4NG2GN.js';
2
2
  import '../chunk-MLKGABMK.js';
@@ -1578,6 +1578,59 @@ function findCsvDuplicateRows(input, options) {
1578
1578
  uniqueRowCount: parsed.rows.length - duplicateRowCount + duplicateGroups.length
1579
1579
  };
1580
1580
  }
1581
+ var _ISO_DATE_RE = /^\d{4}-\d{2}-\d{2}(T\d{2}:\d{2}:\d{2}(\.\d+)?(Z|[+-]\d{2}:\d{2})?)?$/;
1582
+ function _classifyCsvValue(raw) {
1583
+ const v = raw.trim();
1584
+ if (v === "") return "empty";
1585
+ if (/^(true|false)$/i.test(v)) return "boolean";
1586
+ if (/^-?\d+$/.test(v)) return "integer";
1587
+ if (/^-?\d+\.\d+$/.test(v)) return "float";
1588
+ if (_ISO_DATE_RE.test(v)) return "date";
1589
+ return "string";
1590
+ }
1591
+ function inferCsvColumnTypes(input, options) {
1592
+ const parsed = parseCsv(input, {
1593
+ delimiter: options?.delimiter ?? ",",
1594
+ hasHeader: options?.hasHeader !== false
1595
+ });
1596
+ if ("error" in parsed) return parsed;
1597
+ const columns = parsed.headers.map((name, colIdx) => {
1598
+ const seen = /* @__PURE__ */ new Set();
1599
+ let sawString = false;
1600
+ let nullCount = 0;
1601
+ const sampleValues = [];
1602
+ for (const row of parsed.rows) {
1603
+ const raw = row[colIdx] ?? "";
1604
+ const kind = _classifyCsvValue(raw);
1605
+ if (kind === "empty") {
1606
+ nullCount++;
1607
+ continue;
1608
+ }
1609
+ if (sampleValues.length < 3) sampleValues.push(raw);
1610
+ if (kind === "string") sawString = true;
1611
+ else seen.add(kind);
1612
+ }
1613
+ let inferredType;
1614
+ if (sawString || seen.size === 0) {
1615
+ inferredType = "string";
1616
+ } else if (seen.size === 1) {
1617
+ inferredType = [...seen][0];
1618
+ } else if (seen.has("integer") && seen.has("float") && seen.size === 2) {
1619
+ inferredType = "float";
1620
+ } else {
1621
+ inferredType = "string";
1622
+ }
1623
+ return {
1624
+ name,
1625
+ inferredType,
1626
+ nullable: nullCount > 0,
1627
+ nullCount,
1628
+ totalCount: parsed.rows.length,
1629
+ sampleValues
1630
+ };
1631
+ });
1632
+ return { columns, rowCount: parsed.rows.length };
1633
+ }
1581
1634
  var _YAML_ANCHOR_RE = /(?:^|\s)&([A-Za-z0-9_.-]+)/g;
1582
1635
  var _YAML_ALIAS_RE = /(?:^|\s)\*([A-Za-z0-9_.-]+)/g;
1583
1636
  function _stripYamlLineComment(line) {
@@ -1710,6 +1763,7 @@ exports.getSectionNames = getSectionNames;
1710
1763
  exports.getTomlStats = getTomlStats;
1711
1764
  exports.getXmlStats = getXmlStats;
1712
1765
  exports.getYamlStats = getYamlStats;
1766
+ exports.inferCsvColumnTypes = inferCsvColumnTypes;
1713
1767
  exports.iniToJson = iniToJson;
1714
1768
  exports.jsonArrayToNdjson = jsonArrayToNdjson;
1715
1769
  exports.jsonToIni = jsonToIni;
@@ -1 +1 @@
1
- export { C as CaptionSpeedCue, a as CaptionSpeedResult, b as ConvertedSubtitles, c as CsvDuplicateGroup, e as CsvDuplicateOptions, f as CsvDuplicateResult, g as CsvParseResult, h as CsvToSqlOptions, i as CsvToSqlResult, E as EnvDiffError, j as EnvDiffResult, k as EnvEntry, l as EnvParseResult, F as FrontMatterError, m as FrontMatterResult, I as IniSection, M as MarkdownTaskListItem, n as MarkdownTaskListProgressResult, o as MarkdownTaskListSectionSummary, p as MarkdownTocEntry, q as MarkdownTocOptions, r as MarkdownTocResult, N as NdjsonLineResult, s as NdjsonValidateResult, P as ParseOptions, t as ParsedIni, u as ParsedSubtitles, S as SubtitleCue, v as SubtitleFormat, T as TomlFormatResult, V as ValidationResult, X as XmlFormatResult, w as XmlToJsonOptions, Y as YamlAnchorInfo, x as YamlAnchorResolveError, y as YamlAnchorResolveResult, z as analyzeCaptionSpeed, A as calculateMarkdownTaskListProgress, B as convertSubtitles, D as csvToJson, G as csvToSqlInsert, H as detectDelimiter, J as detectSubtitleFormat, K as diffEnvExample, L as envToExport, O as envToJson, Q as findCsvDuplicateRows, R as formatNdjson, U as formatSubtitleTimestamp, W as formatToml, Z as formatXml, _ as generateMarkdownToc, $ as getSection, a0 as getSectionNames, a1 as getTomlStats, a2 as getXmlStats, a3 as getYamlStats, a4 as iniToJson, a5 as jsonArrayToNdjson, a6 as jsonToIni, a7 as jsonToToml, a8 as jsonToXml, a9 as minifyNdjson, aa as minifyToml, ab as minifyXml, ac as ndjsonToJsonArray, ad as parseCsv, ae as parseEnv, af as parseFrontMatter, ag as parseIni, ah as parseSubtitleTimestamp, ai as parseSubtitles, aj as parseXmlToObject, ak as resolveYamlAnchors, al as serializeSubtitles, am as shiftSubtitles, an as stringifyIni, ao as toCsvString, ap as tomlToJson, aq as validateEnvKey, ar as validateIni, as as validateNdjson, at as validateToml, au as validateXml, av as validateYaml, aw as xmlToJson } from '../data-CupeugaR.cjs';
1
+ export { C as CaptionSpeedCue, a as CaptionSpeedResult, b as ConvertedSubtitles, c as CsvColumnType, e as CsvColumnTypeInfo, f as CsvColumnTypeOptions, g as CsvColumnTypeResult, h as CsvDuplicateGroup, i as CsvDuplicateOptions, j as CsvDuplicateResult, k as CsvParseResult, l as CsvToSqlOptions, m as CsvToSqlResult, E as EnvDiffError, n as EnvDiffResult, o as EnvEntry, p as EnvParseResult, F as FrontMatterError, q as FrontMatterResult, I as IniSection, M as MarkdownTaskListItem, r as MarkdownTaskListProgressResult, s as MarkdownTaskListSectionSummary, t as MarkdownTocEntry, u as MarkdownTocOptions, v as MarkdownTocResult, N as NdjsonLineResult, w as NdjsonValidateResult, P as ParseOptions, x as ParsedIni, y as ParsedSubtitles, S as SubtitleCue, z as SubtitleFormat, T as TomlFormatResult, V as ValidationResult, X as XmlFormatResult, A as XmlToJsonOptions, Y as YamlAnchorInfo, B as YamlAnchorResolveError, D as YamlAnchorResolveResult, G as analyzeCaptionSpeed, H as calculateMarkdownTaskListProgress, J as convertSubtitles, K as csvToJson, L as csvToSqlInsert, O as detectDelimiter, Q as detectSubtitleFormat, R as diffEnvExample, U as envToExport, W as envToJson, Z as findCsvDuplicateRows, _ as formatNdjson, $ as formatSubtitleTimestamp, a0 as formatToml, a1 as formatXml, a2 as generateMarkdownToc, a3 as getSection, a4 as getSectionNames, a5 as getTomlStats, a6 as getXmlStats, a7 as getYamlStats, a8 as inferCsvColumnTypes, a9 as iniToJson, aa as jsonArrayToNdjson, ab as jsonToIni, ac as jsonToToml, ad as jsonToXml, ae as minifyNdjson, af as minifyToml, ag as minifyXml, ah as ndjsonToJsonArray, ai as parseCsv, aj as parseEnv, ak as parseFrontMatter, al as parseIni, am as parseSubtitleTimestamp, an as parseSubtitles, ao as parseXmlToObject, ap as resolveYamlAnchors, aq as serializeSubtitles, ar as shiftSubtitles, as as stringifyIni, at as toCsvString, au as tomlToJson, av as validateEnvKey, aw as validateIni, ax as validateNdjson, ay as validateToml, az as validateXml, aA as validateYaml, aB as xmlToJson } from '../data-Cvyg8ZXo.cjs';
@@ -1 +1 @@
1
- export { C as CaptionSpeedCue, a as CaptionSpeedResult, b as ConvertedSubtitles, c as CsvDuplicateGroup, e as CsvDuplicateOptions, f as CsvDuplicateResult, g as CsvParseResult, h as CsvToSqlOptions, i as CsvToSqlResult, E as EnvDiffError, j as EnvDiffResult, k as EnvEntry, l as EnvParseResult, F as FrontMatterError, m as FrontMatterResult, I as IniSection, M as MarkdownTaskListItem, n as MarkdownTaskListProgressResult, o as MarkdownTaskListSectionSummary, p as MarkdownTocEntry, q as MarkdownTocOptions, r as MarkdownTocResult, N as NdjsonLineResult, s as NdjsonValidateResult, P as ParseOptions, t as ParsedIni, u as ParsedSubtitles, S as SubtitleCue, v as SubtitleFormat, T as TomlFormatResult, V as ValidationResult, X as XmlFormatResult, w as XmlToJsonOptions, Y as YamlAnchorInfo, x as YamlAnchorResolveError, y as YamlAnchorResolveResult, z as analyzeCaptionSpeed, A as calculateMarkdownTaskListProgress, B as convertSubtitles, D as csvToJson, G as csvToSqlInsert, H as detectDelimiter, J as detectSubtitleFormat, K as diffEnvExample, L as envToExport, O as envToJson, Q as findCsvDuplicateRows, R as formatNdjson, U as formatSubtitleTimestamp, W as formatToml, Z as formatXml, _ as generateMarkdownToc, $ as getSection, a0 as getSectionNames, a1 as getTomlStats, a2 as getXmlStats, a3 as getYamlStats, a4 as iniToJson, a5 as jsonArrayToNdjson, a6 as jsonToIni, a7 as jsonToToml, a8 as jsonToXml, a9 as minifyNdjson, aa as minifyToml, ab as minifyXml, ac as ndjsonToJsonArray, ad as parseCsv, ae as parseEnv, af as parseFrontMatter, ag as parseIni, ah as parseSubtitleTimestamp, ai as parseSubtitles, aj as parseXmlToObject, ak as resolveYamlAnchors, al as serializeSubtitles, am as shiftSubtitles, an as stringifyIni, ao as toCsvString, ap as tomlToJson, aq as validateEnvKey, ar as validateIni, as as validateNdjson, at as validateToml, au as validateXml, av as validateYaml, aw as xmlToJson } from '../data-CupeugaR.js';
1
+ export { C as CaptionSpeedCue, a as CaptionSpeedResult, b as ConvertedSubtitles, c as CsvColumnType, e as CsvColumnTypeInfo, f as CsvColumnTypeOptions, g as CsvColumnTypeResult, h as CsvDuplicateGroup, i as CsvDuplicateOptions, j as CsvDuplicateResult, k as CsvParseResult, l as CsvToSqlOptions, m as CsvToSqlResult, E as EnvDiffError, n as EnvDiffResult, o as EnvEntry, p as EnvParseResult, F as FrontMatterError, q as FrontMatterResult, I as IniSection, M as MarkdownTaskListItem, r as MarkdownTaskListProgressResult, s as MarkdownTaskListSectionSummary, t as MarkdownTocEntry, u as MarkdownTocOptions, v as MarkdownTocResult, N as NdjsonLineResult, w as NdjsonValidateResult, P as ParseOptions, x as ParsedIni, y as ParsedSubtitles, S as SubtitleCue, z as SubtitleFormat, T as TomlFormatResult, V as ValidationResult, X as XmlFormatResult, A as XmlToJsonOptions, Y as YamlAnchorInfo, B as YamlAnchorResolveError, D as YamlAnchorResolveResult, G as analyzeCaptionSpeed, H as calculateMarkdownTaskListProgress, J as convertSubtitles, K as csvToJson, L as csvToSqlInsert, O as detectDelimiter, Q as detectSubtitleFormat, R as diffEnvExample, U as envToExport, W as envToJson, Z as findCsvDuplicateRows, _ as formatNdjson, $ as formatSubtitleTimestamp, a0 as formatToml, a1 as formatXml, a2 as generateMarkdownToc, a3 as getSection, a4 as getSectionNames, a5 as getTomlStats, a6 as getXmlStats, a7 as getYamlStats, a8 as inferCsvColumnTypes, a9 as iniToJson, aa as jsonArrayToNdjson, ab as jsonToIni, ac as jsonToToml, ad as jsonToXml, ae as minifyNdjson, af as minifyToml, ag as minifyXml, ah as ndjsonToJsonArray, ai as parseCsv, aj as parseEnv, ak as parseFrontMatter, al as parseIni, am as parseSubtitleTimestamp, an as parseSubtitles, ao as parseXmlToObject, ap as resolveYamlAnchors, aq as serializeSubtitles, ar as shiftSubtitles, as as stringifyIni, at as toCsvString, au as tomlToJson, av as validateEnvKey, aw as validateIni, ax as validateNdjson, ay as validateToml, az as validateXml, aA as validateYaml, aB as xmlToJson } from '../data-Cvyg8ZXo.js';
@@ -1,2 +1,2 @@
1
- export { analyzeCaptionSpeed, calculateMarkdownTaskListProgress, convertSubtitles, csvToJson, csvToSqlInsert, detectDelimiter, detectSubtitleFormat, diffEnvExample, envToExport, envToJson, findCsvDuplicateRows, formatNdjson, formatSubtitleTimestamp, formatToml, formatXml, generateMarkdownToc, getSection, getSectionNames, getTomlStats, getXmlStats, getYamlStats, iniToJson, jsonArrayToNdjson, jsonToIni, jsonToToml, jsonToXml, minifyNdjson, minifyToml, minifyXml, ndjsonToJsonArray, parseCsv, parseEnv, parseFrontMatter, parseIni, parseSubtitleTimestamp, parseSubtitles, parseXmlToObject, resolveYamlAnchors, serializeSubtitles, shiftSubtitles, stringifyIni, toCsvString, tomlToJson, validateEnvKey, validateIni, validateNdjson, validateToml, validateXml, validateYaml, xmlToJson } from '../chunk-3KIUADK4.js';
1
+ export { analyzeCaptionSpeed, calculateMarkdownTaskListProgress, convertSubtitles, csvToJson, csvToSqlInsert, detectDelimiter, detectSubtitleFormat, diffEnvExample, envToExport, envToJson, findCsvDuplicateRows, formatNdjson, formatSubtitleTimestamp, formatToml, formatXml, generateMarkdownToc, getSection, getSectionNames, getTomlStats, getXmlStats, getYamlStats, inferCsvColumnTypes, iniToJson, jsonArrayToNdjson, jsonToIni, jsonToToml, jsonToXml, minifyNdjson, minifyToml, minifyXml, ndjsonToJsonArray, parseCsv, parseEnv, parseFrontMatter, parseIni, parseSubtitleTimestamp, parseSubtitles, parseXmlToObject, resolveYamlAnchors, serializeSubtitles, shiftSubtitles, stringifyIni, toCsvString, tomlToJson, validateEnvKey, validateIni, validateNdjson, validateToml, validateXml, validateYaml, xmlToJson } from '../chunk-56VFNHVO.js';
2
2
  import '../chunk-MLKGABMK.js';