@utilix-tech/sdk 0.83.0 → 0.85.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/README.md +2 -2
  3. package/dist/{chunk-IEPWZERQ.js → chunk-6EJVNQSY.js} +38 -1
  4. package/dist/{chunk-OFLNVDNX.js → chunk-BCISWFVJ.js} +50 -1
  5. package/dist/{chunk-QVOK3BXM.js → chunk-FB6CCFR5.js} +77 -1
  6. package/dist/{chunk-KXUHXQFO.js → chunk-RMXZMYSG.js} +107 -1
  7. package/dist/{code-COUhffgE.d.cts → code-mkKV7BQ4.d.cts} +33 -2
  8. package/dist/{code-COUhffgE.d.ts → code-mkKV7BQ4.d.ts} +33 -2
  9. package/dist/index.cjs +268 -0
  10. package/dist/index.d.cts +4 -4
  11. package/dist/index.d.ts +4 -4
  12. package/dist/index.js +4 -4
  13. package/dist/{text-CNn3whZA.d.ts → text-xY5MJwr0.d.cts} +34 -2
  14. package/dist/{text-CNn3whZA.d.cts → text-xY5MJwr0.d.ts} +34 -2
  15. package/dist/{time-KqJjdqII.d.cts → time-VMAy_SrV.d.cts} +22 -2
  16. package/dist/{time-KqJjdqII.d.ts → time-VMAy_SrV.d.ts} +22 -2
  17. package/dist/tools/code.cjs +106 -0
  18. package/dist/tools/code.d.cts +1 -1
  19. package/dist/tools/code.d.ts +1 -1
  20. package/dist/tools/code.js +1 -1
  21. package/dist/tools/text.cjs +76 -0
  22. package/dist/tools/text.d.cts +1 -1
  23. package/dist/tools/text.d.ts +1 -1
  24. package/dist/tools/text.js +1 -1
  25. package/dist/tools/time.cjs +37 -0
  26. package/dist/tools/time.d.cts +1 -1
  27. package/dist/tools/time.d.ts +1 -1
  28. package/dist/tools/time.js +1 -1
  29. package/dist/tools/units.cjs +49 -0
  30. package/dist/tools/units.d.cts +1 -1
  31. package/dist/tools/units.d.ts +1 -1
  32. package/dist/tools/units.js +1 -1
  33. package/dist/{units-D7YRRwei.d.cts → units-DwIvTP-X.d.cts} +27 -2
  34. package/dist/{units-D7YRRwei.d.ts → units-DwIvTP-X.d.ts} +27 -2
  35. package/package.json +1 -1
