@utilix-tech/sdk 0.18.0 → 0.20.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 +7 -0
- package/README.md +18 -4
- package/dist/{chunk-F57WMKZO.js → chunk-2I4O5YCT.js} +100 -1
- package/dist/{chunk-L53LAVAD.js → chunk-LXKIPPDG.js} +266 -1
- package/dist/{chunk-3QMUUTBH.js → chunk-Y5OOP6WN.js} +94 -1
- package/dist/{code-Cn9uOIAh.d.ts → code-DaRvff2v.d.cts} +33 -2
- package/dist/{code-Cn9uOIAh.d.cts → code-DaRvff2v.d.ts} +33 -2
- package/dist/index.cjs +457 -0
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +3 -3
- package/dist/{network-DZugNyAQ.d.cts → network-BJOjJnmY.d.cts} +45 -2
- package/dist/{network-DZugNyAQ.d.ts → network-BJOjJnmY.d.ts} +45 -2
- package/dist/{text-Bbx-tZ43.d.cts → text-DS70aMY5.d.cts} +33 -2
- package/dist/{text-Bbx-tZ43.d.ts → text-DS70aMY5.d.ts} +33 -2
- package/dist/tools/code.cjs +265 -0
- package/dist/tools/code.d.cts +1 -1
- package/dist/tools/code.d.ts +1 -1
- package/dist/tools/code.js +1 -1
- package/dist/tools/network.cjs +93 -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 +99 -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/package.json +1 -1
package/dist/tools/code.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { A as ALL_FLAGS, a as ApiEndpoint, b as ApiInfo, C as CHEATSHEET, d as CheatsheetEntry, e as CssResult, D as DockerImageRef, E as EnvEntry, f as EnvParseResult, G as GitCommandConfig, g as GitCommandResult, h as GitOperation, i as GithubUrlInfo, j as GithubUrlType, k as GqlFormatResult, H as HtmlFormatResult, l as HtmlMinifyOptions, m as HtmlMinifyResult, J as JsMinifyOptions, n as JsMinifyResult, M as MIME_TABLE, o as MatchResult, p as MimeEntry, q as MimeLookupResult, O as OPERATIONS, P as ParsedSpec, R as
|
|
1
|
+
export { A as ALL_FLAGS, a as ApiEndpoint, b as ApiInfo, C as CHEATSHEET, d as CheatsheetEntry, e as CssResult, D as DockerImageRef, E as EnvEntry, f as EnvParseResult, G as GitCommandConfig, g as GitCommandResult, h as GitOperation, i as GithubUrlInfo, j as GithubUrlType, k as GqlFormatResult, H as HtmlFormatResult, l as HtmlMinifyOptions, m as HtmlMinifyResult, J as JsMinifyOptions, n as JsMinifyResult, M as MIME_TABLE, o as MatchResult, p as MimeEntry, q as MimeLookupResult, O as OPERATIONS, P as ParsedSpec, R as RedosFinding, r as RedosResult, s as RedosSeverity, t as RegexError, u as RegexFlag, v as RegexMatch, w as RegexResult, x as RegexSuccess, S as SQL_DEFAULT_OPTIONS, y as Segment, z as SpecVersion, B as SqlDialect, F as SqlFormatOptions, T as TestPatternResult, I as buildDockerPull, K as buildDockerRun, L as buildGitCommand, N as collapseHtmlWhitespace, Q as collapseJsWhitespace, U as countProperties, V as countRules, W as detectDialect, X as detectOperationType, Y as detectRedos, Z as envToExport, _ as envToJson, $ as formatCss, a0 as formatGql, a1 as formatHtml, a2 as formatSql, a3 as getEndpointsByTag, a4 as getHtmlStats, a5 as getJsStats, a6 as getMethodColor, a7 as isValidTag, a8 as lookupMime, a9 as minifyCss, aa as minifyGql, ab as minifyHtml, ac as minifyJs, ad as minifySql, ae as normalizeRef, af as parseDockerImage, ag as parseEnv, ah as parseGitCommand, ai as parseGithubUrl, aj as parseSpec, ak as removeConsoleCalls, al as removeEmptyAttributes, am as removeHtmlComments, an as removeJsComments, ao as removeRedundantAttributes, ap as searchCheatsheet, aq as searchEndpoints, ar as splitStatements, as as testPattern, at as testRegex, au as validateEnvKey } from '../code-DaRvff2v.js';
|
package/dist/tools/code.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { ALL_FLAGS, CHEATSHEET, MIME_TABLE, OPERATIONS, SQL_DEFAULT_OPTIONS, buildDockerPull, buildDockerRun, buildGitCommand, collapseHtmlWhitespace, collapseJsWhitespace, countProperties, countRules, detectDialect, detectOperationType, envToExport, envToJson, formatCss, formatGql, formatHtml, formatSql, getEndpointsByTag, getHtmlStats, getJsStats, getMethodColor, isValidTag, lookupMime, minifyCss, minifyGql, minifyHtml, minifyJs, minifySql, normalizeRef, parseDockerImage, parseEnv, parseGitCommand, parseGithubUrl, parseSpec, removeConsoleCalls, removeEmptyAttributes, removeHtmlComments, removeJsComments, removeRedundantAttributes, searchCheatsheet, searchEndpoints, splitStatements, testPattern, testRegex, validateEnvKey } from '../chunk-
|
|
1
|
+
export { ALL_FLAGS, CHEATSHEET, 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, lookupMime, minifyCss, minifyGql, minifyHtml, minifyJs, minifySql, normalizeRef, parseDockerImage, parseEnv, parseGitCommand, parseGithubUrl, parseSpec, removeConsoleCalls, removeEmptyAttributes, removeHtmlComments, removeJsComments, removeRedundantAttributes, searchCheatsheet, searchEndpoints, splitStatements, testPattern, testRegex, validateEnvKey } from '../chunk-LXKIPPDG.js';
|
|
2
2
|
import '../chunk-MLKGABMK.js';
|
package/dist/tools/network.cjs
CHANGED
|
@@ -1685,10 +1685,103 @@ function parseUserAgent(ua) {
|
|
|
1685
1685
|
const device = { type: _detectUaDeviceType(s) };
|
|
1686
1686
|
return { browser, engine, os, device, raw: s };
|
|
1687
1687
|
}
|
|
1688
|
+
var _CACHE_NUM_FIELDS = ["maxAge", "sMaxAge", "staleWhileRevalidate", "staleIfError"];
|
|
1689
|
+
function _humanizeSeconds(s) {
|
|
1690
|
+
if (s === 0) return "0 seconds";
|
|
1691
|
+
const units = [
|
|
1692
|
+
[86400, "day"],
|
|
1693
|
+
[3600, "hour"],
|
|
1694
|
+
[60, "minute"],
|
|
1695
|
+
[1, "second"]
|
|
1696
|
+
];
|
|
1697
|
+
const parts = [];
|
|
1698
|
+
let rem = s;
|
|
1699
|
+
for (const [size, label] of units) {
|
|
1700
|
+
if (rem >= size) {
|
|
1701
|
+
const n = Math.floor(rem / size);
|
|
1702
|
+
rem -= n * size;
|
|
1703
|
+
parts.push(`${n} ${label}${n === 1 ? "" : "s"}`);
|
|
1704
|
+
}
|
|
1705
|
+
}
|
|
1706
|
+
return parts.slice(0, 2).join(" ");
|
|
1707
|
+
}
|
|
1708
|
+
function buildCacheControl(options = {}) {
|
|
1709
|
+
const nums = {
|
|
1710
|
+
maxAge: null,
|
|
1711
|
+
sMaxAge: null,
|
|
1712
|
+
staleWhileRevalidate: null,
|
|
1713
|
+
staleIfError: null
|
|
1714
|
+
};
|
|
1715
|
+
for (const field of _CACHE_NUM_FIELDS) {
|
|
1716
|
+
const v = options[field];
|
|
1717
|
+
if (v === void 0 || v === null) continue;
|
|
1718
|
+
if (typeof v !== "number" || !Number.isFinite(v) || !Number.isInteger(v) || v < 0) {
|
|
1719
|
+
return { error: `${field} must be a non-negative integer number of seconds` };
|
|
1720
|
+
}
|
|
1721
|
+
nums[field] = v;
|
|
1722
|
+
}
|
|
1723
|
+
const directives = [];
|
|
1724
|
+
const warnings = [];
|
|
1725
|
+
if (options.visibility === "public") {
|
|
1726
|
+
directives.push({ name: "public", value: null, explanation: "Any cache, including shared caches and CDNs, may store this response." });
|
|
1727
|
+
}
|
|
1728
|
+
if (options.visibility === "private") {
|
|
1729
|
+
directives.push({ name: "private", value: null, explanation: "Only the user's browser may cache this response; shared caches and CDNs must not." });
|
|
1730
|
+
}
|
|
1731
|
+
if (options.noCache) {
|
|
1732
|
+
directives.push({ name: "no-cache", value: null, explanation: "A cache may store the response but must revalidate it with the origin before every reuse." });
|
|
1733
|
+
}
|
|
1734
|
+
if (options.noStore) {
|
|
1735
|
+
directives.push({ name: "no-store", value: null, explanation: "No cache may store any part of this request or response." });
|
|
1736
|
+
}
|
|
1737
|
+
if (nums.maxAge !== null) {
|
|
1738
|
+
directives.push({ name: "max-age", value: String(nums.maxAge), explanation: `Considered fresh for ${_humanizeSeconds(nums.maxAge)} (${nums.maxAge}s), after which it becomes stale.` });
|
|
1739
|
+
}
|
|
1740
|
+
if (nums.sMaxAge !== null) {
|
|
1741
|
+
directives.push({ name: "s-maxage", value: String(nums.sMaxAge), explanation: `For shared caches (CDNs, proxies) it is fresh for ${_humanizeSeconds(nums.sMaxAge)} (${nums.sMaxAge}s), overriding max-age there.` });
|
|
1742
|
+
}
|
|
1743
|
+
if (options.mustRevalidate) {
|
|
1744
|
+
directives.push({ name: "must-revalidate", value: null, explanation: "Once stale, a cache must revalidate with the origin and never serve the stale copy." });
|
|
1745
|
+
}
|
|
1746
|
+
if (options.proxyRevalidate) {
|
|
1747
|
+
directives.push({ name: "proxy-revalidate", value: null, explanation: "Like must-revalidate, but the requirement applies only to shared caches." });
|
|
1748
|
+
}
|
|
1749
|
+
if (options.immutable) {
|
|
1750
|
+
directives.push({ name: "immutable", value: null, explanation: "The body will not change while fresh, so browsers should not revalidate it on reload." });
|
|
1751
|
+
}
|
|
1752
|
+
if (options.noTransform) {
|
|
1753
|
+
directives.push({ name: "no-transform", value: null, explanation: "Intermediaries must not modify the response body (for example, recompressing images)." });
|
|
1754
|
+
}
|
|
1755
|
+
if (nums.staleWhileRevalidate !== null) {
|
|
1756
|
+
directives.push({ name: "stale-while-revalidate", value: String(nums.staleWhileRevalidate), explanation: `A cache may serve the stale response for up to ${_humanizeSeconds(nums.staleWhileRevalidate)} (${nums.staleWhileRevalidate}s) while it revalidates in the background.` });
|
|
1757
|
+
}
|
|
1758
|
+
if (nums.staleIfError !== null) {
|
|
1759
|
+
directives.push({ name: "stale-if-error", value: String(nums.staleIfError), explanation: `A cache may serve the stale response for up to ${_humanizeSeconds(nums.staleIfError)} (${nums.staleIfError}s) if the origin returns an error.` });
|
|
1760
|
+
}
|
|
1761
|
+
if (options.mustUnderstand) {
|
|
1762
|
+
directives.push({ name: "must-understand", value: null, explanation: "A cache should store the response only if it understands the caching requirements of the response's status code." });
|
|
1763
|
+
}
|
|
1764
|
+
if (options.noStore && directives.length > 1) {
|
|
1765
|
+
warnings.push("no-store means nothing is cached, so the other directives have no effect.");
|
|
1766
|
+
}
|
|
1767
|
+
if (options.noCache && nums.maxAge !== null) {
|
|
1768
|
+
warnings.push("no-cache forces revalidation on every use, so max-age has little practical effect alongside it.");
|
|
1769
|
+
}
|
|
1770
|
+
if (options.immutable && nums.maxAge === null) {
|
|
1771
|
+
warnings.push("immutable only applies while the response is fresh \u2014 add a max-age so it has a freshness lifetime.");
|
|
1772
|
+
}
|
|
1773
|
+
if (directives.length === 0) {
|
|
1774
|
+
warnings.push("No directives set \u2014 an empty Cache-Control header has no effect.");
|
|
1775
|
+
}
|
|
1776
|
+
const header = directives.map((d) => d.value === null ? d.name : `${d.name}=${d.value}`).join(", ");
|
|
1777
|
+
const snippet = `Cache-Control: ${header}`;
|
|
1778
|
+
return { header, headerName: "Cache-Control", snippet, directives, warnings };
|
|
1779
|
+
}
|
|
1688
1780
|
|
|
1689
1781
|
exports.DNS_RECORD_TYPES = DNS_RECORD_TYPES;
|
|
1690
1782
|
exports.HTTP_HEADERS = HTTP_HEADERS;
|
|
1691
1783
|
exports.STATUS_CODES = STATUS_CODES;
|
|
1784
|
+
exports.buildCacheControl = buildCacheControl;
|
|
1692
1785
|
exports.buildDnsQueryUrl = buildDnsQueryUrl;
|
|
1693
1786
|
exports.buildGeoUrl = buildGeoUrl;
|
|
1694
1787
|
exports.buildMapUrl = buildMapUrl;
|
package/dist/tools/network.d.cts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { D as DNS_RECORD_TYPES,
|
|
1
|
+
export { C as CacheControlDirective, a as CacheControlOptions, b as CacheControlResult, D as DNS_RECORD_TYPES, c as DnsRecord, d as DnsRecordType, e as DnsResponse, G as GeoResult, H as HTTP_HEADERS, f as HarEntry, g as HarParseResult, h as HarSummary, i as HeaderCategory, j as HttpHeader, P as ParsedDnsResult, k as ParsedGeoResult, R as RobotsGroup, l as RobotsIssue, m as RobotsRule, o as RobotsValidationResult, S as STATUS_CODES, p as SitemapIndexEntry, q as SitemapIssue, r as SitemapUrlEntry, s as SitemapValidationResult, t as StatusCode, U as UaDeviceType, u as UserAgentInfo, v as buildCacheControl, w as buildDnsQueryUrl, x as buildGeoUrl, y as buildMapUrl, z as countryCodeToFlag, A as formatCoordinates, B as formatTtl, E as getByCategory, F as getHeader, I as getHeadersByCategory, J as getStatusByCategory, K as getStatusCode, L as isClientError, M as isServerError, N as isSuccess, O as isValidIp, Q as isValidIpv4, T as isValidIpv6, V as parseDnsResponse, W as parseGeoResponse, X as parseHar, Y as parseUserAgent, Z as searchHeaders, _ as searchStatusCodes, $ as statusCodeToText, a0 as typeNumberToLabel, a1 as validateDomain, a2 as validateHeaderName, a3 as validateHeaderValue, a4 as validateRobotsTxt, a5 as validateSitemap } from '../network-BJOjJnmY.cjs';
|
package/dist/tools/network.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { D as DNS_RECORD_TYPES,
|
|
1
|
+
export { C as CacheControlDirective, a as CacheControlOptions, b as CacheControlResult, D as DNS_RECORD_TYPES, c as DnsRecord, d as DnsRecordType, e as DnsResponse, G as GeoResult, H as HTTP_HEADERS, f as HarEntry, g as HarParseResult, h as HarSummary, i as HeaderCategory, j as HttpHeader, P as ParsedDnsResult, k as ParsedGeoResult, R as RobotsGroup, l as RobotsIssue, m as RobotsRule, o as RobotsValidationResult, S as STATUS_CODES, p as SitemapIndexEntry, q as SitemapIssue, r as SitemapUrlEntry, s as SitemapValidationResult, t as StatusCode, U as UaDeviceType, u as UserAgentInfo, v as buildCacheControl, w as buildDnsQueryUrl, x as buildGeoUrl, y as buildMapUrl, z as countryCodeToFlag, A as formatCoordinates, B as formatTtl, E as getByCategory, F as getHeader, I as getHeadersByCategory, J as getStatusByCategory, K as getStatusCode, L as isClientError, M as isServerError, N as isSuccess, O as isValidIp, Q as isValidIpv4, T as isValidIpv6, V as parseDnsResponse, W as parseGeoResponse, X as parseHar, Y as parseUserAgent, Z as searchHeaders, _ as searchStatusCodes, $ as statusCodeToText, a0 as typeNumberToLabel, a1 as validateDomain, a2 as validateHeaderName, a3 as validateHeaderValue, a4 as validateRobotsTxt, a5 as validateSitemap } from '../network-BJOjJnmY.js';
|
package/dist/tools/network.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { DNS_RECORD_TYPES, HTTP_HEADERS, STATUS_CODES, buildDnsQueryUrl, buildGeoUrl, buildMapUrl, countryCodeToFlag, formatCoordinates, formatTtl, getByCategory, getHeader, getHeadersByCategory, getStatusByCategory, getStatusCode, isClientError, isServerError, isSuccess, isValidIp, isValidIpv4, isValidIpv6, parseDnsResponse, parseGeoResponse, parseHar, parseUserAgent, searchHeaders, searchStatusCodes, statusCodeToText, typeNumberToLabel, validateDomain, validateHeaderName, validateHeaderValue, validateRobotsTxt, validateSitemap } from '../chunk-
|
|
1
|
+
export { DNS_RECORD_TYPES, HTTP_HEADERS, STATUS_CODES, buildCacheControl, buildDnsQueryUrl, buildGeoUrl, buildMapUrl, countryCodeToFlag, formatCoordinates, formatTtl, getByCategory, getHeader, getHeadersByCategory, getStatusByCategory, getStatusCode, isClientError, isServerError, isSuccess, isValidIp, isValidIpv4, isValidIpv6, parseDnsResponse, parseGeoResponse, parseHar, parseUserAgent, searchHeaders, searchStatusCodes, statusCodeToText, typeNumberToLabel, validateDomain, validateHeaderName, validateHeaderValue, validateRobotsTxt, validateSitemap } from '../chunk-Y5OOP6WN.js';
|
|
2
2
|
import '../chunk-MLKGABMK.js';
|
package/dist/tools/text.cjs
CHANGED
|
@@ -2399,6 +2399,104 @@ function scoreReadability(text) {
|
|
|
2399
2399
|
readingLevel: readabilityGradeLabel(fleschReadingEase)
|
|
2400
2400
|
};
|
|
2401
2401
|
}
|
|
2402
|
+
var FILLER_WORDS = [
|
|
2403
|
+
"very",
|
|
2404
|
+
"really",
|
|
2405
|
+
"just",
|
|
2406
|
+
"actually",
|
|
2407
|
+
"basically",
|
|
2408
|
+
"literally",
|
|
2409
|
+
"simply",
|
|
2410
|
+
"totally",
|
|
2411
|
+
"definitely",
|
|
2412
|
+
"certainly",
|
|
2413
|
+
"essentially",
|
|
2414
|
+
"absolutely",
|
|
2415
|
+
"completely",
|
|
2416
|
+
"extremely",
|
|
2417
|
+
"truly",
|
|
2418
|
+
"honestly",
|
|
2419
|
+
"seriously",
|
|
2420
|
+
"obviously",
|
|
2421
|
+
"clearly",
|
|
2422
|
+
"quite",
|
|
2423
|
+
"rather",
|
|
2424
|
+
"somewhat",
|
|
2425
|
+
"fairly",
|
|
2426
|
+
"virtually"
|
|
2427
|
+
];
|
|
2428
|
+
var HEDGE_PHRASES = [
|
|
2429
|
+
"maybe",
|
|
2430
|
+
"perhaps",
|
|
2431
|
+
"probably",
|
|
2432
|
+
"possibly",
|
|
2433
|
+
"arguably",
|
|
2434
|
+
"kind of",
|
|
2435
|
+
"sort of",
|
|
2436
|
+
"a bit",
|
|
2437
|
+
"a little",
|
|
2438
|
+
"more or less",
|
|
2439
|
+
"in my opinion",
|
|
2440
|
+
"i think",
|
|
2441
|
+
"i believe",
|
|
2442
|
+
"to some extent"
|
|
2443
|
+
];
|
|
2444
|
+
var CLICHE_PHRASES = [
|
|
2445
|
+
"at the end of the day",
|
|
2446
|
+
"think outside the box",
|
|
2447
|
+
"low-hanging fruit",
|
|
2448
|
+
"move the needle",
|
|
2449
|
+
"circle back",
|
|
2450
|
+
"touch base",
|
|
2451
|
+
"on the same page",
|
|
2452
|
+
"hit the ground running",
|
|
2453
|
+
"paradigm shift",
|
|
2454
|
+
"win-win",
|
|
2455
|
+
"game changer",
|
|
2456
|
+
"best of both worlds",
|
|
2457
|
+
"only time will tell",
|
|
2458
|
+
"back to the drawing board",
|
|
2459
|
+
"the tip of the iceberg",
|
|
2460
|
+
"a perfect storm",
|
|
2461
|
+
"needle in a haystack",
|
|
2462
|
+
"raise the bar",
|
|
2463
|
+
"push the envelope",
|
|
2464
|
+
"the elephant in the room",
|
|
2465
|
+
"boil the ocean",
|
|
2466
|
+
"when it rains it pours"
|
|
2467
|
+
];
|
|
2468
|
+
var FILLER_DICTIONARY = [
|
|
2469
|
+
...FILLER_WORDS.map((phrase) => ({ phrase, category: "filler" })),
|
|
2470
|
+
...HEDGE_PHRASES.map((phrase) => ({ phrase, category: "hedge" })),
|
|
2471
|
+
...CLICHE_PHRASES.map((phrase) => ({ phrase, category: "cliche" }))
|
|
2472
|
+
];
|
|
2473
|
+
function _fillerRegex(phrase) {
|
|
2474
|
+
const tokens = phrase.split(/\s+/).map((t) => t.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"));
|
|
2475
|
+
return new RegExp("\\b" + tokens.join("\\s+") + "\\b", "gi");
|
|
2476
|
+
}
|
|
2477
|
+
function detectFillerWords(text) {
|
|
2478
|
+
const totalWords = (text.match(/[A-Za-z0-9']+/g) ?? []).length;
|
|
2479
|
+
const matches = [];
|
|
2480
|
+
for (const entry of FILLER_DICTIONARY) {
|
|
2481
|
+
const re = _fillerRegex(entry.phrase);
|
|
2482
|
+
const indices = [];
|
|
2483
|
+
let m;
|
|
2484
|
+
while ((m = re.exec(text)) !== null) {
|
|
2485
|
+
indices.push(m.index);
|
|
2486
|
+
if (m.index === re.lastIndex) re.lastIndex++;
|
|
2487
|
+
}
|
|
2488
|
+
if (indices.length > 0) {
|
|
2489
|
+
matches.push({ phrase: entry.phrase, category: entry.category, count: indices.length, indices });
|
|
2490
|
+
}
|
|
2491
|
+
}
|
|
2492
|
+
matches.sort((a, b) => b.count - a.count || a.category.localeCompare(b.category) || a.phrase.localeCompare(b.phrase));
|
|
2493
|
+
const fillerCount = matches.filter((x) => x.category === "filler").reduce((s, x) => s + x.count, 0);
|
|
2494
|
+
const hedgeCount = matches.filter((x) => x.category === "hedge").reduce((s, x) => s + x.count, 0);
|
|
2495
|
+
const clicheCount = matches.filter((x) => x.category === "cliche").reduce((s, x) => s + x.count, 0);
|
|
2496
|
+
const totalMatches = fillerCount + hedgeCount + clicheCount;
|
|
2497
|
+
const density = totalWords > 0 ? Math.round(totalMatches / totalWords * 1e3) / 10 : 0;
|
|
2498
|
+
return { totalWords, totalMatches, fillerCount, hedgeCount, clicheCount, density, matches };
|
|
2499
|
+
}
|
|
2402
2500
|
|
|
2403
2501
|
exports.CASE_FORMATS = CASE_FORMATS;
|
|
2404
2502
|
exports.DEFAULT_CONVERT_OPTIONS = DEFAULT_CONVERT_OPTIONS;
|
|
@@ -2416,6 +2514,7 @@ exports.countWords = countWords;
|
|
|
2416
2514
|
exports.csvToHtml = csvToHtml;
|
|
2417
2515
|
exports.csvToMarkdown = csvToMarkdown;
|
|
2418
2516
|
exports.detectDelimiter = detectDelimiter;
|
|
2517
|
+
exports.detectFillerWords = detectFillerWords;
|
|
2419
2518
|
exports.detectPassiveVoice = detectPassiveVoice;
|
|
2420
2519
|
exports.diffLines = diffLines;
|
|
2421
2520
|
exports.diffLinesSimple = diffLinesSimple;
|
package/dist/tools/text.d.cts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { A as AsciiFont, a as AsciiOptions, C as CASE_FORMATS, b as CaseFormat, c as ConvertOptions, D as DEFAULT_CONVERT_OPTIONS, d as DiffFile, e as DiffHunk, f as DiffLine, g as DiffResult, h as DiffType, i as DiffViewerLine, E as ESCAPE_MODES, j as EscapeMode, L as LINE_OPS,
|
|
1
|
+
export { A as AsciiFont, a as AsciiOptions, C as CASE_FORMATS, b as CaseFormat, c as ConvertOptions, D as DEFAULT_CONVERT_OPTIONS, d as DiffFile, e as DiffHunk, f as DiffLine, g as DiffResult, h as DiffType, i as DiffViewerLine, E as ESCAPE_MODES, j as EscapeMode, F as FillerCategory, k as FillerMatch, l as FillerWordResult, L as LINE_OPS, m as LineOp, n as LineType, o as LoremUnit, M as MORSE_CODE, p as MarkdownResult, q as MorseOptions, P as ParsedDiff, r as ParsedTable, s as PassiveVoiceMatch, u as PassiveVoiceResult, v as PassiveVoiceSentence, R as ReadabilityResult, w as ReadabilityScore, S as SlugSeparator, T as TableOptions, x as TextAnalysis, W as WordCountResult, y as addBorder, z as analyzeText, B as applyOp, G as applyOps, H as centerText, I as convertAll, J as convertCase, K as countWords, N as csvToHtml, O as csvToMarkdown, Q as detectDelimiter, U as detectFillerWords, V as detectPassiveVoice, X as diffLines, Y as diffLinesSimple, Z as diffStats, _ as escapeAll, $ as escapeString, a0 as extractHeadings, a1 as formatReadingTime, a2 as generate, a3 as generateDiff, a4 as generateHtmlTable, a5 as generateMarkdownTable, a6 as generateParagraphs, a7 as generateSentences, a8 as generateWords, a9 as getAvailableFonts, aa as getMorseForChar, ab as getMorseTiming, ac as htmlToMarkdown, ad as isValidMorse, ae as markdownToHtml, af as morseToText, ag as numberToOrdinal, ah as numberToRoman, ai as numberToWords, aj as ordinalWords, ak as parseDiff, al as parseTableData, am as readabilityScore, an as renderMarkdown, ao as romanToNumber, ap as scoreReadability, aq as sentenceCount, ar as slugify, as as slugifyAll, at as syllableCount, au as textToAscii, av as textToMorse, aw as unescapeString, ax as wordFrequency } from '../text-DS70aMY5.cjs';
|
package/dist/tools/text.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { A as AsciiFont, a as AsciiOptions, C as CASE_FORMATS, b as CaseFormat, c as ConvertOptions, D as DEFAULT_CONVERT_OPTIONS, d as DiffFile, e as DiffHunk, f as DiffLine, g as DiffResult, h as DiffType, i as DiffViewerLine, E as ESCAPE_MODES, j as EscapeMode, L as LINE_OPS,
|
|
1
|
+
export { A as AsciiFont, a as AsciiOptions, C as CASE_FORMATS, b as CaseFormat, c as ConvertOptions, D as DEFAULT_CONVERT_OPTIONS, d as DiffFile, e as DiffHunk, f as DiffLine, g as DiffResult, h as DiffType, i as DiffViewerLine, E as ESCAPE_MODES, j as EscapeMode, F as FillerCategory, k as FillerMatch, l as FillerWordResult, L as LINE_OPS, m as LineOp, n as LineType, o as LoremUnit, M as MORSE_CODE, p as MarkdownResult, q as MorseOptions, P as ParsedDiff, r as ParsedTable, s as PassiveVoiceMatch, u as PassiveVoiceResult, v as PassiveVoiceSentence, R as ReadabilityResult, w as ReadabilityScore, S as SlugSeparator, T as TableOptions, x as TextAnalysis, W as WordCountResult, y as addBorder, z as analyzeText, B as applyOp, G as applyOps, H as centerText, I as convertAll, J as convertCase, K as countWords, N as csvToHtml, O as csvToMarkdown, Q as detectDelimiter, U as detectFillerWords, V as detectPassiveVoice, X as diffLines, Y as diffLinesSimple, Z as diffStats, _ as escapeAll, $ as escapeString, a0 as extractHeadings, a1 as formatReadingTime, a2 as generate, a3 as generateDiff, a4 as generateHtmlTable, a5 as generateMarkdownTable, a6 as generateParagraphs, a7 as generateSentences, a8 as generateWords, a9 as getAvailableFonts, aa as getMorseForChar, ab as getMorseTiming, ac as htmlToMarkdown, ad as isValidMorse, ae as markdownToHtml, af as morseToText, ag as numberToOrdinal, ah as numberToRoman, ai as numberToWords, aj as ordinalWords, ak as parseDiff, al as parseTableData, am as readabilityScore, an as renderMarkdown, ao as romanToNumber, ap as scoreReadability, aq as sentenceCount, ar as slugify, as as slugifyAll, at as syllableCount, au as textToAscii, av as textToMorse, aw as unescapeString, ax as wordFrequency } from '../text-DS70aMY5.js';
|
package/dist/tools/text.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { CASE_FORMATS, DEFAULT_CONVERT_OPTIONS, ESCAPE_MODES, LINE_OPS, MORSE_CODE, addBorder, analyzeText, applyOp, applyOps, centerText, convertAll, convertCase, countWords, csvToHtml, csvToMarkdown, detectDelimiter, detectPassiveVoice, diffLines, diffLinesSimple, diffStats, escapeAll, escapeString, extractHeadings, formatReadingTime, generate, generateDiff, generateHtmlTable, generateMarkdownTable, generateParagraphs, generateSentences, generateWords, getAvailableFonts, getMorseForChar, getMorseTiming, htmlToMarkdown, isValidMorse, markdownToHtml, morseToText, numberToOrdinal, numberToRoman, numberToWords, ordinalWords, parseDiff, parseTableData, readabilityScore, renderMarkdown, romanToNumber, scoreReadability, sentenceCount, slugify, slugifyAll, syllableCount, textToAscii, textToMorse, unescapeString, wordFrequency } from '../chunk-
|
|
1
|
+
export { CASE_FORMATS, DEFAULT_CONVERT_OPTIONS, ESCAPE_MODES, LINE_OPS, MORSE_CODE, addBorder, analyzeText, applyOp, applyOps, centerText, convertAll, convertCase, countWords, csvToHtml, csvToMarkdown, detectDelimiter, detectFillerWords, detectPassiveVoice, diffLines, diffLinesSimple, diffStats, escapeAll, escapeString, extractHeadings, formatReadingTime, generate, generateDiff, generateHtmlTable, generateMarkdownTable, generateParagraphs, generateSentences, generateWords, getAvailableFonts, getMorseForChar, getMorseTiming, htmlToMarkdown, isValidMorse, markdownToHtml, morseToText, numberToOrdinal, numberToRoman, numberToWords, ordinalWords, parseDiff, parseTableData, readabilityScore, renderMarkdown, romanToNumber, scoreReadability, sentenceCount, slugify, slugifyAll, syllableCount, textToAscii, textToMorse, unescapeString, wordFrequency } from '../chunk-2I4O5YCT.js';
|
|
2
2
|
import '../chunk-MLKGABMK.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@utilix-tech/sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.20.0",
|
|
4
4
|
"description": "154+ developer utility tools for Node.js: JSON, encoding, hashing, color, CSS, network and more. Runs locally, no API key required.",
|
|
5
5
|
"author": "Utilix <hello@utilix.tech>",
|
|
6
6
|
"license": "MIT",
|