@utilix-tech/sdk 0.33.0 → 0.35.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 -8
- package/dist/{chunk-CSNTHZHF.js → chunk-3YUKLV5N.js} +81 -1
- package/dist/{chunk-ZPQOE7KD.js → chunk-7AJRK57W.js} +29 -1
- package/dist/{chunk-H2USEUHD.js → chunk-F2CEN226.js} +306 -1
- package/dist/{chunk-6FIB72KX.js → chunk-YEXQDI3J.js} +63 -1
- package/dist/{data-C4lCByXw.d.cts → data-CFeS9kes.d.cts} +35 -2
- package/dist/{data-C4lCByXw.d.ts → data-CFeS9kes.d.ts} +35 -2
- package/dist/index.cjs +475 -0
- package/dist/index.d.cts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +4 -4
- package/dist/{network-D7Epuerc.d.cts → network-DfY5Ikvr.d.cts} +34 -2
- package/dist/{network-D7Epuerc.d.ts → network-DfY5Ikvr.d.ts} +34 -2
- package/dist/{text-CA-zuD0C.d.cts → text-kHkT9VtT.d.cts} +34 -2
- package/dist/{text-CA-zuD0C.d.ts → text-kHkT9VtT.d.ts} +34 -2
- package/dist/tools/data.cjs +62 -0
- package/dist/tools/data.d.cts +1 -1
- package/dist/tools/data.d.ts +1 -1
- package/dist/tools/data.js +1 -1
- package/dist/tools/network.cjs +80 -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/text.cjs +305 -0
- package/dist/tools/text.d.cts +1 -1
- package/dist/tools/text.d.ts +1 -1
- package/dist/tools/text.js +1 -1
- package/dist/tools/units.cjs +28 -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-BhoxdHhs.d.ts → units-c90DW-OZ.d.cts} +30 -2
- package/dist/{units-BhoxdHhs.d.cts → units-c90DW-OZ.d.ts} +30 -2
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
export { j as json } from './json-Ta9JykSB.js';
|
|
2
2
|
export { e as encoding } from './encoding-Dk3wpmb3.js';
|
|
3
3
|
export { h as hashing } from './hashing-CnetQFD_.js';
|
|
4
|
-
export { t as text } from './text-
|
|
5
|
-
export { d as data } from './data-
|
|
4
|
+
export { t as text } from './text-kHkT9VtT.js';
|
|
5
|
+
export { d as data } from './data-CFeS9kes.js';
|
|
6
6
|
export { g as generators } from './generators-Du8cBesn.js';
|
|
7
7
|
export { t as time } from './time-KqJjdqII.js';
|
|
8
|
-
export { u as units } from './units-
|
|
9
|
-
export { n as network } from './network-
|
|
8
|
+
export { u as units } from './units-c90DW-OZ.js';
|
|
9
|
+
export { n as network } from './network-DfY5Ikvr.js';
|
|
10
10
|
export { a as api } from './api-DmTNE4c1.js';
|
|
11
11
|
export { c as code } from './code-BK-x8hVx.js';
|
|
12
12
|
export { c as color } from './color-tPwZCr9H.js';
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { media_exports as media } from './chunk-L6V4W4SU.js';
|
|
2
|
-
export { units_exports as units } from './chunk-
|
|
3
|
-
export { network_exports as network } from './chunk-
|
|
2
|
+
export { units_exports as units } from './chunk-7AJRK57W.js';
|
|
3
|
+
export { network_exports as network } from './chunk-3YUKLV5N.js';
|
|
4
4
|
export { api_exports as api } from './chunk-52ZDKSIX.js';
|
|
5
5
|
export { code_exports as code } from './chunk-UUT5HNST.js';
|
|
6
6
|
export { color_exports as color } from './chunk-BPVAB4P2.js';
|
|
@@ -10,8 +10,8 @@ export { ai_agent_exports as ai_agent } from './chunk-W3J7GZVQ.js';
|
|
|
10
10
|
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-GEFVMGZR.js';
|
|
13
|
-
export { text_exports as text } from './chunk-
|
|
14
|
-
export { data_exports as data } from './chunk-
|
|
13
|
+
export { text_exports as text } from './chunk-F2CEN226.js';
|
|
14
|
+
export { data_exports as data } from './chunk-YEXQDI3J.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';
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
* - robots-txt-validator: validateRobotsTxt
|
|
13
13
|
* - user-agent-parser: parseUserAgent
|
|
14
14
|
* - cache-control-builder: buildCacheControl
|
|
15
|
+
* - referrer-policy-builder: buildReferrerPolicy
|
|
15
16
|
* - ipv6-compressor: parseIpv6Address
|
|
16
17
|
*/
|
|
17
18
|
declare const DNS_RECORD_TYPES: readonly ["A", "AAAA", "CNAME", "MX", "TXT", "NS", "SOA", "PTR", "SRV", "CAA"];
|
|
@@ -292,6 +293,32 @@ interface CacheControlResult {
|
|
|
292
293
|
declare function buildCacheControl(options?: CacheControlOptions): CacheControlResult | {
|
|
293
294
|
error: string;
|
|
294
295
|
};
|
|
296
|
+
type ReferrerPolicyValue = 'no-referrer' | 'no-referrer-when-downgrade' | 'origin' | 'origin-when-cross-origin' | 'same-origin' | 'strict-origin' | 'strict-origin-when-cross-origin' | 'unsafe-url';
|
|
297
|
+
interface ReferrerPolicyEntry {
|
|
298
|
+
value: ReferrerPolicyValue;
|
|
299
|
+
explanation: string;
|
|
300
|
+
leaksPathAndQuery: boolean;
|
|
301
|
+
sentOnDowngrade: boolean;
|
|
302
|
+
}
|
|
303
|
+
interface ReferrerPolicyResult {
|
|
304
|
+
header: string;
|
|
305
|
+
headerName: 'Referrer-Policy';
|
|
306
|
+
snippet: string;
|
|
307
|
+
metaTag: string;
|
|
308
|
+
policies: ReferrerPolicyEntry[];
|
|
309
|
+
warnings: string[];
|
|
310
|
+
}
|
|
311
|
+
declare const REFERRER_POLICY_VALUES: ReferrerPolicyValue[];
|
|
312
|
+
/**
|
|
313
|
+
* Build a `Referrer-Policy` header value from one or more policy tokens
|
|
314
|
+
* (a fallback chain: a browser that doesn't recognize an earlier token
|
|
315
|
+
* falls through to the next one, per the Referrer Policy spec), with a
|
|
316
|
+
* plain-English explanation of each token and warnings for risky choices.
|
|
317
|
+
* Pure string assembly and lookup; it never inspects real request traffic.
|
|
318
|
+
*/
|
|
319
|
+
declare function buildReferrerPolicy(policies: string | string[]): ReferrerPolicyResult | {
|
|
320
|
+
error: string;
|
|
321
|
+
};
|
|
295
322
|
type Ipv6AddressType = 'unspecified' | 'loopback' | 'link-local' | 'unique-local' | 'multicast' | 'ipv4-mapped' | 'documentation' | 'global-unicast';
|
|
296
323
|
interface Ipv6ParseResult {
|
|
297
324
|
expanded: string;
|
|
@@ -328,6 +355,10 @@ type network_Ipv6AddressType = Ipv6AddressType;
|
|
|
328
355
|
type network_Ipv6ParseResult = Ipv6ParseResult;
|
|
329
356
|
type network_ParsedDnsResult = ParsedDnsResult;
|
|
330
357
|
type network_ParsedGeoResult = ParsedGeoResult;
|
|
358
|
+
declare const network_REFERRER_POLICY_VALUES: typeof REFERRER_POLICY_VALUES;
|
|
359
|
+
type network_ReferrerPolicyEntry = ReferrerPolicyEntry;
|
|
360
|
+
type network_ReferrerPolicyResult = ReferrerPolicyResult;
|
|
361
|
+
type network_ReferrerPolicyValue = ReferrerPolicyValue;
|
|
331
362
|
type network_RobotsGroup = RobotsGroup;
|
|
332
363
|
type network_RobotsIssue = RobotsIssue;
|
|
333
364
|
type network_RobotsRule = RobotsRule;
|
|
@@ -344,6 +375,7 @@ declare const network_buildCacheControl: typeof buildCacheControl;
|
|
|
344
375
|
declare const network_buildDnsQueryUrl: typeof buildDnsQueryUrl;
|
|
345
376
|
declare const network_buildGeoUrl: typeof buildGeoUrl;
|
|
346
377
|
declare const network_buildMapUrl: typeof buildMapUrl;
|
|
378
|
+
declare const network_buildReferrerPolicy: typeof buildReferrerPolicy;
|
|
347
379
|
declare const network_countryCodeToFlag: typeof countryCodeToFlag;
|
|
348
380
|
declare const network_formatCoordinates: typeof formatCoordinates;
|
|
349
381
|
declare const network_formatTtl: typeof formatTtl;
|
|
@@ -373,7 +405,7 @@ declare const network_validateHeaderValue: typeof validateHeaderValue;
|
|
|
373
405
|
declare const network_validateRobotsTxt: typeof validateRobotsTxt;
|
|
374
406
|
declare const network_validateSitemap: typeof validateSitemap;
|
|
375
407
|
declare namespace network {
|
|
376
|
-
export { type network_CacheControlDirective as CacheControlDirective, type network_CacheControlOptions as CacheControlOptions, type network_CacheControlResult as CacheControlResult, 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_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, type network_ParsedDnsResult as ParsedDnsResult, type network_ParsedGeoResult as ParsedGeoResult, 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_SitemapIndexEntry as SitemapIndexEntry, type network_SitemapIssue as SitemapIssue, type network_SitemapUrlEntry as SitemapUrlEntry, type network_SitemapValidationResult as SitemapValidationResult, type network_StatusCode as StatusCode, type network_UaDeviceType as UaDeviceType, type network_UserAgentInfo as UserAgentInfo, network_buildCacheControl as buildCacheControl, network_buildDnsQueryUrl as buildDnsQueryUrl, network_buildGeoUrl as buildGeoUrl, network_buildMapUrl as buildMapUrl, 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_parseDnsResponse as parseDnsResponse, network_parseGeoResponse as parseGeoResponse, network_parseHar as parseHar, network_parseIpv6Address as parseIpv6Address, network_parseUserAgent as parseUserAgent, network_searchHeaders as searchHeaders, network_searchStatusCodes as searchStatusCodes, network_statusCodeToText as statusCodeToText, network_typeNumberToLabel as typeNumberToLabel, network_validateDomain as validateDomain, network_validateHeaderName as validateHeaderName, network_validateHeaderValue as validateHeaderValue, network_validateRobotsTxt as validateRobotsTxt, network_validateSitemap as validateSitemap };
|
|
408
|
+
export { type network_CacheControlDirective as CacheControlDirective, type network_CacheControlOptions as CacheControlOptions, type network_CacheControlResult as CacheControlResult, 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_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, type network_ParsedDnsResult as ParsedDnsResult, type network_ParsedGeoResult as ParsedGeoResult, network_REFERRER_POLICY_VALUES as REFERRER_POLICY_VALUES, 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_SitemapIndexEntry as SitemapIndexEntry, type network_SitemapIssue as SitemapIssue, type network_SitemapUrlEntry as SitemapUrlEntry, type network_SitemapValidationResult as SitemapValidationResult, type network_StatusCode as StatusCode, type network_UaDeviceType as UaDeviceType, type network_UserAgentInfo as UserAgentInfo, network_buildCacheControl as buildCacheControl, network_buildDnsQueryUrl as buildDnsQueryUrl, network_buildGeoUrl as buildGeoUrl, network_buildMapUrl as buildMapUrl, network_buildReferrerPolicy as buildReferrerPolicy, 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_parseDnsResponse as parseDnsResponse, network_parseGeoResponse as parseGeoResponse, network_parseHar as parseHar, network_parseIpv6Address as parseIpv6Address, network_parseUserAgent as parseUserAgent, network_searchHeaders as searchHeaders, network_searchStatusCodes as searchStatusCodes, network_statusCodeToText as statusCodeToText, network_typeNumberToLabel as typeNumberToLabel, network_validateDomain as validateDomain, network_validateHeaderName as validateHeaderName, network_validateHeaderValue as validateHeaderValue, network_validateRobotsTxt as validateRobotsTxt, network_validateSitemap as validateSitemap };
|
|
377
409
|
}
|
|
378
410
|
|
|
379
|
-
export {
|
|
411
|
+
export { isValidIpv6 as $, buildCacheControl as A, buildDnsQueryUrl as B, type CacheControlDirective as C, DNS_RECORD_TYPES as D, buildGeoUrl as E, buildMapUrl as F, type GeoResult as G, HTTP_HEADERS as H, type Ipv6AddressType as I, buildReferrerPolicy as J, countryCodeToFlag as K, formatCoordinates as L, formatTtl as M, getByCategory as N, getHeader as O, type ParsedDnsResult as P, getHeadersByCategory as Q, REFERRER_POLICY_VALUES as R, STATUS_CODES as S, getStatusByCategory as T, type UaDeviceType as U, getStatusCode as V, isClientError as W, isServerError as X, isSuccess as Y, isValidIp as Z, isValidIpv4 as _, type CacheControlOptions as a, parseDnsResponse as a0, parseGeoResponse as a1, parseHar as a2, parseIpv6Address as a3, parseUserAgent as a4, searchHeaders as a5, searchStatusCodes as a6, statusCodeToText as a7, typeNumberToLabel as a8, validateDomain as a9, validateHeaderName as aa, validateHeaderValue as ab, validateRobotsTxt as ac, validateSitemap as ad, type CacheControlResult as b, type DnsRecord as c, type DnsRecordType as d, type DnsResponse as e, type HarEntry as f, type HarParseResult as g, type HarSummary as h, type HeaderCategory as i, type HttpHeader as j, type Ipv6ParseResult as k, type ParsedGeoResult as l, type ReferrerPolicyEntry as m, network as n, type ReferrerPolicyResult as o, type ReferrerPolicyValue as p, type RobotsGroup as q, type RobotsIssue as r, type RobotsRule as s, type RobotsValidationResult as t, type SitemapIndexEntry as u, type SitemapIssue as v, type SitemapUrlEntry as w, type SitemapValidationResult as x, type StatusCode as y, type UserAgentInfo as z };
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
* - robots-txt-validator: validateRobotsTxt
|
|
13
13
|
* - user-agent-parser: parseUserAgent
|
|
14
14
|
* - cache-control-builder: buildCacheControl
|
|
15
|
+
* - referrer-policy-builder: buildReferrerPolicy
|
|
15
16
|
* - ipv6-compressor: parseIpv6Address
|
|
16
17
|
*/
|
|
17
18
|
declare const DNS_RECORD_TYPES: readonly ["A", "AAAA", "CNAME", "MX", "TXT", "NS", "SOA", "PTR", "SRV", "CAA"];
|
|
@@ -292,6 +293,32 @@ interface CacheControlResult {
|
|
|
292
293
|
declare function buildCacheControl(options?: CacheControlOptions): CacheControlResult | {
|
|
293
294
|
error: string;
|
|
294
295
|
};
|
|
296
|
+
type ReferrerPolicyValue = 'no-referrer' | 'no-referrer-when-downgrade' | 'origin' | 'origin-when-cross-origin' | 'same-origin' | 'strict-origin' | 'strict-origin-when-cross-origin' | 'unsafe-url';
|
|
297
|
+
interface ReferrerPolicyEntry {
|
|
298
|
+
value: ReferrerPolicyValue;
|
|
299
|
+
explanation: string;
|
|
300
|
+
leaksPathAndQuery: boolean;
|
|
301
|
+
sentOnDowngrade: boolean;
|
|
302
|
+
}
|
|
303
|
+
interface ReferrerPolicyResult {
|
|
304
|
+
header: string;
|
|
305
|
+
headerName: 'Referrer-Policy';
|
|
306
|
+
snippet: string;
|
|
307
|
+
metaTag: string;
|
|
308
|
+
policies: ReferrerPolicyEntry[];
|
|
309
|
+
warnings: string[];
|
|
310
|
+
}
|
|
311
|
+
declare const REFERRER_POLICY_VALUES: ReferrerPolicyValue[];
|
|
312
|
+
/**
|
|
313
|
+
* Build a `Referrer-Policy` header value from one or more policy tokens
|
|
314
|
+
* (a fallback chain: a browser that doesn't recognize an earlier token
|
|
315
|
+
* falls through to the next one, per the Referrer Policy spec), with a
|
|
316
|
+
* plain-English explanation of each token and warnings for risky choices.
|
|
317
|
+
* Pure string assembly and lookup; it never inspects real request traffic.
|
|
318
|
+
*/
|
|
319
|
+
declare function buildReferrerPolicy(policies: string | string[]): ReferrerPolicyResult | {
|
|
320
|
+
error: string;
|
|
321
|
+
};
|
|
295
322
|
type Ipv6AddressType = 'unspecified' | 'loopback' | 'link-local' | 'unique-local' | 'multicast' | 'ipv4-mapped' | 'documentation' | 'global-unicast';
|
|
296
323
|
interface Ipv6ParseResult {
|
|
297
324
|
expanded: string;
|
|
@@ -328,6 +355,10 @@ type network_Ipv6AddressType = Ipv6AddressType;
|
|
|
328
355
|
type network_Ipv6ParseResult = Ipv6ParseResult;
|
|
329
356
|
type network_ParsedDnsResult = ParsedDnsResult;
|
|
330
357
|
type network_ParsedGeoResult = ParsedGeoResult;
|
|
358
|
+
declare const network_REFERRER_POLICY_VALUES: typeof REFERRER_POLICY_VALUES;
|
|
359
|
+
type network_ReferrerPolicyEntry = ReferrerPolicyEntry;
|
|
360
|
+
type network_ReferrerPolicyResult = ReferrerPolicyResult;
|
|
361
|
+
type network_ReferrerPolicyValue = ReferrerPolicyValue;
|
|
331
362
|
type network_RobotsGroup = RobotsGroup;
|
|
332
363
|
type network_RobotsIssue = RobotsIssue;
|
|
333
364
|
type network_RobotsRule = RobotsRule;
|
|
@@ -344,6 +375,7 @@ declare const network_buildCacheControl: typeof buildCacheControl;
|
|
|
344
375
|
declare const network_buildDnsQueryUrl: typeof buildDnsQueryUrl;
|
|
345
376
|
declare const network_buildGeoUrl: typeof buildGeoUrl;
|
|
346
377
|
declare const network_buildMapUrl: typeof buildMapUrl;
|
|
378
|
+
declare const network_buildReferrerPolicy: typeof buildReferrerPolicy;
|
|
347
379
|
declare const network_countryCodeToFlag: typeof countryCodeToFlag;
|
|
348
380
|
declare const network_formatCoordinates: typeof formatCoordinates;
|
|
349
381
|
declare const network_formatTtl: typeof formatTtl;
|
|
@@ -373,7 +405,7 @@ declare const network_validateHeaderValue: typeof validateHeaderValue;
|
|
|
373
405
|
declare const network_validateRobotsTxt: typeof validateRobotsTxt;
|
|
374
406
|
declare const network_validateSitemap: typeof validateSitemap;
|
|
375
407
|
declare namespace network {
|
|
376
|
-
export { type network_CacheControlDirective as CacheControlDirective, type network_CacheControlOptions as CacheControlOptions, type network_CacheControlResult as CacheControlResult, 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_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, type network_ParsedDnsResult as ParsedDnsResult, type network_ParsedGeoResult as ParsedGeoResult, 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_SitemapIndexEntry as SitemapIndexEntry, type network_SitemapIssue as SitemapIssue, type network_SitemapUrlEntry as SitemapUrlEntry, type network_SitemapValidationResult as SitemapValidationResult, type network_StatusCode as StatusCode, type network_UaDeviceType as UaDeviceType, type network_UserAgentInfo as UserAgentInfo, network_buildCacheControl as buildCacheControl, network_buildDnsQueryUrl as buildDnsQueryUrl, network_buildGeoUrl as buildGeoUrl, network_buildMapUrl as buildMapUrl, 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_parseDnsResponse as parseDnsResponse, network_parseGeoResponse as parseGeoResponse, network_parseHar as parseHar, network_parseIpv6Address as parseIpv6Address, network_parseUserAgent as parseUserAgent, network_searchHeaders as searchHeaders, network_searchStatusCodes as searchStatusCodes, network_statusCodeToText as statusCodeToText, network_typeNumberToLabel as typeNumberToLabel, network_validateDomain as validateDomain, network_validateHeaderName as validateHeaderName, network_validateHeaderValue as validateHeaderValue, network_validateRobotsTxt as validateRobotsTxt, network_validateSitemap as validateSitemap };
|
|
408
|
+
export { type network_CacheControlDirective as CacheControlDirective, type network_CacheControlOptions as CacheControlOptions, type network_CacheControlResult as CacheControlResult, 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_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, type network_ParsedDnsResult as ParsedDnsResult, type network_ParsedGeoResult as ParsedGeoResult, network_REFERRER_POLICY_VALUES as REFERRER_POLICY_VALUES, 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_SitemapIndexEntry as SitemapIndexEntry, type network_SitemapIssue as SitemapIssue, type network_SitemapUrlEntry as SitemapUrlEntry, type network_SitemapValidationResult as SitemapValidationResult, type network_StatusCode as StatusCode, type network_UaDeviceType as UaDeviceType, type network_UserAgentInfo as UserAgentInfo, network_buildCacheControl as buildCacheControl, network_buildDnsQueryUrl as buildDnsQueryUrl, network_buildGeoUrl as buildGeoUrl, network_buildMapUrl as buildMapUrl, network_buildReferrerPolicy as buildReferrerPolicy, 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_parseDnsResponse as parseDnsResponse, network_parseGeoResponse as parseGeoResponse, network_parseHar as parseHar, network_parseIpv6Address as parseIpv6Address, network_parseUserAgent as parseUserAgent, network_searchHeaders as searchHeaders, network_searchStatusCodes as searchStatusCodes, network_statusCodeToText as statusCodeToText, network_typeNumberToLabel as typeNumberToLabel, network_validateDomain as validateDomain, network_validateHeaderName as validateHeaderName, network_validateHeaderValue as validateHeaderValue, network_validateRobotsTxt as validateRobotsTxt, network_validateSitemap as validateSitemap };
|
|
377
409
|
}
|
|
378
410
|
|
|
379
|
-
export {
|
|
411
|
+
export { isValidIpv6 as $, buildCacheControl as A, buildDnsQueryUrl as B, type CacheControlDirective as C, DNS_RECORD_TYPES as D, buildGeoUrl as E, buildMapUrl as F, type GeoResult as G, HTTP_HEADERS as H, type Ipv6AddressType as I, buildReferrerPolicy as J, countryCodeToFlag as K, formatCoordinates as L, formatTtl as M, getByCategory as N, getHeader as O, type ParsedDnsResult as P, getHeadersByCategory as Q, REFERRER_POLICY_VALUES as R, STATUS_CODES as S, getStatusByCategory as T, type UaDeviceType as U, getStatusCode as V, isClientError as W, isServerError as X, isSuccess as Y, isValidIp as Z, isValidIpv4 as _, type CacheControlOptions as a, parseDnsResponse as a0, parseGeoResponse as a1, parseHar as a2, parseIpv6Address as a3, parseUserAgent as a4, searchHeaders as a5, searchStatusCodes as a6, statusCodeToText as a7, typeNumberToLabel as a8, validateDomain as a9, validateHeaderName as aa, validateHeaderValue as ab, validateRobotsTxt as ac, validateSitemap as ad, type CacheControlResult as b, type DnsRecord as c, type DnsRecordType as d, type DnsResponse as e, type HarEntry as f, type HarParseResult as g, type HarSummary as h, type HeaderCategory as i, type HttpHeader as j, type Ipv6ParseResult as k, type ParsedGeoResult as l, type ReferrerPolicyEntry as m, network as n, type ReferrerPolicyResult as o, type ReferrerPolicyValue as p, type RobotsGroup as q, type RobotsIssue as r, type RobotsRule as s, type RobotsValidationResult as t, type SitemapIndexEntry as u, type SitemapIssue as v, type SitemapUrlEntry as w, type SitemapValidationResult as x, type StatusCode as y, type UserAgentInfo as z };
|
|
@@ -23,6 +23,7 @@
|
|
|
23
23
|
* - readability-score: scoreReadability
|
|
24
24
|
* - filler-word-detector: detectFillerWords
|
|
25
25
|
* - sentence-length-distribution: analyzeSentenceLengths
|
|
26
|
+
* - emoji-lookup : searchEmoji, getEmojiByShortcode, getEmojiByChar, getEmojiByCategory, getEmojiCategories, EMOJI_TABLE
|
|
26
27
|
*/
|
|
27
28
|
interface WordCountResult {
|
|
28
29
|
words: number;
|
|
@@ -356,6 +357,30 @@ interface SentenceLengthDistribution {
|
|
|
356
357
|
* (e.g. "Dr.") as sentence boundaries.
|
|
357
358
|
*/
|
|
358
359
|
declare function analyzeSentenceLengths(text: string): SentenceLengthDistribution;
|
|
360
|
+
interface EmojiEntry {
|
|
361
|
+
emoji: string;
|
|
362
|
+
name: string;
|
|
363
|
+
shortcode: string;
|
|
364
|
+
codepoint: string;
|
|
365
|
+
category: string;
|
|
366
|
+
keywords: string[];
|
|
367
|
+
}
|
|
368
|
+
declare const EMOJI_TABLE: EmojiEntry[];
|
|
369
|
+
/**
|
|
370
|
+
* Search the curated emoji table by name, shortcode, or keyword (case
|
|
371
|
+
* insensitive substring match). Not the full Unicode emoji set (which is
|
|
372
|
+
* 3,000+ and growing every release), just several hundred of the most
|
|
373
|
+
* commonly used ones for chat, commit messages, and markdown.
|
|
374
|
+
*/
|
|
375
|
+
declare function searchEmoji(query: string): EmojiEntry[];
|
|
376
|
+
/** Exact shortcode lookup, with or without surrounding colons (e.g. `fire` or `:fire:`). */
|
|
377
|
+
declare function getEmojiByShortcode(shortcode: string): EmojiEntry | undefined;
|
|
378
|
+
/** Look up an emoji entry by its exact character, e.g. searching for 🔥. */
|
|
379
|
+
declare function getEmojiByChar(char: string): EmojiEntry | undefined;
|
|
380
|
+
/** List all emoji in a given category (e.g. 'Smileys & Emotion', 'Animals & Nature'). */
|
|
381
|
+
declare function getEmojiByCategory(category: string): EmojiEntry[];
|
|
382
|
+
/** All distinct category names present in the table, in table order. */
|
|
383
|
+
declare function getEmojiCategories(): string[];
|
|
359
384
|
|
|
360
385
|
type text_AsciiFont = AsciiFont;
|
|
361
386
|
type text_AsciiOptions = AsciiOptions;
|
|
@@ -369,7 +394,9 @@ type text_DiffLine = DiffLine;
|
|
|
369
394
|
type text_DiffResult = DiffResult;
|
|
370
395
|
type text_DiffType = DiffType;
|
|
371
396
|
type text_DiffViewerLine = DiffViewerLine;
|
|
397
|
+
declare const text_EMOJI_TABLE: typeof EMOJI_TABLE;
|
|
372
398
|
declare const text_ESCAPE_MODES: typeof ESCAPE_MODES;
|
|
399
|
+
type text_EmojiEntry = EmojiEntry;
|
|
373
400
|
type text_EscapeMode = EscapeMode;
|
|
374
401
|
type text_FillerCategory = FillerCategory;
|
|
375
402
|
type text_FillerMatch = FillerMatch;
|
|
@@ -426,6 +453,10 @@ declare const text_generateParagraphs: typeof generateParagraphs;
|
|
|
426
453
|
declare const text_generateSentences: typeof generateSentences;
|
|
427
454
|
declare const text_generateWords: typeof generateWords;
|
|
428
455
|
declare const text_getAvailableFonts: typeof getAvailableFonts;
|
|
456
|
+
declare const text_getEmojiByCategory: typeof getEmojiByCategory;
|
|
457
|
+
declare const text_getEmojiByChar: typeof getEmojiByChar;
|
|
458
|
+
declare const text_getEmojiByShortcode: typeof getEmojiByShortcode;
|
|
459
|
+
declare const text_getEmojiCategories: typeof getEmojiCategories;
|
|
429
460
|
declare const text_getMorseForChar: typeof getMorseForChar;
|
|
430
461
|
declare const text_getMorseTiming: typeof getMorseTiming;
|
|
431
462
|
declare const text_htmlToMarkdown: typeof htmlToMarkdown;
|
|
@@ -442,6 +473,7 @@ declare const text_readabilityScore: typeof readabilityScore;
|
|
|
442
473
|
declare const text_renderMarkdown: typeof renderMarkdown;
|
|
443
474
|
declare const text_romanToNumber: typeof romanToNumber;
|
|
444
475
|
declare const text_scoreReadability: typeof scoreReadability;
|
|
476
|
+
declare const text_searchEmoji: typeof searchEmoji;
|
|
445
477
|
declare const text_sentenceCount: typeof sentenceCount;
|
|
446
478
|
declare const text_slugify: typeof slugify;
|
|
447
479
|
declare const text_slugifyAll: typeof slugifyAll;
|
|
@@ -451,7 +483,7 @@ declare const text_textToMorse: typeof textToMorse;
|
|
|
451
483
|
declare const text_unescapeString: typeof unescapeString;
|
|
452
484
|
declare const text_wordFrequency: typeof wordFrequency;
|
|
453
485
|
declare namespace text {
|
|
454
|
-
export { type text_AsciiFont as AsciiFont, type text_AsciiOptions as AsciiOptions, text_CASE_FORMATS as CASE_FORMATS, type text_CaseFormat as CaseFormat, type text_ConvertOptions as ConvertOptions, text_DEFAULT_CONVERT_OPTIONS as DEFAULT_CONVERT_OPTIONS, type text_DiffFile as DiffFile, type text_DiffHunk as DiffHunk, type text_DiffLine as DiffLine, type text_DiffResult as DiffResult, type text_DiffType as DiffType, type text_DiffViewerLine as DiffViewerLine, text_ESCAPE_MODES as ESCAPE_MODES, type text_EscapeMode as EscapeMode, type text_FillerCategory as FillerCategory, type text_FillerMatch as FillerMatch, type text_FillerWordResult as FillerWordResult, text_LINE_OPS as LINE_OPS, type text_LineOp as LineOp, type text_LineType as LineType, type text_LoremUnit as LoremUnit, text_MORSE_CODE as MORSE_CODE, type text_MarkdownResult as MarkdownResult, type text_MorseOptions as MorseOptions, type text_ParsedDiff as ParsedDiff, type text_ParsedTable as ParsedTable, type text_PassiveVoiceMatch as PassiveVoiceMatch, type text_PassiveVoiceResult as PassiveVoiceResult, type text_PassiveVoiceSentence as PassiveVoiceSentence, type text_ReadabilityResult as ReadabilityResult, type text_ReadabilityScore as ReadabilityScore, type text_SentenceLengthBucket as SentenceLengthBucket, type text_SentenceLengthDistribution as SentenceLengthDistribution, type text_SlugSeparator as SlugSeparator, type text_StringDistanceMode as StringDistanceMode, type text_StringDistanceResult as StringDistanceResult, type text_TableOptions as TableOptions, type text_TextAnalysis as TextAnalysis, type text_WordCountResult as WordCountResult, text_addBorder as addBorder, text_analyzeSentenceLengths as analyzeSentenceLengths, text_analyzeText as analyzeText, text_applyOp as applyOp, text_applyOps as applyOps, text_calculateStringDistance as calculateStringDistance, text_centerText as centerText, text_convertAll as convertAll, text_convertCase as convertCase, text_countWords as countWords, text_csvToHtml as csvToHtml, text_csvToMarkdown as csvToMarkdown, text_detectDelimiter as detectDelimiter, text_detectFillerWords as detectFillerWords, text_detectPassiveVoice as detectPassiveVoice, text_diffLines as diffLines, text_diffLinesSimple as diffLinesSimple, text_diffStats as diffStats, text_escapeAll as escapeAll, text_escapeString as escapeString, text_extractHeadings as extractHeadings, text_formatReadingTime as formatReadingTime, text_generate as generate, text_generateDiff as generateDiff, text_generateHtmlTable as generateHtmlTable, text_generateMarkdownTable as generateMarkdownTable, text_generateParagraphs as generateParagraphs, text_generateSentences as generateSentences, text_generateWords as generateWords, text_getAvailableFonts as getAvailableFonts, text_getMorseForChar as getMorseForChar, text_getMorseTiming as getMorseTiming, text_htmlToMarkdown as htmlToMarkdown, text_isValidMorse as isValidMorse, text_markdownToHtml as markdownToHtml, text_morseToText as morseToText, text_numberToOrdinal as numberToOrdinal, text_numberToRoman as numberToRoman, text_numberToWords as numberToWords, text_ordinalWords as ordinalWords, text_parseDiff as parseDiff, text_parseTableData as parseTableData, text_readabilityScore as readabilityScore, text_renderMarkdown as renderMarkdown, text_romanToNumber as romanToNumber, text_scoreReadability as scoreReadability, text_sentenceCount as sentenceCount, text_slugify as slugify, text_slugifyAll as slugifyAll, text_syllableCount as syllableCount, text_textToAscii as textToAscii, text_textToMorse as textToMorse, text_unescapeString as unescapeString, text_wordFrequency as wordFrequency };
|
|
486
|
+
export { type text_AsciiFont as AsciiFont, type text_AsciiOptions as AsciiOptions, text_CASE_FORMATS as CASE_FORMATS, type text_CaseFormat as CaseFormat, type text_ConvertOptions as ConvertOptions, text_DEFAULT_CONVERT_OPTIONS as DEFAULT_CONVERT_OPTIONS, type text_DiffFile as DiffFile, type text_DiffHunk as DiffHunk, type text_DiffLine as DiffLine, type text_DiffResult as DiffResult, type text_DiffType as DiffType, type text_DiffViewerLine as DiffViewerLine, text_EMOJI_TABLE as EMOJI_TABLE, text_ESCAPE_MODES as ESCAPE_MODES, type text_EmojiEntry as EmojiEntry, type text_EscapeMode as EscapeMode, type text_FillerCategory as FillerCategory, type text_FillerMatch as FillerMatch, type text_FillerWordResult as FillerWordResult, text_LINE_OPS as LINE_OPS, type text_LineOp as LineOp, type text_LineType as LineType, type text_LoremUnit as LoremUnit, text_MORSE_CODE as MORSE_CODE, type text_MarkdownResult as MarkdownResult, type text_MorseOptions as MorseOptions, type text_ParsedDiff as ParsedDiff, type text_ParsedTable as ParsedTable, type text_PassiveVoiceMatch as PassiveVoiceMatch, type text_PassiveVoiceResult as PassiveVoiceResult, type text_PassiveVoiceSentence as PassiveVoiceSentence, type text_ReadabilityResult as ReadabilityResult, type text_ReadabilityScore as ReadabilityScore, type text_SentenceLengthBucket as SentenceLengthBucket, type text_SentenceLengthDistribution as SentenceLengthDistribution, type text_SlugSeparator as SlugSeparator, type text_StringDistanceMode as StringDistanceMode, type text_StringDistanceResult as StringDistanceResult, type text_TableOptions as TableOptions, type text_TextAnalysis as TextAnalysis, type text_WordCountResult as WordCountResult, text_addBorder as addBorder, text_analyzeSentenceLengths as analyzeSentenceLengths, text_analyzeText as analyzeText, text_applyOp as applyOp, text_applyOps as applyOps, text_calculateStringDistance as calculateStringDistance, text_centerText as centerText, text_convertAll as convertAll, text_convertCase as convertCase, text_countWords as countWords, text_csvToHtml as csvToHtml, text_csvToMarkdown as csvToMarkdown, text_detectDelimiter as detectDelimiter, text_detectFillerWords as detectFillerWords, text_detectPassiveVoice as detectPassiveVoice, text_diffLines as diffLines, text_diffLinesSimple as diffLinesSimple, text_diffStats as diffStats, text_escapeAll as escapeAll, text_escapeString as escapeString, text_extractHeadings as extractHeadings, text_formatReadingTime as formatReadingTime, text_generate as generate, text_generateDiff as generateDiff, text_generateHtmlTable as generateHtmlTable, text_generateMarkdownTable as generateMarkdownTable, text_generateParagraphs as generateParagraphs, text_generateSentences as generateSentences, text_generateWords as generateWords, text_getAvailableFonts as getAvailableFonts, text_getEmojiByCategory as getEmojiByCategory, text_getEmojiByChar as getEmojiByChar, text_getEmojiByShortcode as getEmojiByShortcode, text_getEmojiCategories as getEmojiCategories, text_getMorseForChar as getMorseForChar, text_getMorseTiming as getMorseTiming, text_htmlToMarkdown as htmlToMarkdown, text_isValidMorse as isValidMorse, text_markdownToHtml as markdownToHtml, text_morseToText as morseToText, text_numberToOrdinal as numberToOrdinal, text_numberToRoman as numberToRoman, text_numberToWords as numberToWords, text_ordinalWords as ordinalWords, text_parseDiff as parseDiff, text_parseTableData as parseTableData, text_readabilityScore as readabilityScore, text_renderMarkdown as renderMarkdown, text_romanToNumber as romanToNumber, text_scoreReadability as scoreReadability, text_searchEmoji as searchEmoji, text_sentenceCount as sentenceCount, text_slugify as slugify, text_slugifyAll as slugifyAll, text_syllableCount as syllableCount, text_textToAscii as textToAscii, text_textToMorse as textToMorse, text_unescapeString as unescapeString, text_wordFrequency as wordFrequency };
|
|
455
487
|
}
|
|
456
488
|
|
|
457
|
-
export {
|
|
489
|
+
export { csvToMarkdown as $, type AsciiFont as A, type SlugSeparator as B, CASE_FORMATS as C, DEFAULT_CONVERT_OPTIONS as D, EMOJI_TABLE as E, type FillerCategory as F, type StringDistanceMode as G, type StringDistanceResult as H, type TextAnalysis as I, addBorder as J, analyzeSentenceLengths as K, LINE_OPS as L, MORSE_CODE as M, analyzeText as N, applyOp as O, type ParsedDiff as P, applyOps as Q, type ReadabilityResult as R, type SentenceLengthBucket as S, type TableOptions as T, calculateStringDistance as U, centerText as V, type WordCountResult as W, convertAll as X, convertCase as Y, countWords as Z, csvToHtml as _, type AsciiOptions as a, detectDelimiter as a0, detectFillerWords as a1, detectPassiveVoice as a2, diffLines as a3, diffLinesSimple as a4, diffStats as a5, escapeAll as a6, escapeString as a7, extractHeadings as a8, formatReadingTime as a9, romanToNumber as aA, scoreReadability as aB, searchEmoji as aC, sentenceCount as aD, slugify as aE, slugifyAll as aF, syllableCount as aG, textToAscii as aH, textToMorse as aI, unescapeString as aJ, wordFrequency as aK, generate as aa, generateDiff as ab, generateHtmlTable as ac, generateMarkdownTable as ad, generateParagraphs as ae, generateSentences as af, generateWords as ag, getAvailableFonts as ah, getEmojiByCategory as ai, getEmojiByChar as aj, getEmojiByShortcode as ak, getEmojiCategories as al, getMorseForChar as am, getMorseTiming as an, htmlToMarkdown as ao, isValidMorse as ap, markdownToHtml as aq, morseToText as ar, numberToOrdinal as as, numberToRoman as at, numberToWords as au, ordinalWords as av, parseDiff as aw, parseTableData as ax, readabilityScore as ay, renderMarkdown as az, type CaseFormat as b, type ConvertOptions as c, type DiffFile as d, type DiffHunk as e, type DiffLine as f, type DiffResult as g, type DiffType as h, type DiffViewerLine as i, ESCAPE_MODES as j, type EmojiEntry as k, type EscapeMode as l, type FillerMatch as m, type FillerWordResult as n, type LineOp as o, type LineType as p, type LoremUnit as q, type MarkdownResult as r, type MorseOptions as s, text as t, type ParsedTable as u, type PassiveVoiceMatch as v, type PassiveVoiceResult as w, type PassiveVoiceSentence as x, type ReadabilityScore as y, type SentenceLengthDistribution as z };
|
|
@@ -23,6 +23,7 @@
|
|
|
23
23
|
* - readability-score: scoreReadability
|
|
24
24
|
* - filler-word-detector: detectFillerWords
|
|
25
25
|
* - sentence-length-distribution: analyzeSentenceLengths
|
|
26
|
+
* - emoji-lookup : searchEmoji, getEmojiByShortcode, getEmojiByChar, getEmojiByCategory, getEmojiCategories, EMOJI_TABLE
|
|
26
27
|
*/
|
|
27
28
|
interface WordCountResult {
|
|
28
29
|
words: number;
|
|
@@ -356,6 +357,30 @@ interface SentenceLengthDistribution {
|
|
|
356
357
|
* (e.g. "Dr.") as sentence boundaries.
|
|
357
358
|
*/
|
|
358
359
|
declare function analyzeSentenceLengths(text: string): SentenceLengthDistribution;
|
|
360
|
+
interface EmojiEntry {
|
|
361
|
+
emoji: string;
|
|
362
|
+
name: string;
|
|
363
|
+
shortcode: string;
|
|
364
|
+
codepoint: string;
|
|
365
|
+
category: string;
|
|
366
|
+
keywords: string[];
|
|
367
|
+
}
|
|
368
|
+
declare const EMOJI_TABLE: EmojiEntry[];
|
|
369
|
+
/**
|
|
370
|
+
* Search the curated emoji table by name, shortcode, or keyword (case
|
|
371
|
+
* insensitive substring match). Not the full Unicode emoji set (which is
|
|
372
|
+
* 3,000+ and growing every release), just several hundred of the most
|
|
373
|
+
* commonly used ones for chat, commit messages, and markdown.
|
|
374
|
+
*/
|
|
375
|
+
declare function searchEmoji(query: string): EmojiEntry[];
|
|
376
|
+
/** Exact shortcode lookup, with or without surrounding colons (e.g. `fire` or `:fire:`). */
|
|
377
|
+
declare function getEmojiByShortcode(shortcode: string): EmojiEntry | undefined;
|
|
378
|
+
/** Look up an emoji entry by its exact character, e.g. searching for 🔥. */
|
|
379
|
+
declare function getEmojiByChar(char: string): EmojiEntry | undefined;
|
|
380
|
+
/** List all emoji in a given category (e.g. 'Smileys & Emotion', 'Animals & Nature'). */
|
|
381
|
+
declare function getEmojiByCategory(category: string): EmojiEntry[];
|
|
382
|
+
/** All distinct category names present in the table, in table order. */
|
|
383
|
+
declare function getEmojiCategories(): string[];
|
|
359
384
|
|
|
360
385
|
type text_AsciiFont = AsciiFont;
|
|
361
386
|
type text_AsciiOptions = AsciiOptions;
|
|
@@ -369,7 +394,9 @@ type text_DiffLine = DiffLine;
|
|
|
369
394
|
type text_DiffResult = DiffResult;
|
|
370
395
|
type text_DiffType = DiffType;
|
|
371
396
|
type text_DiffViewerLine = DiffViewerLine;
|
|
397
|
+
declare const text_EMOJI_TABLE: typeof EMOJI_TABLE;
|
|
372
398
|
declare const text_ESCAPE_MODES: typeof ESCAPE_MODES;
|
|
399
|
+
type text_EmojiEntry = EmojiEntry;
|
|
373
400
|
type text_EscapeMode = EscapeMode;
|
|
374
401
|
type text_FillerCategory = FillerCategory;
|
|
375
402
|
type text_FillerMatch = FillerMatch;
|
|
@@ -426,6 +453,10 @@ declare const text_generateParagraphs: typeof generateParagraphs;
|
|
|
426
453
|
declare const text_generateSentences: typeof generateSentences;
|
|
427
454
|
declare const text_generateWords: typeof generateWords;
|
|
428
455
|
declare const text_getAvailableFonts: typeof getAvailableFonts;
|
|
456
|
+
declare const text_getEmojiByCategory: typeof getEmojiByCategory;
|
|
457
|
+
declare const text_getEmojiByChar: typeof getEmojiByChar;
|
|
458
|
+
declare const text_getEmojiByShortcode: typeof getEmojiByShortcode;
|
|
459
|
+
declare const text_getEmojiCategories: typeof getEmojiCategories;
|
|
429
460
|
declare const text_getMorseForChar: typeof getMorseForChar;
|
|
430
461
|
declare const text_getMorseTiming: typeof getMorseTiming;
|
|
431
462
|
declare const text_htmlToMarkdown: typeof htmlToMarkdown;
|
|
@@ -442,6 +473,7 @@ declare const text_readabilityScore: typeof readabilityScore;
|
|
|
442
473
|
declare const text_renderMarkdown: typeof renderMarkdown;
|
|
443
474
|
declare const text_romanToNumber: typeof romanToNumber;
|
|
444
475
|
declare const text_scoreReadability: typeof scoreReadability;
|
|
476
|
+
declare const text_searchEmoji: typeof searchEmoji;
|
|
445
477
|
declare const text_sentenceCount: typeof sentenceCount;
|
|
446
478
|
declare const text_slugify: typeof slugify;
|
|
447
479
|
declare const text_slugifyAll: typeof slugifyAll;
|
|
@@ -451,7 +483,7 @@ declare const text_textToMorse: typeof textToMorse;
|
|
|
451
483
|
declare const text_unescapeString: typeof unescapeString;
|
|
452
484
|
declare const text_wordFrequency: typeof wordFrequency;
|
|
453
485
|
declare namespace text {
|
|
454
|
-
export { type text_AsciiFont as AsciiFont, type text_AsciiOptions as AsciiOptions, text_CASE_FORMATS as CASE_FORMATS, type text_CaseFormat as CaseFormat, type text_ConvertOptions as ConvertOptions, text_DEFAULT_CONVERT_OPTIONS as DEFAULT_CONVERT_OPTIONS, type text_DiffFile as DiffFile, type text_DiffHunk as DiffHunk, type text_DiffLine as DiffLine, type text_DiffResult as DiffResult, type text_DiffType as DiffType, type text_DiffViewerLine as DiffViewerLine, text_ESCAPE_MODES as ESCAPE_MODES, type text_EscapeMode as EscapeMode, type text_FillerCategory as FillerCategory, type text_FillerMatch as FillerMatch, type text_FillerWordResult as FillerWordResult, text_LINE_OPS as LINE_OPS, type text_LineOp as LineOp, type text_LineType as LineType, type text_LoremUnit as LoremUnit, text_MORSE_CODE as MORSE_CODE, type text_MarkdownResult as MarkdownResult, type text_MorseOptions as MorseOptions, type text_ParsedDiff as ParsedDiff, type text_ParsedTable as ParsedTable, type text_PassiveVoiceMatch as PassiveVoiceMatch, type text_PassiveVoiceResult as PassiveVoiceResult, type text_PassiveVoiceSentence as PassiveVoiceSentence, type text_ReadabilityResult as ReadabilityResult, type text_ReadabilityScore as ReadabilityScore, type text_SentenceLengthBucket as SentenceLengthBucket, type text_SentenceLengthDistribution as SentenceLengthDistribution, type text_SlugSeparator as SlugSeparator, type text_StringDistanceMode as StringDistanceMode, type text_StringDistanceResult as StringDistanceResult, type text_TableOptions as TableOptions, type text_TextAnalysis as TextAnalysis, type text_WordCountResult as WordCountResult, text_addBorder as addBorder, text_analyzeSentenceLengths as analyzeSentenceLengths, text_analyzeText as analyzeText, text_applyOp as applyOp, text_applyOps as applyOps, text_calculateStringDistance as calculateStringDistance, text_centerText as centerText, text_convertAll as convertAll, text_convertCase as convertCase, text_countWords as countWords, text_csvToHtml as csvToHtml, text_csvToMarkdown as csvToMarkdown, text_detectDelimiter as detectDelimiter, text_detectFillerWords as detectFillerWords, text_detectPassiveVoice as detectPassiveVoice, text_diffLines as diffLines, text_diffLinesSimple as diffLinesSimple, text_diffStats as diffStats, text_escapeAll as escapeAll, text_escapeString as escapeString, text_extractHeadings as extractHeadings, text_formatReadingTime as formatReadingTime, text_generate as generate, text_generateDiff as generateDiff, text_generateHtmlTable as generateHtmlTable, text_generateMarkdownTable as generateMarkdownTable, text_generateParagraphs as generateParagraphs, text_generateSentences as generateSentences, text_generateWords as generateWords, text_getAvailableFonts as getAvailableFonts, text_getMorseForChar as getMorseForChar, text_getMorseTiming as getMorseTiming, text_htmlToMarkdown as htmlToMarkdown, text_isValidMorse as isValidMorse, text_markdownToHtml as markdownToHtml, text_morseToText as morseToText, text_numberToOrdinal as numberToOrdinal, text_numberToRoman as numberToRoman, text_numberToWords as numberToWords, text_ordinalWords as ordinalWords, text_parseDiff as parseDiff, text_parseTableData as parseTableData, text_readabilityScore as readabilityScore, text_renderMarkdown as renderMarkdown, text_romanToNumber as romanToNumber, text_scoreReadability as scoreReadability, text_sentenceCount as sentenceCount, text_slugify as slugify, text_slugifyAll as slugifyAll, text_syllableCount as syllableCount, text_textToAscii as textToAscii, text_textToMorse as textToMorse, text_unescapeString as unescapeString, text_wordFrequency as wordFrequency };
|
|
486
|
+
export { type text_AsciiFont as AsciiFont, type text_AsciiOptions as AsciiOptions, text_CASE_FORMATS as CASE_FORMATS, type text_CaseFormat as CaseFormat, type text_ConvertOptions as ConvertOptions, text_DEFAULT_CONVERT_OPTIONS as DEFAULT_CONVERT_OPTIONS, type text_DiffFile as DiffFile, type text_DiffHunk as DiffHunk, type text_DiffLine as DiffLine, type text_DiffResult as DiffResult, type text_DiffType as DiffType, type text_DiffViewerLine as DiffViewerLine, text_EMOJI_TABLE as EMOJI_TABLE, text_ESCAPE_MODES as ESCAPE_MODES, type text_EmojiEntry as EmojiEntry, type text_EscapeMode as EscapeMode, type text_FillerCategory as FillerCategory, type text_FillerMatch as FillerMatch, type text_FillerWordResult as FillerWordResult, text_LINE_OPS as LINE_OPS, type text_LineOp as LineOp, type text_LineType as LineType, type text_LoremUnit as LoremUnit, text_MORSE_CODE as MORSE_CODE, type text_MarkdownResult as MarkdownResult, type text_MorseOptions as MorseOptions, type text_ParsedDiff as ParsedDiff, type text_ParsedTable as ParsedTable, type text_PassiveVoiceMatch as PassiveVoiceMatch, type text_PassiveVoiceResult as PassiveVoiceResult, type text_PassiveVoiceSentence as PassiveVoiceSentence, type text_ReadabilityResult as ReadabilityResult, type text_ReadabilityScore as ReadabilityScore, type text_SentenceLengthBucket as SentenceLengthBucket, type text_SentenceLengthDistribution as SentenceLengthDistribution, type text_SlugSeparator as SlugSeparator, type text_StringDistanceMode as StringDistanceMode, type text_StringDistanceResult as StringDistanceResult, type text_TableOptions as TableOptions, type text_TextAnalysis as TextAnalysis, type text_WordCountResult as WordCountResult, text_addBorder as addBorder, text_analyzeSentenceLengths as analyzeSentenceLengths, text_analyzeText as analyzeText, text_applyOp as applyOp, text_applyOps as applyOps, text_calculateStringDistance as calculateStringDistance, text_centerText as centerText, text_convertAll as convertAll, text_convertCase as convertCase, text_countWords as countWords, text_csvToHtml as csvToHtml, text_csvToMarkdown as csvToMarkdown, text_detectDelimiter as detectDelimiter, text_detectFillerWords as detectFillerWords, text_detectPassiveVoice as detectPassiveVoice, text_diffLines as diffLines, text_diffLinesSimple as diffLinesSimple, text_diffStats as diffStats, text_escapeAll as escapeAll, text_escapeString as escapeString, text_extractHeadings as extractHeadings, text_formatReadingTime as formatReadingTime, text_generate as generate, text_generateDiff as generateDiff, text_generateHtmlTable as generateHtmlTable, text_generateMarkdownTable as generateMarkdownTable, text_generateParagraphs as generateParagraphs, text_generateSentences as generateSentences, text_generateWords as generateWords, text_getAvailableFonts as getAvailableFonts, text_getEmojiByCategory as getEmojiByCategory, text_getEmojiByChar as getEmojiByChar, text_getEmojiByShortcode as getEmojiByShortcode, text_getEmojiCategories as getEmojiCategories, text_getMorseForChar as getMorseForChar, text_getMorseTiming as getMorseTiming, text_htmlToMarkdown as htmlToMarkdown, text_isValidMorse as isValidMorse, text_markdownToHtml as markdownToHtml, text_morseToText as morseToText, text_numberToOrdinal as numberToOrdinal, text_numberToRoman as numberToRoman, text_numberToWords as numberToWords, text_ordinalWords as ordinalWords, text_parseDiff as parseDiff, text_parseTableData as parseTableData, text_readabilityScore as readabilityScore, text_renderMarkdown as renderMarkdown, text_romanToNumber as romanToNumber, text_scoreReadability as scoreReadability, text_searchEmoji as searchEmoji, text_sentenceCount as sentenceCount, text_slugify as slugify, text_slugifyAll as slugifyAll, text_syllableCount as syllableCount, text_textToAscii as textToAscii, text_textToMorse as textToMorse, text_unescapeString as unescapeString, text_wordFrequency as wordFrequency };
|
|
455
487
|
}
|
|
456
488
|
|
|
457
|
-
export {
|
|
489
|
+
export { csvToMarkdown as $, type AsciiFont as A, type SlugSeparator as B, CASE_FORMATS as C, DEFAULT_CONVERT_OPTIONS as D, EMOJI_TABLE as E, type FillerCategory as F, type StringDistanceMode as G, type StringDistanceResult as H, type TextAnalysis as I, addBorder as J, analyzeSentenceLengths as K, LINE_OPS as L, MORSE_CODE as M, analyzeText as N, applyOp as O, type ParsedDiff as P, applyOps as Q, type ReadabilityResult as R, type SentenceLengthBucket as S, type TableOptions as T, calculateStringDistance as U, centerText as V, type WordCountResult as W, convertAll as X, convertCase as Y, countWords as Z, csvToHtml as _, type AsciiOptions as a, detectDelimiter as a0, detectFillerWords as a1, detectPassiveVoice as a2, diffLines as a3, diffLinesSimple as a4, diffStats as a5, escapeAll as a6, escapeString as a7, extractHeadings as a8, formatReadingTime as a9, romanToNumber as aA, scoreReadability as aB, searchEmoji as aC, sentenceCount as aD, slugify as aE, slugifyAll as aF, syllableCount as aG, textToAscii as aH, textToMorse as aI, unescapeString as aJ, wordFrequency as aK, generate as aa, generateDiff as ab, generateHtmlTable as ac, generateMarkdownTable as ad, generateParagraphs as ae, generateSentences as af, generateWords as ag, getAvailableFonts as ah, getEmojiByCategory as ai, getEmojiByChar as aj, getEmojiByShortcode as ak, getEmojiCategories as al, getMorseForChar as am, getMorseTiming as an, htmlToMarkdown as ao, isValidMorse as ap, markdownToHtml as aq, morseToText as ar, numberToOrdinal as as, numberToRoman as at, numberToWords as au, ordinalWords as av, parseDiff as aw, parseTableData as ax, readabilityScore as ay, renderMarkdown as az, type CaseFormat as b, type ConvertOptions as c, type DiffFile as d, type DiffHunk as e, type DiffLine as f, type DiffResult as g, type DiffType as h, type DiffViewerLine as i, ESCAPE_MODES as j, type EmojiEntry as k, type EscapeMode as l, type FillerMatch as m, type FillerWordResult as n, type LineOp as o, type LineType as p, type LoremUnit as q, type MarkdownResult as r, type MorseOptions as s, text as t, type ParsedTable as u, type PassiveVoiceMatch as v, type PassiveVoiceResult as w, type PassiveVoiceSentence as x, type ReadabilityScore as y, type SentenceLengthDistribution as z };
|
package/dist/tools/data.cjs
CHANGED
|
@@ -1373,6 +1373,67 @@ function parseFrontMatter(input) {
|
|
|
1373
1373
|
}
|
|
1374
1374
|
return { frontMatter, body: afterClose, hasFrontMatter: true, raw };
|
|
1375
1375
|
}
|
|
1376
|
+
function stripInlineMarkdown(text) {
|
|
1377
|
+
return text.replace(/(\*\*\*|___)(.+?)\1/g, "$2").replace(/(\*\*|__)(.+?)\1/g, "$2").replace(/(\*|_)(.+?)\1/g, "$2").replace(/`([^`]+)`/g, "$1").replace(/!\[([^\]]*)\]\([^)]*\)/g, "$1").replace(/\[([^\]]+)\]\([^)]*\)/g, "$1").trim();
|
|
1378
|
+
}
|
|
1379
|
+
function slugifyHeading(text, seen) {
|
|
1380
|
+
let slug = text.toLowerCase().trim().replace(/[^\p{L}\p{N}\s_-]/gu, "").replace(/\s/g, "-");
|
|
1381
|
+
const count = seen.get(slug) ?? 0;
|
|
1382
|
+
seen.set(slug, count + 1);
|
|
1383
|
+
if (count > 0) slug = `${slug}-${count}`;
|
|
1384
|
+
return slug;
|
|
1385
|
+
}
|
|
1386
|
+
function generateMarkdownToc(markdown, options = {}) {
|
|
1387
|
+
if (typeof markdown !== "string" || markdown.trim() === "") {
|
|
1388
|
+
return { error: "markdown is required" };
|
|
1389
|
+
}
|
|
1390
|
+
const minLevel = options.minLevel ?? 1;
|
|
1391
|
+
const maxLevel = options.maxLevel ?? 6;
|
|
1392
|
+
if (!Number.isInteger(minLevel) || !Number.isInteger(maxLevel) || minLevel < 1 || minLevel > 6 || maxLevel < 1 || maxLevel > 6 || minLevel > maxLevel) {
|
|
1393
|
+
return { error: "minLevel and maxLevel must be integers between 1 and 6, with minLevel <= maxLevel" };
|
|
1394
|
+
}
|
|
1395
|
+
const lines = markdown.replace(/\r\n/g, "\n").split("\n");
|
|
1396
|
+
const entries = [];
|
|
1397
|
+
const seen = /* @__PURE__ */ new Map();
|
|
1398
|
+
let inFence = false;
|
|
1399
|
+
let fenceMarker = "";
|
|
1400
|
+
for (const line of lines) {
|
|
1401
|
+
const fenceMatch = line.match(/^\s*(```+|~~~+)/);
|
|
1402
|
+
if (fenceMatch) {
|
|
1403
|
+
if (!inFence) {
|
|
1404
|
+
inFence = true;
|
|
1405
|
+
fenceMarker = fenceMatch[1][0];
|
|
1406
|
+
} else if (fenceMatch[1][0] === fenceMarker) {
|
|
1407
|
+
inFence = false;
|
|
1408
|
+
}
|
|
1409
|
+
continue;
|
|
1410
|
+
}
|
|
1411
|
+
if (inFence) continue;
|
|
1412
|
+
const headingMatch = line.match(/^(#{1,6})\s+(.+?)\s*#*\s*$/);
|
|
1413
|
+
if (!headingMatch) continue;
|
|
1414
|
+
const level = headingMatch[1].length;
|
|
1415
|
+
const text = stripInlineMarkdown(headingMatch[2]);
|
|
1416
|
+
if (text === "") continue;
|
|
1417
|
+
const slug = slugifyHeading(text, seen);
|
|
1418
|
+
if (level < minLevel || level > maxLevel) continue;
|
|
1419
|
+
entries.push({ level, text, slug });
|
|
1420
|
+
}
|
|
1421
|
+
if (entries.length === 0) {
|
|
1422
|
+
return { error: "No headings found in the given level range" };
|
|
1423
|
+
}
|
|
1424
|
+
const baseLevel = Math.min(...entries.map((e) => e.level));
|
|
1425
|
+
const counters = [0, 0, 0, 0, 0, 0, 0];
|
|
1426
|
+
const tocLines = entries.map((e) => {
|
|
1427
|
+
const indent = " ".repeat(e.level - baseLevel);
|
|
1428
|
+
if (options.ordered) {
|
|
1429
|
+
counters[e.level] = (counters[e.level] ?? 0) + 1;
|
|
1430
|
+
for (let l = e.level + 1; l < counters.length; l++) counters[l] = 0;
|
|
1431
|
+
return `${indent}${counters[e.level]}. [${e.text}](#${e.slug})`;
|
|
1432
|
+
}
|
|
1433
|
+
return `${indent}- [${e.text}](#${e.slug})`;
|
|
1434
|
+
});
|
|
1435
|
+
return { toc: tocLines.join("\n"), entries };
|
|
1436
|
+
}
|
|
1376
1437
|
|
|
1377
1438
|
exports.convertSubtitles = convertSubtitles;
|
|
1378
1439
|
exports.csvToJson = csvToJson;
|
|
@@ -1385,6 +1446,7 @@ exports.formatNdjson = formatNdjson;
|
|
|
1385
1446
|
exports.formatSubtitleTimestamp = formatSubtitleTimestamp;
|
|
1386
1447
|
exports.formatToml = formatToml;
|
|
1387
1448
|
exports.formatXml = formatXml;
|
|
1449
|
+
exports.generateMarkdownToc = generateMarkdownToc;
|
|
1388
1450
|
exports.getSection = getSection;
|
|
1389
1451
|
exports.getSectionNames = getSectionNames;
|
|
1390
1452
|
exports.getTomlStats = getTomlStats;
|
package/dist/tools/data.d.cts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { C as ConvertedSubtitles, a as CsvParseResult, E as EnvDiffError, b as EnvDiffResult, c as EnvEntry, e as EnvParseResult, F as FrontMatterError, f as FrontMatterResult, I as IniSection, N as NdjsonLineResult,
|
|
1
|
+
export { C as ConvertedSubtitles, a as CsvParseResult, E as EnvDiffError, b as EnvDiffResult, c as EnvEntry, e as EnvParseResult, F as FrontMatterError, f as FrontMatterResult, I as IniSection, M as MarkdownTocEntry, g as MarkdownTocOptions, h as MarkdownTocResult, N as NdjsonLineResult, i as NdjsonValidateResult, P as ParseOptions, j as ParsedIni, k as ParsedSubtitles, S as SubtitleCue, l as SubtitleFormat, T as TomlFormatResult, V as ValidationResult, X as XmlFormatResult, m as XmlToJsonOptions, n as convertSubtitles, o as csvToJson, p as detectDelimiter, q as detectSubtitleFormat, r as diffEnvExample, s as envToExport, t as envToJson, u as formatNdjson, v as formatSubtitleTimestamp, w as formatToml, x as formatXml, y as generateMarkdownToc, z as getSection, A as getSectionNames, B as getTomlStats, D as getXmlStats, G as getYamlStats, H as iniToJson, J as jsonArrayToNdjson, K as jsonToIni, L as jsonToToml, O as jsonToXml, Q as minifyNdjson, R as minifyToml, U as minifyXml, W as ndjsonToJsonArray, Y as parseCsv, Z as parseEnv, _ as parseFrontMatter, $ as parseIni, a0 as parseSubtitleTimestamp, a1 as parseSubtitles, a2 as parseXmlToObject, a3 as serializeSubtitles, a4 as shiftSubtitles, a5 as stringifyIni, a6 as toCsvString, a7 as tomlToJson, a8 as validateEnvKey, a9 as validateIni, aa as validateNdjson, ab as validateToml, ac as validateXml, ad as validateYaml, ae as xmlToJson } from '../data-CFeS9kes.cjs';
|
package/dist/tools/data.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { C as ConvertedSubtitles, a as CsvParseResult, E as EnvDiffError, b as EnvDiffResult, c as EnvEntry, e as EnvParseResult, F as FrontMatterError, f as FrontMatterResult, I as IniSection, N as NdjsonLineResult,
|
|
1
|
+
export { C as ConvertedSubtitles, a as CsvParseResult, E as EnvDiffError, b as EnvDiffResult, c as EnvEntry, e as EnvParseResult, F as FrontMatterError, f as FrontMatterResult, I as IniSection, M as MarkdownTocEntry, g as MarkdownTocOptions, h as MarkdownTocResult, N as NdjsonLineResult, i as NdjsonValidateResult, P as ParseOptions, j as ParsedIni, k as ParsedSubtitles, S as SubtitleCue, l as SubtitleFormat, T as TomlFormatResult, V as ValidationResult, X as XmlFormatResult, m as XmlToJsonOptions, n as convertSubtitles, o as csvToJson, p as detectDelimiter, q as detectSubtitleFormat, r as diffEnvExample, s as envToExport, t as envToJson, u as formatNdjson, v as formatSubtitleTimestamp, w as formatToml, x as formatXml, y as generateMarkdownToc, z as getSection, A as getSectionNames, B as getTomlStats, D as getXmlStats, G as getYamlStats, H as iniToJson, J as jsonArrayToNdjson, K as jsonToIni, L as jsonToToml, O as jsonToXml, Q as minifyNdjson, R as minifyToml, U as minifyXml, W as ndjsonToJsonArray, Y as parseCsv, Z as parseEnv, _ as parseFrontMatter, $ as parseIni, a0 as parseSubtitleTimestamp, a1 as parseSubtitles, a2 as parseXmlToObject, a3 as serializeSubtitles, a4 as shiftSubtitles, a5 as stringifyIni, a6 as toCsvString, a7 as tomlToJson, a8 as validateEnvKey, a9 as validateIni, aa as validateNdjson, ab as validateToml, ac as validateXml, ad as validateYaml, ae as xmlToJson } from '../data-CFeS9kes.js';
|
package/dist/tools/data.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { convertSubtitles, csvToJson, detectDelimiter, detectSubtitleFormat, diffEnvExample, envToExport, envToJson, formatNdjson, formatSubtitleTimestamp, formatToml, formatXml, getSection, getSectionNames, getTomlStats, getXmlStats, getYamlStats, iniToJson, jsonArrayToNdjson, jsonToIni, jsonToToml, jsonToXml, minifyNdjson, minifyToml, minifyXml, ndjsonToJsonArray, parseCsv, parseEnv, parseFrontMatter, parseIni, parseSubtitleTimestamp, parseSubtitles, parseXmlToObject, serializeSubtitles, shiftSubtitles, stringifyIni, toCsvString, tomlToJson, validateEnvKey, validateIni, validateNdjson, validateToml, validateXml, validateYaml, xmlToJson } from '../chunk-
|
|
1
|
+
export { convertSubtitles, csvToJson, detectDelimiter, detectSubtitleFormat, diffEnvExample, envToExport, envToJson, 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, serializeSubtitles, shiftSubtitles, stringifyIni, toCsvString, tomlToJson, validateEnvKey, validateIni, validateNdjson, validateToml, validateXml, validateYaml, xmlToJson } from '../chunk-YEXQDI3J.js';
|
|
2
2
|
import '../chunk-MLKGABMK.js';
|
package/dist/tools/network.cjs
CHANGED
|
@@ -1777,6 +1777,84 @@ function buildCacheControl(options = {}) {
|
|
|
1777
1777
|
const snippet = `Cache-Control: ${header}`;
|
|
1778
1778
|
return { header, headerName: "Cache-Control", snippet, directives, warnings };
|
|
1779
1779
|
}
|
|
1780
|
+
var REFERRER_POLICY_VALUES = [
|
|
1781
|
+
"no-referrer",
|
|
1782
|
+
"no-referrer-when-downgrade",
|
|
1783
|
+
"origin",
|
|
1784
|
+
"origin-when-cross-origin",
|
|
1785
|
+
"same-origin",
|
|
1786
|
+
"strict-origin",
|
|
1787
|
+
"strict-origin-when-cross-origin",
|
|
1788
|
+
"unsafe-url"
|
|
1789
|
+
];
|
|
1790
|
+
var _REFERRER_POLICY_INFO = {
|
|
1791
|
+
"no-referrer": {
|
|
1792
|
+
explanation: "Never sends the Referer header, on any request. The strictest option; the destination learns nothing about where the request came from.",
|
|
1793
|
+
leaksPathAndQuery: false,
|
|
1794
|
+
sentOnDowngrade: false
|
|
1795
|
+
},
|
|
1796
|
+
"no-referrer-when-downgrade": {
|
|
1797
|
+
explanation: "Sends the full URL (origin, path, and query string) for same-security-level or upgrading requests, but omits the header entirely when navigating from HTTPS to HTTP. This was the legacy browser default before strict-origin-when-cross-origin.",
|
|
1798
|
+
leaksPathAndQuery: true,
|
|
1799
|
+
sentOnDowngrade: false
|
|
1800
|
+
},
|
|
1801
|
+
origin: {
|
|
1802
|
+
explanation: "Sends only the origin (scheme, host, and port) on every request, same-origin or cross-origin, including on a downgrade. The path and query string are always stripped.",
|
|
1803
|
+
leaksPathAndQuery: false,
|
|
1804
|
+
sentOnDowngrade: true
|
|
1805
|
+
},
|
|
1806
|
+
"origin-when-cross-origin": {
|
|
1807
|
+
explanation: "Sends the full URL for same-origin requests, but only the origin for cross-origin requests. Still sends the origin on a downgrade.",
|
|
1808
|
+
leaksPathAndQuery: true,
|
|
1809
|
+
sentOnDowngrade: true
|
|
1810
|
+
},
|
|
1811
|
+
"same-origin": {
|
|
1812
|
+
explanation: "Sends the full URL for same-origin requests, and no Referer header at all for cross-origin requests.",
|
|
1813
|
+
leaksPathAndQuery: true,
|
|
1814
|
+
sentOnDowngrade: false
|
|
1815
|
+
},
|
|
1816
|
+
"strict-origin": {
|
|
1817
|
+
explanation: "Sends only the origin, and only when the security level stays the same or improves (HTTPS to HTTPS, or HTTP to anything). Nothing is sent on a downgrade from HTTPS to HTTP.",
|
|
1818
|
+
leaksPathAndQuery: false,
|
|
1819
|
+
sentOnDowngrade: false
|
|
1820
|
+
},
|
|
1821
|
+
"strict-origin-when-cross-origin": {
|
|
1822
|
+
explanation: "Sends the full URL for same-origin requests, only the origin for cross-origin requests at the same or better security level, and nothing at all on a downgrade. This is the current browser default when no policy is set.",
|
|
1823
|
+
leaksPathAndQuery: true,
|
|
1824
|
+
sentOnDowngrade: false
|
|
1825
|
+
},
|
|
1826
|
+
"unsafe-url": {
|
|
1827
|
+
explanation: "Always sends the full URL, including path and query string, on every request, even on a downgrade from HTTPS to HTTP. Generally discouraged: query strings can carry session tokens or other sensitive data that then leaks to third-party destinations and to the network on an insecure connection.",
|
|
1828
|
+
leaksPathAndQuery: true,
|
|
1829
|
+
sentOnDowngrade: true
|
|
1830
|
+
}
|
|
1831
|
+
};
|
|
1832
|
+
function buildReferrerPolicy(policies) {
|
|
1833
|
+
const list = Array.isArray(policies) ? policies : [policies];
|
|
1834
|
+
const trimmed = list.map((p) => typeof p === "string" ? p.trim() : "").filter((p) => p !== "");
|
|
1835
|
+
if (trimmed.length === 0) {
|
|
1836
|
+
return { error: "At least one policy value is required" };
|
|
1837
|
+
}
|
|
1838
|
+
const entries = [];
|
|
1839
|
+
for (const value of trimmed) {
|
|
1840
|
+
if (!REFERRER_POLICY_VALUES.includes(value)) {
|
|
1841
|
+
return { error: `'${value}' is not a valid Referrer-Policy value. Valid values: ${REFERRER_POLICY_VALUES.join(", ")}` };
|
|
1842
|
+
}
|
|
1843
|
+
entries.push({ value, ..._REFERRER_POLICY_INFO[value] });
|
|
1844
|
+
}
|
|
1845
|
+
const warnings = [];
|
|
1846
|
+
const last = entries[entries.length - 1];
|
|
1847
|
+
if (last.value === "unsafe-url") {
|
|
1848
|
+
warnings.push("unsafe-url sends the full URL, including query strings, on every request, even over an insecure downgrade. Prefer strict-origin-when-cross-origin unless you have a specific reason to leak full URLs.");
|
|
1849
|
+
}
|
|
1850
|
+
if (entries.length > 1 && entries.some((e, i) => i !== entries.length - 1 && e.value === last.value)) {
|
|
1851
|
+
warnings.push("The same policy value appears more than once in the fallback chain, which has no effect beyond the first occurrence.");
|
|
1852
|
+
}
|
|
1853
|
+
const header = entries.map((e) => e.value).join(", ");
|
|
1854
|
+
const snippet = `Referrer-Policy: ${header}`;
|
|
1855
|
+
const metaTag = `<meta name="referrer" content="${last.value}">`;
|
|
1856
|
+
return { header, headerName: "Referrer-Policy", snippet, metaTag, policies: entries, warnings };
|
|
1857
|
+
}
|
|
1780
1858
|
function isValidIpv6HexGroup(g) {
|
|
1781
1859
|
return /^[0-9a-fA-F]{1,4}$/.test(g);
|
|
1782
1860
|
}
|
|
@@ -1868,11 +1946,13 @@ function parseIpv6Address(input) {
|
|
|
1868
1946
|
|
|
1869
1947
|
exports.DNS_RECORD_TYPES = DNS_RECORD_TYPES;
|
|
1870
1948
|
exports.HTTP_HEADERS = HTTP_HEADERS;
|
|
1949
|
+
exports.REFERRER_POLICY_VALUES = REFERRER_POLICY_VALUES;
|
|
1871
1950
|
exports.STATUS_CODES = STATUS_CODES;
|
|
1872
1951
|
exports.buildCacheControl = buildCacheControl;
|
|
1873
1952
|
exports.buildDnsQueryUrl = buildDnsQueryUrl;
|
|
1874
1953
|
exports.buildGeoUrl = buildGeoUrl;
|
|
1875
1954
|
exports.buildMapUrl = buildMapUrl;
|
|
1955
|
+
exports.buildReferrerPolicy = buildReferrerPolicy;
|
|
1876
1956
|
exports.countryCodeToFlag = countryCodeToFlag;
|
|
1877
1957
|
exports.formatCoordinates = formatCoordinates;
|
|
1878
1958
|
exports.formatTtl = formatTtl;
|