package/dist/index.cjs CHANGED
@@ -2319,6 +2319,7 @@ __export(text_exports, {
2319
2319
  applyOps: () => applyOps,
2320
2320
  calculateStringDistance: () => calculateStringDistance,
2321
2321
  centerText: () => centerText,
2322
+ checkDashUsage: () => checkDashUsage,
2322
2323
  checkOxfordCommaConsistency: () => checkOxfordCommaConsistency,
2323
2324
  convertAll: () => convertAll,
2324
2325
  convertCase: () => convertCase,
@@ -5492,6 +5493,81 @@ function checkOxfordCommaConsistency(text) {
5492
5493
  const consistent = withOxfordComma === 0 || withoutOxfordComma === 0;
5493
5494
  return { totalLists: instances.length, withOxfordComma, withoutOxfordComma, consistent, instances };
5494
5495
  }
5496
+ function dashContextSnippet(text, index, matchLen) {
5497
+ const start = Math.max(0, index - 20);
5498
+ const end = Math.min(text.length, index + matchLen + 20);
5499
+ const body = text.slice(start, end).replace(/\s+/g, " ").trim();
5500
+ return (start > 0 ? "\u2026" : "") + body + (end < text.length ? "\u2026" : "");
5501
+ }
5502
+ function checkDashUsage(text) {
5503
+ const issues = [];
5504
+ const enDashCount = (text.match(/–/g) ?? []).length;
5505
+ const hyphenCount = (text.match(/-/g) ?? []).length;
5506
+ const doubleHyphenMatches = [...text.matchAll(/-{2,}/g)];
5507
+ for (const m of doubleHyphenMatches) {
5508
+ const index = m.index ?? 0;
5509
+ issues.push({
5510
+ type: "double-hyphen",
5511
+ index,
5512
+ context: dashContextSnippet(text, index, m[0].length),
5513
+ message: `Found ${m[0].length} consecutive hyphens ("${m[0]}"); likely meant to be an em dash (\u2014) or en dash (\u2013).`
5514
+ });
5515
+ }
5516
+ const spacedHyphenMatches = [...text.matchAll(/(?<=\S) - (?=\S)/g)];
5517
+ for (const m of spacedHyphenMatches) {
5518
+ const index = m.index ?? 0;
5519
+ issues.push({
5520
+ type: "spaced-hyphen",
5521
+ index,
5522
+ context: dashContextSnippet(text, index, m[0].length),
5523
+ message: "A hyphen surrounded by spaces usually signals an intended em dash (\u2014), not a hyphenated compound word."
5524
+ });
5525
+ }
5526
+ const emDashOccurrences = [...text.matchAll(/—/g)];
5527
+ let spacedEm = 0;
5528
+ let unspacedEm = 0;
5529
+ for (const m of emDashOccurrences) {
5530
+ const idx = m.index ?? 0;
5531
+ const before = text[idx - 1];
5532
+ const after = text[idx + 1];
5533
+ if (before === " " && after === " ") spacedEm++;
5534
+ else if (before !== " " && after !== " ") unspacedEm++;
5535
+ }
5536
+ let dominantEmDashStyle = "none";
5537
+ let emDashSpacingConsistent = true;
5538
+ if (emDashOccurrences.length > 0) {
5539
+ dominantEmDashStyle = spacedEm >= unspacedEm ? "spaced" : "unspaced";
5540
+ emDashSpacingConsistent = spacedEm === 0 || unspacedEm === 0;
5541
+ if (!emDashSpacingConsistent) {
5542
+ for (const m of emDashOccurrences) {
5543
+ const idx = m.index ?? 0;
5544
+ const before = text[idx - 1];
5545
+ const after = text[idx + 1];
5546
+ const isSpaced = before === " " && after === " ";
5547
+ const matchesDominant = dominantEmDashStyle === "spaced" ? isSpaced : !isSpaced;
5548
+ if (!matchesDominant) {
5549
+ issues.push({
5550
+ type: "inconsistent-em-dash-spacing",
5551
+ index: idx,
5552
+ context: dashContextSnippet(text, idx, 1),
5553
+ message: `This em dash is ${isSpaced ? "spaced" : "unspaced"}, but the document mostly uses ${dominantEmDashStyle} em dashes.`
5554
+ });
5555
+ }
5556
+ }
5557
+ }
5558
+ }
5559
+ issues.sort((a, b) => a.index - b.index);
5560
+ return {
5561
+ emDashCount: emDashOccurrences.length,
5562
+ enDashCount,
5563
+ hyphenCount,
5564
+ doubleHyphenCount: doubleHyphenMatches.length,
5565
+ spacedHyphenCount: spacedHyphenMatches.length,
5566
+ emDashSpacingConsistent,
5567
+ dominantEmDashStyle,
5568
+ issues
5569
+ };
5570
+ }
5495
5571
 
5496
5572
  // src/tools/data.ts
5497
5573
  var data_exports = {};
@@ -8111,6 +8187,7 @@ __export(time_exports, {
8111
8187
  TIMEZONES: () => TIMEZONES,
8112
8188
  convertTime: () => convertTime,
8113
8189
  diffDates: () => diffDates,
8190
+ findCronOverlaps: () => findCronOverlaps,
8114
8191
  formatInTimezone: () => formatInTimezone,
8115
8192
  formatIso8601Duration: () => formatIso8601Duration,
8116
8193
  formatRelative: () => formatRelative,
@@ -8786,6 +8863,42 @@ function getRunInterval(dates) {
8786
8863
  const days = Math.round(diffMins / 1440);
8787
8864
  return `Every ${days} days`;
8788
8865
  }
8866
+ var MAX_CRON_OVERLAPS = 200;
8867
+ function findCronOverlaps(expressions, windowDays = 30, fromDate) {
8868
+ if (expressions.length < 2) return { error: "Provide at least two cron expressions to check for overlaps" };
8869
+ if (expressions.length > 10) return { error: "Provide 10 or fewer cron expressions" };
8870
+ if (windowDays < 1 || windowDays > 365) return { error: "windowDays must be between 1 and 365" };
8871
+ const parsedList = [];
8872
+ for (let i = 0; i < expressions.length; i++) {
8873
+ const parsed = parseCronExpression(expressions[i]);
8874
+ if (typeof parsed === "object" && "error" in parsed) {
8875
+ return { error: `Expression ${i + 1} ("${expressions[i]}"): ${parsed.error}` };
8876
+ }
8877
+ parsedList.push(parsed);
8878
+ }
8879
+ const start = fromDate ? new Date(fromDate) : /* @__PURE__ */ new Date();
8880
+ const cursor = new Date(start);
8881
+ cursor.setSeconds(0, 0);
8882
+ cursor.setMinutes(cursor.getMinutes() + 1);
8883
+ const endTime = cursor.getTime() + windowDays * 24 * 60 * 60 * 1e3;
8884
+ const overlaps = [];
8885
+ let truncated = false;
8886
+ while (cursor.getTime() < endTime) {
8887
+ const matched = [];
8888
+ for (let i = 0; i < parsedList.length; i++) {
8889
+ if (matchesCron(cursor, parsedList[i])) matched.push(i);
8890
+ }
8891
+ if (matched.length >= 2) {
8892
+ if (overlaps.length >= MAX_CRON_OVERLAPS) {
8893
+ truncated = true;
8894
+ break;
8895
+ }
8896
+ overlaps.push({ date: new Date(cursor), expressionIndexes: matched });
8897
+ }
8898
+ cursor.setMinutes(cursor.getMinutes() + 1);
8899
+ }
8900
+ return { overlaps, windowDays, truncated };
8901
+ }
8789
8902
  var DURATION_SECONDS_PER_YEAR = 365 * 86400;
8790
8903
  var DURATION_SECONDS_PER_MONTH = 30 * 86400;
8791
8904
  function humanizeDurationParts(parts) {
@@ -8906,6 +9019,7 @@ __export(units_exports, {
8906
9019
  calculateCdMaturity: () => calculateCdMaturity,
8907
9020
  calculateChange: () => calculateChange,
8908
9021
  calculateCompoundInterest: () => calculateCompoundInterest,
9022
+ calculateCreditCardMinimumPayment: () => calculateCreditCardMinimumPayment,
8909
9023
  calculateCreditUtilization: () => calculateCreditUtilization,
8910
9024
  calculateDebtToIncomeRatio: () => calculateDebtToIncomeRatio,
8911
9025
  calculateDepreciationSchedule: () => calculateDepreciationSchedule,
@@ -11685,6 +11799,54 @@ function calculateRealRateOfReturn(input) {
11685
11799
  solvedFor
11686
11800
  };
11687
11801
  }
11802
+ var CREDIT_CARD_MIN_PAYMENT_MAX_MONTHS = 1200;
11803
+ function calculateCreditCardMinimumPayment(balance, aprPercent, minPaymentPercent, minPaymentFloor = 0) {
11804
+ if (!Number.isFinite(balance) || balance <= 0) {
11805
+ return { error: "balance must be a finite number greater than zero" };
11806
+ }
11807
+ if (!Number.isFinite(aprPercent) || aprPercent < 0) {
11808
+ return { error: "aprPercent must be a finite, non-negative number" };
11809
+ }
11810
+ if (!Number.isFinite(minPaymentPercent) || minPaymentPercent <= 0) {
11811
+ return { error: "minPaymentPercent must be a finite number greater than zero" };
11812
+ }
11813
+ if (!Number.isFinite(minPaymentFloor) || minPaymentFloor < 0) {
11814
+ return { error: "minPaymentFloor must be a finite, non-negative number" };
11815
+ }
11816
+ const round23 = (n) => Math.round(n * 100) / 100;
11817
+ const monthlyRate = aprPercent / 100 / 12;
11818
+ let bal = balance;
11819
+ let totalInterestPaid = 0;
11820
+ let totalPaid = 0;
11821
+ let firstMonthPayment = 0;
11822
+ let finalMonthPayment = 0;
11823
+ let month = 0;
11824
+ while (bal > 5e-3 && month < CREDIT_CARD_MIN_PAYMENT_MAX_MONTHS) {
11825
+ month++;
11826
+ const interest = bal * monthlyRate;
11827
+ bal += interest;
11828
+ totalInterestPaid += interest;
11829
+ let payment = Math.max(bal * (minPaymentPercent / 100), minPaymentFloor);
11830
+ if (payment > bal) payment = bal;
11831
+ bal -= payment;
11832
+ totalPaid += payment;
11833
+ finalMonthPayment = round23(payment);
11834
+ if (month === 1) firstMonthPayment = round23(payment);
11835
+ }
11836
+ if (bal > 5e-3) {
11837
+ return {
11838
+ error: `balance cannot be paid off within ${CREDIT_CARD_MIN_PAYMENT_MAX_MONTHS} months at this minimum-payment formula; increase minPaymentPercent or minPaymentFloor`
11839
+ };
11840
+ }
11841
+ return {
11842
+ monthsToPayoff: month,
11843
+ yearsToPayoff: round23(month / 12),
11844
+ totalInterestPaid: round23(totalInterestPaid),
11845
+ totalPaid: round23(totalPaid),
11846
+ firstMonthPayment,
11847
+ finalMonthPayment
11848
+ };
11849
+ }
11688
11850
 
11689
11851
  // src/tools/network.ts
11690
11852
  var network_exports = {};
@@ -16803,6 +16965,7 @@ __export(code_exports, {
16803
16965
  getMethodColor: () => getMethodColor,
16804
16966
  isValidTag: () => isValidTag,
16805
16967
  lintConventionalCommit: () => lintConventionalCommit,
16968
+ lintDockerfile: () => lintDockerfile,
16806
16969
  lookupMime: () => lookupMime,
16807
16970
  minifyCss: () => minifyCss,
16808
16971
  minifyGql: () => minifyGql,
@@ -18633,6 +18796,111 @@ function normalizeRef(ref) {
18633
18796
  const tagPart = parsed.digest ? `@${parsed.digest}` : parsed.tag ? `:${parsed.tag}` : "";
18634
18797
  return `${parsed.registry}/${ns}${parsed.repository}${tagPart}`;
18635
18798
  }
18799
+ function _parseDockerfileInstructions(content) {
18800
+ const rawLines = content.replace(/\r\n/g, "\n").split("\n");
18801
+ const instructions = [];
18802
+ let buffer = "";
18803
+ let bufferStartLine = 0;
18804
+ for (let i = 0; i < rawLines.length; i++) {
18805
+ const lineNo = i + 1;
18806
+ const line = rawLines[i];
18807
+ const trimmed = line.trim();
18808
+ if (buffer === "") {
18809
+ if (trimmed === "" || trimmed.startsWith("#")) continue;
18810
+ bufferStartLine = lineNo;
18811
+ buffer = line.trimEnd();
18812
+ } else {
18813
+ buffer += "\n" + line.trimEnd();
18814
+ }
18815
+ if (buffer.endsWith("\\")) {
18816
+ buffer = buffer.slice(0, -1);
18817
+ continue;
18818
+ }
18819
+ const match = buffer.trim().match(/^([A-Za-z]+)\s*([\s\S]*)$/);
18820
+ if (match) {
18821
+ instructions.push({ instruction: match[1].toUpperCase(), args: match[2].trim(), line: bufferStartLine });
18822
+ }
18823
+ buffer = "";
18824
+ }
18825
+ return instructions;
18826
+ }
18827
+ var _DOCKERFILE_TAR_RE = /\.(tar(\.(gz|bz2|xz))?|tgz|tbz2|txz)$/i;
18828
+ function lintDockerfile(content) {
18829
+ if (!content || !content.trim()) return { error: "Dockerfile content is required" };
18830
+ const instructions = _parseDockerfileInstructions(content);
18831
+ if (instructions.length === 0) return { error: "No Dockerfile instructions found" };
18832
+ const fromInstructions = instructions.filter((i) => i.instruction === "FROM");
18833
+ if (fromInstructions.length === 0) return { error: "No FROM instruction found; this does not look like a valid Dockerfile" };
18834
+ const stageNames = /* @__PURE__ */ new Set();
18835
+ const stages = fromInstructions.map((inst, idx) => {
18836
+ const asMatch = inst.args.match(/^(\S+)(?:\s+AS\s+(\S+))?/i);
18837
+ const baseImage = asMatch ? asMatch[1] : inst.args.split(/\s+/)[0];
18838
+ const name = asMatch && asMatch[2] ? asMatch[2] : null;
18839
+ if (name) stageNames.add(name.toLowerCase());
18840
+ return { index: idx, name, baseImage, fromLine: inst.line };
18841
+ });
18842
+ const findings = [];
18843
+ for (const stage of stages) {
18844
+ const base = stage.baseImage;
18845
+ if (base.toLowerCase() === "scratch") continue;
18846
+ if (stageNames.has(base.toLowerCase())) continue;
18847
+ const withoutDigest = base.split("@")[0];
18848
+ const hasTag = withoutDigest.includes(":");
18849
+ const tag = hasTag ? withoutDigest.split(":").pop() : null;
18850
+ if (!hasTag) {
18851
+ findings.push({
18852
+ rule: "unpinned-base-image",
18853
+ severity: "warning",
18854
+ line: stage.fromLine,
18855
+ message: `FROM ${base} has no tag, so it resolves to ":latest", which can silently change what gets built on a future run. Pin an explicit version tag instead.`
18856
+ });
18857
+ } else if (tag === "latest") {
18858
+ findings.push({
18859
+ rule: "unpinned-base-image",
18860
+ severity: "warning",
18861
+ line: stage.fromLine,
18862
+ message: `FROM ${base} is explicitly pinned to the "latest" tag, which is a moving target rather than a fixed version. Pin an explicit version tag instead.`
18863
+ });
18864
+ }
18865
+ }
18866
+ const finalStage = stages[stages.length - 1];
18867
+ const finalStageInstructions = instructions.filter((i) => i.line >= finalStage.fromLine);
18868
+ if (!finalStageInstructions.some((i) => i.instruction === "WORKDIR")) {
18869
+ findings.push({
18870
+ rule: "missing-workdir",
18871
+ severity: "warning",
18872
+ line: finalStage.fromLine,
18873
+ message: 'No WORKDIR instruction in the final stage, so RUN/CMD/ENTRYPOINT execute from "/" by default. Set an explicit WORKDIR.'
18874
+ });
18875
+ }
18876
+ if (!finalStageInstructions.some((i) => i.instruction === "USER")) {
18877
+ findings.push({
18878
+ rule: "running-as-root",
18879
+ severity: "warning",
18880
+ line: finalStage.fromLine,
18881
+ message: "No USER instruction in the final stage, so the container runs as root by default. Add a non-root USER unless root is genuinely required."
18882
+ });
18883
+ }
18884
+ for (const inst of instructions) {
18885
+ if (inst.instruction !== "ADD") continue;
18886
+ const parts = inst.args.split(/\s+/).filter(Boolean).filter((p) => !p.startsWith("--"));
18887
+ if (parts.length < 2) continue;
18888
+ const sources = parts.slice(0, -1);
18889
+ for (const src of sources) {
18890
+ const isUrl = /^https?:\/\//i.test(src);
18891
+ const isTar = _DOCKERFILE_TAR_RE.test(src);
18892
+ if (!isUrl && !isTar) {
18893
+ findings.push({
18894
+ rule: "add-vs-copy",
18895
+ severity: "info",
18896
+ line: inst.line,
18897
+ message: `ADD ${src} copies a local file/directory, not a URL or an auto-extracting archive. Use COPY instead, since ADD's extra behavior (remote fetch, tar auto-extract) doesn't apply here.`
18898
+ });
18899
+ }
18900
+ }
18901
+ }
18902
+ return { findings, stages };
18903
+ }
18636
18904
  function removeJsComments(code) {
18637
18905
  let result = "";
18638
18906
  let i = 0;
package/dist/index.d.cts CHANGED
@@ -1,14 +1,14 @@
1
1
  export { j as json } from './json-Ca6gZCNB.cjs';
2
2
  export { e as encoding } from './encoding-Dk3wpmb3.cjs';
3
3
  export { h as hashing } from './hashing-CJjlvqS_.cjs';
4
- export { t as text } from './text-CNn3whZA.cjs';
4
+ export { t as text } from './text-xY5MJwr0.cjs';
5
5
  export { d as data } from './data-DIyBrJ6l.cjs';
6
6
  export { g as generators } from './generators-DAXXrMvG.cjs';
7
- export { t as time } from './time-KqJjdqII.cjs';
8
- export { u as units } from './units-D7YRRwei.cjs';
7
+ export { t as time } from './time-VMAy_SrV.cjs';
8
+ export { u as units } from './units-DwIvTP-X.cjs';
9
9
  export { n as network } from './network-ylRtLPEs.cjs';
10
10
  export { a as api } from './api-CQnIUrVB.cjs';
11
- export { c as code } from './code-COUhffgE.cjs';
11
+ export { c as code } from './code-mkKV7BQ4.cjs';
12
12
  export { c as color } from './color-tPwZCr9H.cjs';
13
13
  export { c as css } from './css-Cf7AMGM-.cjs';
14
14
  export { m as misc } from './misc-CA3N198T.cjs';
package/dist/index.d.ts CHANGED
@@ -1,14 +1,14 @@
1
1
  export { j as json } from './json-Ca6gZCNB.js';
2
2
  export { e as encoding } from './encoding-Dk3wpmb3.js';
3
3
  export { h as hashing } from './hashing-CJjlvqS_.js';
4
- export { t as text } from './text-CNn3whZA.js';
4
+ export { t as text } from './text-xY5MJwr0.js';
5
5
  export { d as data } from './data-DIyBrJ6l.js';
6
6
  export { g as generators } from './generators-DAXXrMvG.js';
7
- export { t as time } from './time-KqJjdqII.js';
8
- export { u as units } from './units-D7YRRwei.js';
7
+ export { t as time } from './time-VMAy_SrV.js';
8
+ export { u as units } from './units-DwIvTP-X.js';
9
9
  export { n as network } from './network-ylRtLPEs.js';
10
10
  export { a as api } from './api-CQnIUrVB.js';
11
- export { c as code } from './code-COUhffgE.js';
11
+ export { c as code } from './code-mkKV7BQ4.js';
12
12
  export { c as color } from './color-tPwZCr9H.js';
13
13
  export { c as css } from './css-Cf7AMGM-.js';
14
14
  export { m as misc } from './misc-CA3N198T.js';
package/dist/index.js CHANGED
@@ -1,8 +1,8 @@
1
1
  export { media_exports as media } from './chunk-ZWFZRDQ4.js';
2
- export { units_exports as units } from './chunk-OFLNVDNX.js';
2
+ export { units_exports as units } from './chunk-BCISWFVJ.js';
3
3
  export { network_exports as network } from './chunk-SW3J5CAI.js';
4
4
  export { api_exports as api } from './chunk-U2HREMZU.js';
5
- export { code_exports as code } from './chunk-KXUHXQFO.js';
5
+ export { code_exports as code } from './chunk-RMXZMYSG.js';
6
6
  export { color_exports as color } from './chunk-BPVAB4P2.js';
7
7
  export { css_exports as css } from './chunk-6YPV2AB5.js';
8
8
  export { misc_exports as misc } from './chunk-GX7H6TAX.js';
@@ -10,10 +10,10 @@ export { ai_agent_exports as ai_agent } from './chunk-5VVC7BHS.js';
10
10
  export { json_exports as json } from './chunk-WUOZHCIC.js';
11
11
  export { encoding_exports as encoding } from './chunk-DOWQZUTP.js';
12
12
  export { hashing_exports as hashing } from './chunk-PET2CGTH.js';
13
- export { text_exports as text } from './chunk-QVOK3BXM.js';
13
+ export { text_exports as text } from './chunk-FB6CCFR5.js';
14
14
  export { data_exports as data } from './chunk-XOUS3M5Z.js';
15
15
  export { generators_exports as generators } from './chunk-422ICOZX.js';
16
- export { time_exports as time } from './chunk-IEPWZERQ.js';
16
+ export { time_exports as time } from './chunk-6EJVNQSY.js';
17
17
  import './chunk-MLKGABMK.js';
18
18
 
19
19
  // src/index.ts
@@ -25,6 +25,7 @@
25
25
  * - sentence-length-distribution: analyzeSentenceLengths
26
26
  * - keyword-density-analyzer: analyzeKeywordDensity
27
27
  * - emoji-lookup : searchEmoji, getEmojiByShortcode, getEmojiByChar, getEmojiByCategory, getEmojiCategories, EMOJI_TABLE
28
+ * - em-dash-usage-checker: checkDashUsage
28
29
  */
29
30
  interface WordCountResult {
30
31
  words: number;
@@ -456,6 +457,33 @@ interface OxfordCommaResult {
456
457
  * be counted as part of a list.
457
458
  */
458
459
  declare function checkOxfordCommaConsistency(text: string): OxfordCommaResult;
460
+ type DashIssueType = 'spaced-hyphen' | 'double-hyphen' | 'inconsistent-em-dash-spacing';
461
+ interface DashIssue {
462
+ type: DashIssueType;
463
+ index: number;
464
+ context: string;
465
+ message: string;
466
+ }
467
+ interface DashUsageResult {
468
+ emDashCount: number;
469
+ enDashCount: number;
470
+ hyphenCount: number;
471
+ doubleHyphenCount: number;
472
+ spacedHyphenCount: number;
473
+ emDashSpacingConsistent: boolean;
474
+ dominantEmDashStyle: 'spaced' | 'unspaced' | 'none';
475
+ issues: DashIssue[];
476
+ }
477
+ /**
478
+ * Scan text for likely dash misuse: a hyphen surrounded by spaces where an
479
+ * em dash is probably intended ("word - word"), a double hyphen ("--")
480
+ * left unconverted from a plain-ASCII source, and inconsistent spacing
481
+ * around em dashes across the same document (mixing "word — word" and
482
+ * "word—word"). Pure regex heuristic over the raw characters; it doesn't
483
+ * parse grammar, so a legitimately hyphenated range or a code sample
484
+ * pasted alongside prose can occasionally be flagged.
485
+ */
486
+ declare function checkDashUsage(text: string): DashUsageResult;
459
487
 
460
488
  type text_AsciiFont = AsciiFont;
461
489
  type text_AsciiOptions = AsciiOptions;
@@ -463,6 +491,9 @@ declare const text_CASE_FORMATS: typeof CASE_FORMATS;
463
491
  type text_CaseFormat = CaseFormat;
464
492
  type text_ConvertOptions = ConvertOptions;
465
493
  declare const text_DEFAULT_CONVERT_OPTIONS: typeof DEFAULT_CONVERT_OPTIONS;
494
+ type text_DashIssue = DashIssue;
495
+ type text_DashIssueType = DashIssueType;
496
+ type text_DashUsageResult = DashUsageResult;
466
497
  type text_DiffFile = DiffFile;
467
498
  type text_DiffHunk = DiffHunk;
468
499
  type text_DiffLine = DiffLine;
@@ -513,6 +544,7 @@ declare const text_applyOp: typeof applyOp;
513
544
  declare const text_applyOps: typeof applyOps;
514
545
  declare const text_calculateStringDistance: typeof calculateStringDistance;
515
546
  declare const text_centerText: typeof centerText;
547
+ declare const text_checkDashUsage: typeof checkDashUsage;
516
548
  declare const text_checkOxfordCommaConsistency: typeof checkOxfordCommaConsistency;
517
549
  declare const text_convertAll: typeof convertAll;
518
550
  declare const text_convertCase: typeof convertCase;
@@ -568,7 +600,7 @@ declare const text_textToMorse: typeof textToMorse;
568
600
  declare const text_unescapeString: typeof unescapeString;
569
601
  declare const text_wordFrequency: typeof wordFrequency;
570
602
  declare namespace text {
571
- 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, type text_KeywordDensityEntry as KeywordDensityEntry, type text_KeywordDensityOptions as KeywordDensityOptions, type text_KeywordDensityResult as KeywordDensityResult, 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_OxfordCommaInstance as OxfordCommaInstance, type text_OxfordCommaResult as OxfordCommaResult, 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, type text_WordyPhraseMatch as WordyPhraseMatch, type text_WordyPhraseResult as WordyPhraseResult, text_addBorder as addBorder, text_analyzeKeywordDensity as analyzeKeywordDensity, 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_checkOxfordCommaConsistency as checkOxfordCommaConsistency, 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_detectWordyPhrases as detectWordyPhrases, 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 };
603
+ 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_DashIssue as DashIssue, type text_DashIssueType as DashIssueType, type text_DashUsageResult as DashUsageResult, 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, type text_KeywordDensityEntry as KeywordDensityEntry, type text_KeywordDensityOptions as KeywordDensityOptions, type text_KeywordDensityResult as KeywordDensityResult, 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_OxfordCommaInstance as OxfordCommaInstance, type text_OxfordCommaResult as OxfordCommaResult, 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, type text_WordyPhraseMatch as WordyPhraseMatch, type text_WordyPhraseResult as WordyPhraseResult, text_addBorder as addBorder, text_analyzeKeywordDensity as analyzeKeywordDensity, 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_checkDashUsage as checkDashUsage, text_checkOxfordCommaConsistency as checkOxfordCommaConsistency, 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_detectWordyPhrases as detectWordyPhrases, 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 };
572
604
  }
573
605
 
574
- export { applyOp as $, type AsciiFont as A, type PassiveVoiceSentence as B, CASE_FORMATS as C, DEFAULT_CONVERT_OPTIONS as D, EMOJI_TABLE as E, type FillerCategory as F, type ReadabilityScore as G, type SentenceLengthDistribution as H, type SlugSeparator as I, type StringDistanceMode as J, type KeywordDensityEntry as K, LINE_OPS as L, MORSE_CODE as M, type StringDistanceResult as N, type OxfordCommaInstance as O, type ParsedDiff as P, type TextAnalysis as Q, type ReadabilityResult as R, type SentenceLengthBucket as S, type TableOptions as T, type WordyPhraseMatch as U, type WordyPhraseResult as V, type WordCountResult as W, addBorder as X, analyzeKeywordDensity as Y, analyzeSentenceLengths as Z, analyzeText as _, type AsciiOptions as a, applyOps as a0, calculateStringDistance as a1, centerText as a2, checkOxfordCommaConsistency as a3, convertAll as a4, convertCase as a5, countWords as a6, csvToHtml as a7, csvToMarkdown as a8, detectDelimiter as a9, markdownToHtml as aA, morseToText as aB, numberToOrdinal as aC, numberToRoman as aD, numberToWords as aE, ordinalWords as aF, parseDiff as aG, parseTableData as aH, readabilityScore as aI, renderMarkdown as aJ, romanToNumber as aK, scoreReadability as aL, searchEmoji as aM, sentenceCount as aN, slugify as aO, slugifyAll as aP, syllableCount as aQ, textToAscii as aR, textToMorse as aS, unescapeString as aT, wordFrequency as aU, detectFillerWords as aa, detectPassiveVoice as ab, detectWordyPhrases as ac, diffLines as ad, diffLinesSimple as ae, diffStats as af, escapeAll as ag, escapeString as ah, extractHeadings as ai, formatReadingTime as aj, generate as ak, generateDiff as al, generateHtmlTable as am, generateMarkdownTable as an, generateParagraphs as ao, generateSentences as ap, generateWords as aq, getAvailableFonts as ar, getEmojiByCategory as as, getEmojiByChar as at, getEmojiByShortcode as au, getEmojiCategories as av, getMorseForChar as aw, getMorseTiming as ax, htmlToMarkdown as ay, isValidMorse 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 KeywordDensityOptions as o, type KeywordDensityResult as p, type LineOp as q, type LineType as r, type LoremUnit as s, text as t, type MarkdownResult as u, type MorseOptions as v, type OxfordCommaResult as w, type ParsedTable as x, type PassiveVoiceMatch as y, type PassiveVoiceResult as z };
606
+ export { analyzeKeywordDensity as $, type AsciiFont as A, type ParsedTable as B, CASE_FORMATS as C, DEFAULT_CONVERT_OPTIONS as D, EMOJI_TABLE as E, type FillerCategory as F, type PassiveVoiceMatch as G, type PassiveVoiceResult as H, type PassiveVoiceSentence as I, type ReadabilityScore as J, type KeywordDensityEntry as K, LINE_OPS as L, MORSE_CODE as M, type SentenceLengthDistribution as N, type OxfordCommaInstance as O, type ParsedDiff as P, type SlugSeparator as Q, type ReadabilityResult as R, type SentenceLengthBucket as S, type StringDistanceMode as T, type StringDistanceResult as U, type TableOptions as V, type TextAnalysis as W, type WordCountResult as X, type WordyPhraseMatch as Y, type WordyPhraseResult as Z, addBorder as _, type AsciiOptions as a, analyzeSentenceLengths as a0, analyzeText as a1, applyOp as a2, applyOps as a3, calculateStringDistance as a4, centerText as a5, checkDashUsage as a6, checkOxfordCommaConsistency as a7, convertAll as a8, convertCase as a9, getMorseForChar as aA, getMorseTiming as aB, htmlToMarkdown as aC, isValidMorse as aD, markdownToHtml as aE, morseToText as aF, numberToOrdinal as aG, numberToRoman as aH, numberToWords as aI, ordinalWords as aJ, parseDiff as aK, parseTableData as aL, readabilityScore as aM, renderMarkdown as aN, romanToNumber as aO, scoreReadability as aP, searchEmoji as aQ, sentenceCount as aR, slugify as aS, slugifyAll as aT, syllableCount as aU, textToAscii as aV, textToMorse as aW, unescapeString as aX, wordFrequency as aY, countWords as aa, csvToHtml as ab, csvToMarkdown as ac, detectDelimiter as ad, detectFillerWords as ae, detectPassiveVoice as af, detectWordyPhrases as ag, diffLines as ah, diffLinesSimple as ai, diffStats as aj, escapeAll as ak, escapeString as al, extractHeadings as am, formatReadingTime as an, generate as ao, generateDiff as ap, generateHtmlTable as aq, generateMarkdownTable as ar, generateParagraphs as as, generateSentences as at, generateWords as au, getAvailableFonts as av, getEmojiByCategory as aw, getEmojiByChar as ax, getEmojiByShortcode as ay, getEmojiCategories as az, type CaseFormat as b, type ConvertOptions as c, type DashIssue as d, type DashIssueType as e, type DashUsageResult as f, type DiffFile as g, type DiffHunk as h, type DiffLine as i, type DiffResult as j, type DiffType as k, type DiffViewerLine as l, ESCAPE_MODES as m, type EmojiEntry as n, type EscapeMode as o, type FillerMatch as p, type FillerWordResult as q, type KeywordDensityOptions as r, type KeywordDensityResult as s, text as t, type LineOp as u, type LineType as v, type LoremUnit as w, type MarkdownResult as x, type MorseOptions as y, type OxfordCommaResult as z };
@@ -25,6 +25,7 @@
25
25
  * - sentence-length-distribution: analyzeSentenceLengths
26
26
  * - keyword-density-analyzer: analyzeKeywordDensity
27
27
  * - emoji-lookup : searchEmoji, getEmojiByShortcode, getEmojiByChar, getEmojiByCategory, getEmojiCategories, EMOJI_TABLE
28
+ * - em-dash-usage-checker: checkDashUsage
28
29
  */
29
30
  interface WordCountResult {
30
31
  words: number;
@@ -456,6 +457,33 @@ interface OxfordCommaResult {
456
457
  * be counted as part of a list.
457
458
  */
458
459
  declare function checkOxfordCommaConsistency(text: string): OxfordCommaResult;
460
+ type DashIssueType = 'spaced-hyphen' | 'double-hyphen' | 'inconsistent-em-dash-spacing';
461
+ interface DashIssue {
462
+ type: DashIssueType;
463
+ index: number;
464
+ context: string;
465
+ message: string;
466
+ }
467
+ interface DashUsageResult {
468
+ emDashCount: number;
469
+ enDashCount: number;
470
+ hyphenCount: number;
471
+ doubleHyphenCount: number;
472
+ spacedHyphenCount: number;
473
+ emDashSpacingConsistent: boolean;
474
+ dominantEmDashStyle: 'spaced' | 'unspaced' | 'none';
475
+ issues: DashIssue[];
476
+ }
477
+ /**
478
+ * Scan text for likely dash misuse: a hyphen surrounded by spaces where an
479
+ * em dash is probably intended ("word - word"), a double hyphen ("--")
480
+ * left unconverted from a plain-ASCII source, and inconsistent spacing
481
+ * around em dashes across the same document (mixing "word — word" and
482
+ * "word—word"). Pure regex heuristic over the raw characters; it doesn't
483
+ * parse grammar, so a legitimately hyphenated range or a code sample
484
+ * pasted alongside prose can occasionally be flagged.
485
+ */
486
+ declare function checkDashUsage(text: string): DashUsageResult;
459
487
 
460
488
  type text_AsciiFont = AsciiFont;
461
489
  type text_AsciiOptions = AsciiOptions;
@@ -463,6 +491,9 @@ declare const text_CASE_FORMATS: typeof CASE_FORMATS;
463
491
  type text_CaseFormat = CaseFormat;
464
492
  type text_ConvertOptions = ConvertOptions;
465
493
  declare const text_DEFAULT_CONVERT_OPTIONS: typeof DEFAULT_CONVERT_OPTIONS;
494
+ type text_DashIssue = DashIssue;
495
+ type text_DashIssueType = DashIssueType;
496
+ type text_DashUsageResult = DashUsageResult;
466
497
  type text_DiffFile = DiffFile;
467
498
  type text_DiffHunk = DiffHunk;
468
499
  type text_DiffLine = DiffLine;
@@ -513,6 +544,7 @@ declare const text_applyOp: typeof applyOp;
513
544
  declare const text_applyOps: typeof applyOps;
514
545
  declare const text_calculateStringDistance: typeof calculateStringDistance;
515
546
  declare const text_centerText: typeof centerText;
547
+ declare const text_checkDashUsage: typeof checkDashUsage;
516
548
  declare const text_checkOxfordCommaConsistency: typeof checkOxfordCommaConsistency;
517
549
  declare const text_convertAll: typeof convertAll;
518
550
  declare const text_convertCase: typeof convertCase;
@@ -568,7 +600,7 @@ declare const text_textToMorse: typeof textToMorse;
568
600
  declare const text_unescapeString: typeof unescapeString;
569
601
  declare const text_wordFrequency: typeof wordFrequency;
570
602
  declare namespace text {
571
- 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, type text_KeywordDensityEntry as KeywordDensityEntry, type text_KeywordDensityOptions as KeywordDensityOptions, type text_KeywordDensityResult as KeywordDensityResult, 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_OxfordCommaInstance as OxfordCommaInstance, type text_OxfordCommaResult as OxfordCommaResult, 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, type text_WordyPhraseMatch as WordyPhraseMatch, type text_WordyPhraseResult as WordyPhraseResult, text_addBorder as addBorder, text_analyzeKeywordDensity as analyzeKeywordDensity, 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_checkOxfordCommaConsistency as checkOxfordCommaConsistency, 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_detectWordyPhrases as detectWordyPhrases, 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 };
603
+ 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_DashIssue as DashIssue, type text_DashIssueType as DashIssueType, type text_DashUsageResult as DashUsageResult, 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, type text_KeywordDensityEntry as KeywordDensityEntry, type text_KeywordDensityOptions as KeywordDensityOptions, type text_KeywordDensityResult as KeywordDensityResult, 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_OxfordCommaInstance as OxfordCommaInstance, type text_OxfordCommaResult as OxfordCommaResult, 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, type text_WordyPhraseMatch as WordyPhraseMatch, type text_WordyPhraseResult as WordyPhraseResult, text_addBorder as addBorder, text_analyzeKeywordDensity as analyzeKeywordDensity, 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_checkDashUsage as checkDashUsage, text_checkOxfordCommaConsistency as checkOxfordCommaConsistency, 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_detectWordyPhrases as detectWordyPhrases, 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 };
572
604
  }
573
605
 
574
- export { applyOp as $, type AsciiFont as A, type PassiveVoiceSentence as B, CASE_FORMATS as C, DEFAULT_CONVERT_OPTIONS as D, EMOJI_TABLE as E, type FillerCategory as F, type ReadabilityScore as G, type SentenceLengthDistribution as H, type SlugSeparator as I, type StringDistanceMode as J, type KeywordDensityEntry as K, LINE_OPS as L, MORSE_CODE as M, type StringDistanceResult as N, type OxfordCommaInstance as O, type ParsedDiff as P, type TextAnalysis as Q, type ReadabilityResult as R, type SentenceLengthBucket as S, type TableOptions as T, type WordyPhraseMatch as U, type WordyPhraseResult as V, type WordCountResult as W, addBorder as X, analyzeKeywordDensity as Y, analyzeSentenceLengths as Z, analyzeText as _, type AsciiOptions as a, applyOps as a0, calculateStringDistance as a1, centerText as a2, checkOxfordCommaConsistency as a3, convertAll as a4, convertCase as a5, countWords as a6, csvToHtml as a7, csvToMarkdown as a8, detectDelimiter as a9, markdownToHtml as aA, morseToText as aB, numberToOrdinal as aC, numberToRoman as aD, numberToWords as aE, ordinalWords as aF, parseDiff as aG, parseTableData as aH, readabilityScore as aI, renderMarkdown as aJ, romanToNumber as aK, scoreReadability as aL, searchEmoji as aM, sentenceCount as aN, slugify as aO, slugifyAll as aP, syllableCount as aQ, textToAscii as aR, textToMorse as aS, unescapeString as aT, wordFrequency as aU, detectFillerWords as aa, detectPassiveVoice as ab, detectWordyPhrases as ac, diffLines as ad, diffLinesSimple as ae, diffStats as af, escapeAll as ag, escapeString as ah, extractHeadings as ai, formatReadingTime as aj, generate as ak, generateDiff as al, generateHtmlTable as am, generateMarkdownTable as an, generateParagraphs as ao, generateSentences as ap, generateWords as aq, getAvailableFonts as ar, getEmojiByCategory as as, getEmojiByChar as at, getEmojiByShortcode as au, getEmojiCategories as av, getMorseForChar as aw, getMorseTiming as ax, htmlToMarkdown as ay, isValidMorse 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 KeywordDensityOptions as o, type KeywordDensityResult as p, type LineOp as q, type LineType as r, type LoremUnit as s, text as t, type MarkdownResult as u, type MorseOptions as v, type OxfordCommaResult as w, type ParsedTable as x, type PassiveVoiceMatch as y, type PassiveVoiceResult as z };
606
+ export { analyzeKeywordDensity as $, type AsciiFont as A, type ParsedTable as B, CASE_FORMATS as C, DEFAULT_CONVERT_OPTIONS as D, EMOJI_TABLE as E, type FillerCategory as F, type PassiveVoiceMatch as G, type PassiveVoiceResult as H, type PassiveVoiceSentence as I, type ReadabilityScore as J, type KeywordDensityEntry as K, LINE_OPS as L, MORSE_CODE as M, type SentenceLengthDistribution as N, type OxfordCommaInstance as O, type ParsedDiff as P, type SlugSeparator as Q, type ReadabilityResult as R, type SentenceLengthBucket as S, type StringDistanceMode as T, type StringDistanceResult as U, type TableOptions as V, type TextAnalysis as W, type WordCountResult as X, type WordyPhraseMatch as Y, type WordyPhraseResult as Z, addBorder as _, type AsciiOptions as a, analyzeSentenceLengths as a0, analyzeText as a1, applyOp as a2, applyOps as a3, calculateStringDistance as a4, centerText as a5, checkDashUsage as a6, checkOxfordCommaConsistency as a7, convertAll as a8, convertCase as a9, getMorseForChar as aA, getMorseTiming as aB, htmlToMarkdown as aC, isValidMorse as aD, markdownToHtml as aE, morseToText as aF, numberToOrdinal as aG, numberToRoman as aH, numberToWords as aI, ordinalWords as aJ, parseDiff as aK, parseTableData as aL, readabilityScore as aM, renderMarkdown as aN, romanToNumber as aO, scoreReadability as aP, searchEmoji as aQ, sentenceCount as aR, slugify as aS, slugifyAll as aT, syllableCount as aU, textToAscii as aV, textToMorse as aW, unescapeString as aX, wordFrequency as aY, countWords as aa, csvToHtml as ab, csvToMarkdown as ac, detectDelimiter as ad, detectFillerWords as ae, detectPassiveVoice as af, detectWordyPhrases as ag, diffLines as ah, diffLinesSimple as ai, diffStats as aj, escapeAll as ak, escapeString as al, extractHeadings as am, formatReadingTime as an, generate as ao, generateDiff as ap, generateHtmlTable as aq, generateMarkdownTable as ar, generateParagraphs as as, generateSentences as at, generateWords as au, getAvailableFonts as av, getEmojiByCategory as aw, getEmojiByChar as ax, getEmojiByShortcode as ay, getEmojiCategories as az, type CaseFormat as b, type ConvertOptions as c, type DashIssue as d, type DashIssueType as e, type DashUsageResult as f, type DiffFile as g, type DiffHunk as h, type DiffLine as i, type DiffResult as j, type DiffType as k, type DiffViewerLine as l, ESCAPE_MODES as m, type EmojiEntry as n, type EscapeMode as o, type FillerMatch as p, type FillerWordResult as q, type KeywordDensityOptions as r, type KeywordDensityResult as s, text as t, type LineOp as u, type LineType as v, type LoremUnit as w, type MarkdownResult as x, type MorseOptions as y, type OxfordCommaResult as z };
@@ -6,6 +6,7 @@
6
6
  * - date-diff : parseDate, humanizeDiff, diffDates, COMMON_DATE_PRESETS
7
7
  * - timezone : TIMEZONES, getTimezoneOffset, convertTime, formatInTimezone, getAllZonesForTime
8
8
  * - cron-next : parseCronExpression, getNextRuns, formatRunDate, getRunInterval
9
+ * - cron-overlap-detector : findCronOverlaps
9
10
  * - iso8601-duration : parseIso8601Duration, formatIso8601Duration
10
11
  */
11
12
  interface TimestampResult {
@@ -112,6 +113,22 @@ declare function getNextRuns(expr: string, count?: number, fromDate?: Date): Dat
112
113
  };
113
114
  declare function formatRunDate(date: Date, timezone?: string): string;
114
115
  declare function getRunInterval(dates: Date[]): string;
116
+ interface CronOverlap {
117
+ date: Date;
118
+ expressionIndexes: number[];
119
+ }
120
+ interface CronOverlapResult {
121
+ overlaps: CronOverlap[];
122
+ windowDays: number;
123
+ truncated: boolean;
124
+ }
125
+ /**
126
+ * Walk minute-by-minute over `windowDays` and flag every minute where two or
127
+ * more of the given 5-field cron expressions fire at once.
128
+ */
129
+ declare function findCronOverlaps(expressions: string[], windowDays?: number, fromDate?: Date): CronOverlapResult | {
130
+ error: string;
131
+ };
115
132
  interface DurationParseResult {
116
133
  input: string;
117
134
  years: number;
@@ -158,6 +175,8 @@ declare const time_COMMON_CRONS: typeof COMMON_CRONS;
158
175
  declare const time_COMMON_DATE_PRESETS: typeof COMMON_DATE_PRESETS;
159
176
  type time_CronField = CronField;
160
177
  type time_CronNextField = CronNextField;
178
+ type time_CronOverlap = CronOverlap;
179
+ type time_CronOverlapResult = CronOverlapResult;
161
180
  type time_CronResult = CronResult;
162
181
  type time_DateDiffResult = DateDiffResult;
163
182
  type time_DurationFormatResult = DurationFormatResult;
@@ -168,6 +187,7 @@ type time_TimestampResult = TimestampResult;
168
187
  type time_TimezoneEntry = TimezoneEntry;
169
188
  declare const time_convertTime: typeof convertTime;
170
189
  declare const time_diffDates: typeof diffDates;
190
+ declare const time_findCronOverlaps: typeof findCronOverlaps;
171
191
  declare const time_formatInTimezone: typeof formatInTimezone;
172
192
  declare const time_formatIso8601Duration: typeof formatIso8601Duration;
173
193
  declare const time_formatRelative: typeof formatRelative;
@@ -185,7 +205,7 @@ declare const time_parseCronExpression: typeof parseCronExpression;
185
205
  declare const time_parseDate: typeof parseDate;
186
206
  declare const time_parseIso8601Duration: typeof parseIso8601Duration;
187
207
  declare namespace time {
188
- export { time_COMMON_CRONS as COMMON_CRONS, time_COMMON_DATE_PRESETS as COMMON_DATE_PRESETS, type time_CronField as CronField, type time_CronNextField as CronNextField, type time_CronResult as CronResult, type time_DateDiffResult as DateDiffResult, type time_DurationFormatResult as DurationFormatResult, type time_DurationParseResult as DurationParseResult, type time_ParsedCron as ParsedCron, time_TIMEZONES as TIMEZONES, type time_TimestampResult as TimestampResult, type time_TimezoneEntry as TimezoneEntry, time_convertTime as convertTime, time_diffDates as diffDates, time_formatInTimezone as formatInTimezone, time_formatIso8601Duration as formatIso8601Duration, time_formatRelative as formatRelative, time_formatRunDate as formatRunDate, time_fromIsoString as fromIsoString, time_fromUnix as fromUnix, time_getAllZonesForTime as getAllZonesForTime, time_getNextRuns as getNextRuns, time_getNow as getNow, time_getRunInterval as getRunInterval, time_getTimezoneOffset as getTimezoneOffset, time_humanizeDiff as humanizeDiff, time_parseCron as parseCron, time_parseCronExpression as parseCronExpression, time_parseDate as parseDate, time_parseIso8601Duration as parseIso8601Duration };
208
+ export { time_COMMON_CRONS as COMMON_CRONS, time_COMMON_DATE_PRESETS as COMMON_DATE_PRESETS, type time_CronField as CronField, type time_CronNextField as CronNextField, type time_CronOverlap as CronOverlap, type time_CronOverlapResult as CronOverlapResult, type time_CronResult as CronResult, type time_DateDiffResult as DateDiffResult, type time_DurationFormatResult as DurationFormatResult, type time_DurationParseResult as DurationParseResult, type time_ParsedCron as ParsedCron, time_TIMEZONES as TIMEZONES, type time_TimestampResult as TimestampResult, type time_TimezoneEntry as TimezoneEntry, time_convertTime as convertTime, time_diffDates as diffDates, time_findCronOverlaps as findCronOverlaps, time_formatInTimezone as formatInTimezone, time_formatIso8601Duration as formatIso8601Duration, time_formatRelative as formatRelative, time_formatRunDate as formatRunDate, time_fromIsoString as fromIsoString, time_fromUnix as fromUnix, time_getAllZonesForTime as getAllZonesForTime, time_getNextRuns as getNextRuns, time_getNow as getNow, time_getRunInterval as getRunInterval, time_getTimezoneOffset as getTimezoneOffset, time_humanizeDiff as humanizeDiff, time_parseCron as parseCron, time_parseCronExpression as parseCronExpression, time_parseDate as parseDate, time_parseIso8601Duration as parseIso8601Duration };
189
209
  }
190
210
 
191
- export { parseIso8601Duration as A, COMMON_CRONS as C, type DateDiffResult as D, type ParsedCron as P, TIMEZONES as T, COMMON_DATE_PRESETS as a, type CronField as b, type CronNextField as c, type CronResult as d, type DurationFormatResult as e, type DurationParseResult as f, type TimestampResult as g, type TimezoneEntry as h, convertTime as i, diffDates as j, formatInTimezone as k, formatIso8601Duration as l, formatRelative as m, formatRunDate as n, fromIsoString as o, fromUnix as p, getAllZonesForTime as q, getNextRuns as r, getNow as s, time as t, getRunInterval as u, getTimezoneOffset as v, humanizeDiff as w, parseCron as x, parseCronExpression as y, parseDate as z };
211
+ export { parseCron as A, parseCronExpression as B, COMMON_CRONS as C, type DateDiffResult as D, parseDate as E, parseIso8601Duration as F, type ParsedCron as P, TIMEZONES as T, COMMON_DATE_PRESETS as a, type CronField as b, type CronNextField as c, type CronOverlap as d, type CronOverlapResult as e, type CronResult as f, type DurationFormatResult as g, type DurationParseResult as h, type TimestampResult as i, type TimezoneEntry as j, convertTime as k, diffDates as l, findCronOverlaps as m, formatInTimezone as n, formatIso8601Duration as o, formatRelative as p, formatRunDate as q, fromIsoString as r, fromUnix as s, time as t, getAllZonesForTime as u, getNextRuns as v, getNow as w, getRunInterval as x, getTimezoneOffset as y, humanizeDiff as z };