@utilix-tech/sdk 0.96.0 → 0.98.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 +19 -1
- package/dist/{chunk-YQJ7CEUL.js → chunk-2YWKRNDM.js} +58 -1
- package/dist/{chunk-WUOZHCIC.js → chunk-PAMHORKV.js} +167 -1
- package/dist/{chunk-4EFSPTRH.js → chunk-X7IZ2OXW.js} +148 -1
- package/dist/index.cjs +370 -0
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +3 -3
- package/dist/{json-Ca6gZCNB.d.ts → json-BtRszk1w.d.cts} +28 -2
- package/dist/{json-Ca6gZCNB.d.cts → json-BtRszk1w.d.ts} +28 -2
- package/dist/{text-DOopHoK3.d.cts → text-DFCNpyvH.d.cts} +26 -2
- package/dist/{text-DOopHoK3.d.ts → text-DFCNpyvH.d.ts} +26 -2
- package/dist/tools/json.cjs +166 -0
- package/dist/tools/json.d.cts +1 -1
- package/dist/tools/json.d.ts +1 -1
- package/dist/tools/json.js +1 -1
- package/dist/tools/text.cjs +57 -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 +147 -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-CG7wn_qJ.d.ts → units-CGTx1S6B.d.cts} +74 -2
- package/dist/{units-CG7wn_qJ.d.cts → units-CGTx1S6B.d.ts} +74 -2
- package/package.json +2 -2
|
@@ -27,6 +27,7 @@
|
|
|
27
27
|
* - emoji-lookup : searchEmoji, getEmojiByShortcode, getEmojiByChar, getEmojiByCategory, getEmojiCategories, EMOJI_TABLE
|
|
28
28
|
* - em-dash-usage-checker: checkDashUsage
|
|
29
29
|
* - acronym-expansion-checker: checkAcronymExpansion
|
|
30
|
+
* - weasel-word-detector: detectWeaselWords
|
|
30
31
|
*/
|
|
31
32
|
interface WordCountResult {
|
|
32
33
|
words: number;
|
|
@@ -517,6 +518,26 @@ interface AcronymCheckResult {
|
|
|
517
518
|
* like "APIs" can be missed or misread.
|
|
518
519
|
*/
|
|
519
520
|
declare function checkAcronymExpansion(text: string): AcronymCheckResult;
|
|
521
|
+
interface WeaselWordMatch {
|
|
522
|
+
phrase: string;
|
|
523
|
+
count: number;
|
|
524
|
+
indices: number[];
|
|
525
|
+
}
|
|
526
|
+
interface WeaselWordResult {
|
|
527
|
+
totalWords: number;
|
|
528
|
+
totalMatches: number;
|
|
529
|
+
density: number;
|
|
530
|
+
matches: WeaselWordMatch[];
|
|
531
|
+
}
|
|
532
|
+
/**
|
|
533
|
+
* Scan text for weasel words: vague hedging phrases that imply evidence
|
|
534
|
+
* or consensus without naming a checkable source ("studies show", "many
|
|
535
|
+
* experts believe", "it is widely known"). Dictionary-based heuristic
|
|
536
|
+
* over a curated phrase list, same shape as detectFillerWords: a flagged
|
|
537
|
+
* phrase is a candidate to replace with a named source or cut, not
|
|
538
|
+
* always wrong in context.
|
|
539
|
+
*/
|
|
540
|
+
declare function detectWeaselWords(text: string): WeaselWordResult;
|
|
520
541
|
|
|
521
542
|
type text_AcronymCheckResult = AcronymCheckResult;
|
|
522
543
|
type text_AcronymIssue = AcronymIssue;
|
|
@@ -570,6 +591,8 @@ type text_StringDistanceMode = StringDistanceMode;
|
|
|
570
591
|
type text_StringDistanceResult = StringDistanceResult;
|
|
571
592
|
type text_TableOptions = TableOptions;
|
|
572
593
|
type text_TextAnalysis = TextAnalysis;
|
|
594
|
+
type text_WeaselWordMatch = WeaselWordMatch;
|
|
595
|
+
type text_WeaselWordResult = WeaselWordResult;
|
|
573
596
|
type text_WordCountResult = WordCountResult;
|
|
574
597
|
type text_WordyPhraseMatch = WordyPhraseMatch;
|
|
575
598
|
type text_WordyPhraseResult = WordyPhraseResult;
|
|
@@ -592,6 +615,7 @@ declare const text_csvToMarkdown: typeof csvToMarkdown;
|
|
|
592
615
|
declare const text_detectDelimiter: typeof detectDelimiter;
|
|
593
616
|
declare const text_detectFillerWords: typeof detectFillerWords;
|
|
594
617
|
declare const text_detectPassiveVoice: typeof detectPassiveVoice;
|
|
618
|
+
declare const text_detectWeaselWords: typeof detectWeaselWords;
|
|
595
619
|
declare const text_detectWordyPhrases: typeof detectWordyPhrases;
|
|
596
620
|
declare const text_diffLines: typeof diffLines;
|
|
597
621
|
declare const text_diffLinesSimple: typeof diffLinesSimple;
|
|
@@ -638,7 +662,7 @@ declare const text_textToMorse: typeof textToMorse;
|
|
|
638
662
|
declare const text_unescapeString: typeof unescapeString;
|
|
639
663
|
declare const text_wordFrequency: typeof wordFrequency;
|
|
640
664
|
declare namespace text {
|
|
641
|
-
export { type text_AcronymCheckResult as AcronymCheckResult, type text_AcronymIssue as AcronymIssue, type text_AcronymIssueType as AcronymIssueType, type text_AcronymUsage as AcronymUsage, 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_checkAcronymExpansion as checkAcronymExpansion, 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 };
|
|
665
|
+
export { type text_AcronymCheckResult as AcronymCheckResult, type text_AcronymIssue as AcronymIssue, type text_AcronymIssueType as AcronymIssueType, type text_AcronymUsage as AcronymUsage, 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_WeaselWordMatch as WeaselWordMatch, type text_WeaselWordResult as WeaselWordResult, 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_checkAcronymExpansion as checkAcronymExpansion, 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_detectWeaselWords as detectWeaselWords, 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 };
|
|
642
666
|
}
|
|
643
667
|
|
|
644
|
-
export { type
|
|
668
|
+
export { type WeaselWordMatch as $, type AcronymCheckResult as A, type LoremUnit as B, CASE_FORMATS as C, DEFAULT_CONVERT_OPTIONS as D, EMOJI_TABLE as E, type FillerCategory as F, type MarkdownResult as G, type MorseOptions as H, type OxfordCommaResult as I, type ParsedTable as J, type KeywordDensityEntry as K, LINE_OPS as L, MORSE_CODE as M, type PassiveVoiceMatch as N, type OxfordCommaInstance as O, type ParsedDiff as P, type PassiveVoiceResult as Q, type PassiveVoiceSentence as R, type ReadabilityResult as S, type ReadabilityScore as T, type SentenceLengthBucket as U, type SentenceLengthDistribution as V, type SlugSeparator as W, type StringDistanceMode as X, type StringDistanceResult as Y, type TableOptions as Z, type TextAnalysis as _, type AcronymIssue as a, slugifyAll as a$, type WeaselWordResult as a0, type WordCountResult as a1, type WordyPhraseMatch as a2, type WordyPhraseResult as a3, addBorder as a4, analyzeKeywordDensity as a5, analyzeSentenceLengths as a6, analyzeText as a7, applyOp as a8, applyOps as a9, generateParagraphs as aA, generateSentences as aB, generateWords as aC, getAvailableFonts as aD, getEmojiByCategory as aE, getEmojiByChar as aF, getEmojiByShortcode as aG, getEmojiCategories as aH, getMorseForChar as aI, getMorseTiming as aJ, htmlToMarkdown as aK, isValidMorse as aL, markdownToHtml as aM, morseToText as aN, numberToOrdinal as aO, numberToRoman as aP, numberToWords as aQ, ordinalWords as aR, parseDiff as aS, parseTableData as aT, readabilityScore as aU, renderMarkdown as aV, romanToNumber as aW, scoreReadability as aX, searchEmoji as aY, sentenceCount as aZ, slugify as a_, calculateStringDistance as aa, centerText as ab, checkAcronymExpansion as ac, checkDashUsage as ad, checkOxfordCommaConsistency as ae, convertAll as af, convertCase as ag, countWords as ah, csvToHtml as ai, csvToMarkdown as aj, detectDelimiter as ak, detectFillerWords as al, detectPassiveVoice as am, detectWeaselWords as an, detectWordyPhrases as ao, diffLines as ap, diffLinesSimple as aq, diffStats as ar, escapeAll as as, escapeString as at, extractHeadings as au, formatReadingTime as av, generate as aw, generateDiff as ax, generateHtmlTable as ay, generateMarkdownTable as az, type AcronymIssueType as b, syllableCount as b0, textToAscii as b1, textToMorse as b2, unescapeString as b3, wordFrequency as b4, type AcronymUsage as c, type AsciiFont as d, type AsciiOptions as e, type CaseFormat as f, type ConvertOptions as g, type DashIssue as h, type DashIssueType as i, type DashUsageResult as j, type DiffFile as k, type DiffHunk as l, type DiffLine as m, type DiffResult as n, type DiffType as o, type DiffViewerLine as p, ESCAPE_MODES as q, type EmojiEntry as r, type EscapeMode as s, text as t, type FillerMatch as u, type FillerWordResult as v, type KeywordDensityOptions as w, type KeywordDensityResult as x, type LineOp as y, type LineType as z };
|
|
@@ -27,6 +27,7 @@
|
|
|
27
27
|
* - emoji-lookup : searchEmoji, getEmojiByShortcode, getEmojiByChar, getEmojiByCategory, getEmojiCategories, EMOJI_TABLE
|
|
28
28
|
* - em-dash-usage-checker: checkDashUsage
|
|
29
29
|
* - acronym-expansion-checker: checkAcronymExpansion
|
|
30
|
+
* - weasel-word-detector: detectWeaselWords
|
|
30
31
|
*/
|
|
31
32
|
interface WordCountResult {
|
|
32
33
|
words: number;
|
|
@@ -517,6 +518,26 @@ interface AcronymCheckResult {
|
|
|
517
518
|
* like "APIs" can be missed or misread.
|
|
518
519
|
*/
|
|
519
520
|
declare function checkAcronymExpansion(text: string): AcronymCheckResult;
|
|
521
|
+
interface WeaselWordMatch {
|
|
522
|
+
phrase: string;
|
|
523
|
+
count: number;
|
|
524
|
+
indices: number[];
|
|
525
|
+
}
|
|
526
|
+
interface WeaselWordResult {
|
|
527
|
+
totalWords: number;
|
|
528
|
+
totalMatches: number;
|
|
529
|
+
density: number;
|
|
530
|
+
matches: WeaselWordMatch[];
|
|
531
|
+
}
|
|
532
|
+
/**
|
|
533
|
+
* Scan text for weasel words: vague hedging phrases that imply evidence
|
|
534
|
+
* or consensus without naming a checkable source ("studies show", "many
|
|
535
|
+
* experts believe", "it is widely known"). Dictionary-based heuristic
|
|
536
|
+
* over a curated phrase list, same shape as detectFillerWords: a flagged
|
|
537
|
+
* phrase is a candidate to replace with a named source or cut, not
|
|
538
|
+
* always wrong in context.
|
|
539
|
+
*/
|
|
540
|
+
declare function detectWeaselWords(text: string): WeaselWordResult;
|
|
520
541
|
|
|
521
542
|
type text_AcronymCheckResult = AcronymCheckResult;
|
|
522
543
|
type text_AcronymIssue = AcronymIssue;
|
|
@@ -570,6 +591,8 @@ type text_StringDistanceMode = StringDistanceMode;
|
|
|
570
591
|
type text_StringDistanceResult = StringDistanceResult;
|
|
571
592
|
type text_TableOptions = TableOptions;
|
|
572
593
|
type text_TextAnalysis = TextAnalysis;
|
|
594
|
+
type text_WeaselWordMatch = WeaselWordMatch;
|
|
595
|
+
type text_WeaselWordResult = WeaselWordResult;
|
|
573
596
|
type text_WordCountResult = WordCountResult;
|
|
574
597
|
type text_WordyPhraseMatch = WordyPhraseMatch;
|
|
575
598
|
type text_WordyPhraseResult = WordyPhraseResult;
|
|
@@ -592,6 +615,7 @@ declare const text_csvToMarkdown: typeof csvToMarkdown;
|
|
|
592
615
|
declare const text_detectDelimiter: typeof detectDelimiter;
|
|
593
616
|
declare const text_detectFillerWords: typeof detectFillerWords;
|
|
594
617
|
declare const text_detectPassiveVoice: typeof detectPassiveVoice;
|
|
618
|
+
declare const text_detectWeaselWords: typeof detectWeaselWords;
|
|
595
619
|
declare const text_detectWordyPhrases: typeof detectWordyPhrases;
|
|
596
620
|
declare const text_diffLines: typeof diffLines;
|
|
597
621
|
declare const text_diffLinesSimple: typeof diffLinesSimple;
|
|
@@ -638,7 +662,7 @@ declare const text_textToMorse: typeof textToMorse;
|
|
|
638
662
|
declare const text_unescapeString: typeof unescapeString;
|
|
639
663
|
declare const text_wordFrequency: typeof wordFrequency;
|
|
640
664
|
declare namespace text {
|
|
641
|
-
export { type text_AcronymCheckResult as AcronymCheckResult, type text_AcronymIssue as AcronymIssue, type text_AcronymIssueType as AcronymIssueType, type text_AcronymUsage as AcronymUsage, 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_checkAcronymExpansion as checkAcronymExpansion, 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 };
|
|
665
|
+
export { type text_AcronymCheckResult as AcronymCheckResult, type text_AcronymIssue as AcronymIssue, type text_AcronymIssueType as AcronymIssueType, type text_AcronymUsage as AcronymUsage, 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_WeaselWordMatch as WeaselWordMatch, type text_WeaselWordResult as WeaselWordResult, 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_checkAcronymExpansion as checkAcronymExpansion, 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_detectWeaselWords as detectWeaselWords, 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 };
|
|
642
666
|
}
|
|
643
667
|
|
|
644
|
-
export { type
|
|
668
|
+
export { type WeaselWordMatch as $, type AcronymCheckResult as A, type LoremUnit as B, CASE_FORMATS as C, DEFAULT_CONVERT_OPTIONS as D, EMOJI_TABLE as E, type FillerCategory as F, type MarkdownResult as G, type MorseOptions as H, type OxfordCommaResult as I, type ParsedTable as J, type KeywordDensityEntry as K, LINE_OPS as L, MORSE_CODE as M, type PassiveVoiceMatch as N, type OxfordCommaInstance as O, type ParsedDiff as P, type PassiveVoiceResult as Q, type PassiveVoiceSentence as R, type ReadabilityResult as S, type ReadabilityScore as T, type SentenceLengthBucket as U, type SentenceLengthDistribution as V, type SlugSeparator as W, type StringDistanceMode as X, type StringDistanceResult as Y, type TableOptions as Z, type TextAnalysis as _, type AcronymIssue as a, slugifyAll as a$, type WeaselWordResult as a0, type WordCountResult as a1, type WordyPhraseMatch as a2, type WordyPhraseResult as a3, addBorder as a4, analyzeKeywordDensity as a5, analyzeSentenceLengths as a6, analyzeText as a7, applyOp as a8, applyOps as a9, generateParagraphs as aA, generateSentences as aB, generateWords as aC, getAvailableFonts as aD, getEmojiByCategory as aE, getEmojiByChar as aF, getEmojiByShortcode as aG, getEmojiCategories as aH, getMorseForChar as aI, getMorseTiming as aJ, htmlToMarkdown as aK, isValidMorse as aL, markdownToHtml as aM, morseToText as aN, numberToOrdinal as aO, numberToRoman as aP, numberToWords as aQ, ordinalWords as aR, parseDiff as aS, parseTableData as aT, readabilityScore as aU, renderMarkdown as aV, romanToNumber as aW, scoreReadability as aX, searchEmoji as aY, sentenceCount as aZ, slugify as a_, calculateStringDistance as aa, centerText as ab, checkAcronymExpansion as ac, checkDashUsage as ad, checkOxfordCommaConsistency as ae, convertAll as af, convertCase as ag, countWords as ah, csvToHtml as ai, csvToMarkdown as aj, detectDelimiter as ak, detectFillerWords as al, detectPassiveVoice as am, detectWeaselWords as an, detectWordyPhrases as ao, diffLines as ap, diffLinesSimple as aq, diffStats as ar, escapeAll as as, escapeString as at, extractHeadings as au, formatReadingTime as av, generate as aw, generateDiff as ax, generateHtmlTable as ay, generateMarkdownTable as az, type AcronymIssueType as b, syllableCount as b0, textToAscii as b1, textToMorse as b2, unescapeString as b3, wordFrequency as b4, type AcronymUsage as c, type AsciiFont as d, type AsciiOptions as e, type CaseFormat as f, type ConvertOptions as g, type DashIssue as h, type DashIssueType as i, type DashUsageResult as j, type DiffFile as k, type DiffHunk as l, type DiffLine as m, type DiffResult as n, type DiffType as o, type DiffViewerLine as p, ESCAPE_MODES as q, type EmojiEntry as r, type EscapeMode as s, text as t, type FillerMatch as u, type FillerWordResult as v, type KeywordDensityOptions as w, type KeywordDensityResult as x, type LineOp as y, type LineType as z };
|
package/dist/tools/json.cjs
CHANGED
|
@@ -1636,6 +1636,171 @@ function generateJsonPatch(aJson, bJson) {
|
|
|
1636
1636
|
}
|
|
1637
1637
|
return { patch: diffJsonPatch(a, b) };
|
|
1638
1638
|
}
|
|
1639
|
+
var GEOJSON_GEOMETRY_TYPES = /* @__PURE__ */ new Set([
|
|
1640
|
+
"Point",
|
|
1641
|
+
"MultiPoint",
|
|
1642
|
+
"LineString",
|
|
1643
|
+
"MultiLineString",
|
|
1644
|
+
"Polygon",
|
|
1645
|
+
"MultiPolygon",
|
|
1646
|
+
"GeometryCollection"
|
|
1647
|
+
]);
|
|
1648
|
+
function _isGeoJsonNumber(v) {
|
|
1649
|
+
return typeof v === "number" && Number.isFinite(v);
|
|
1650
|
+
}
|
|
1651
|
+
function _isGeoJsonPosition(v) {
|
|
1652
|
+
return Array.isArray(v) && (v.length === 2 || v.length === 3) && v.every(_isGeoJsonNumber);
|
|
1653
|
+
}
|
|
1654
|
+
function _geoJsonPositionsEqual(a, b) {
|
|
1655
|
+
return a.length === b.length && a.every((v, i) => v === b[i]);
|
|
1656
|
+
}
|
|
1657
|
+
function _geoJsonRingSignedArea(ring) {
|
|
1658
|
+
let sum = 0;
|
|
1659
|
+
for (let i = 0; i < ring.length - 1; i++) {
|
|
1660
|
+
const [x1, y1] = ring[i];
|
|
1661
|
+
const [x2, y2] = ring[i + 1];
|
|
1662
|
+
sum += x1 * y2 - x2 * y1;
|
|
1663
|
+
}
|
|
1664
|
+
return sum / 2;
|
|
1665
|
+
}
|
|
1666
|
+
function _validateGeoJsonPolygonCoords(coords, path, errors, warnings) {
|
|
1667
|
+
if (!Array.isArray(coords) || coords.length === 0) {
|
|
1668
|
+
errors.push({ path, message: "Polygon coordinates must be a non-empty array of linear rings" });
|
|
1669
|
+
return;
|
|
1670
|
+
}
|
|
1671
|
+
coords.forEach((ring, i) => {
|
|
1672
|
+
const ringPath = `${path}[${i}]`;
|
|
1673
|
+
if (!Array.isArray(ring) || ring.length < 4 || !ring.every(_isGeoJsonPosition)) {
|
|
1674
|
+
errors.push({ path: ringPath, message: "each linear ring must have at least 4 positions" });
|
|
1675
|
+
return;
|
|
1676
|
+
}
|
|
1677
|
+
const first = ring[0];
|
|
1678
|
+
const last = ring[ring.length - 1];
|
|
1679
|
+
if (!_geoJsonPositionsEqual(first, last)) {
|
|
1680
|
+
errors.push({ path: ringPath, message: "the first and last positions of a linear ring must be identical (the ring must be closed)" });
|
|
1681
|
+
return;
|
|
1682
|
+
}
|
|
1683
|
+
const area = _geoJsonRingSignedArea(ring);
|
|
1684
|
+
const isExterior = i === 0;
|
|
1685
|
+
if (isExterior && area < 0) {
|
|
1686
|
+
warnings.push({ path: ringPath, message: "exterior ring winds clockwise; RFC 7946 recommends counterclockwise for exterior rings (right-hand rule)" });
|
|
1687
|
+
} else if (!isExterior && area > 0) {
|
|
1688
|
+
warnings.push({ path: ringPath, message: "interior ring (hole) winds counterclockwise; RFC 7946 recommends clockwise for interior rings (right-hand rule)" });
|
|
1689
|
+
}
|
|
1690
|
+
});
|
|
1691
|
+
}
|
|
1692
|
+
function _validateGeoJsonGeometry(geom, path, errors, warnings) {
|
|
1693
|
+
if (geom === null) return;
|
|
1694
|
+
if (typeof geom !== "object" || Array.isArray(geom)) {
|
|
1695
|
+
errors.push({ path, message: "geometry must be an object or null" });
|
|
1696
|
+
return;
|
|
1697
|
+
}
|
|
1698
|
+
const type = geom.type;
|
|
1699
|
+
if (typeof type !== "string" || !GEOJSON_GEOMETRY_TYPES.has(type)) {
|
|
1700
|
+
errors.push({ path: `${path}.type`, message: `geometry type must be one of ${[...GEOJSON_GEOMETRY_TYPES].join(", ")}` });
|
|
1701
|
+
return;
|
|
1702
|
+
}
|
|
1703
|
+
if (type === "GeometryCollection") {
|
|
1704
|
+
if (!Array.isArray(geom.geometries)) {
|
|
1705
|
+
errors.push({ path: `${path}.geometries`, message: 'GeometryCollection must have a "geometries" array' });
|
|
1706
|
+
return;
|
|
1707
|
+
}
|
|
1708
|
+
geom.geometries.forEach((g, i) => _validateGeoJsonGeometry(g, `${path}.geometries[${i}]`, errors, warnings));
|
|
1709
|
+
return;
|
|
1710
|
+
}
|
|
1711
|
+
const coords = geom.coordinates;
|
|
1712
|
+
const coordPath = `${path}.coordinates`;
|
|
1713
|
+
switch (type) {
|
|
1714
|
+
case "Point":
|
|
1715
|
+
if (!_isGeoJsonPosition(coords)) errors.push({ path: coordPath, message: "Point coordinates must be an array of 2 or 3 numbers" });
|
|
1716
|
+
break;
|
|
1717
|
+
case "MultiPoint":
|
|
1718
|
+
if (!Array.isArray(coords) || !coords.every(_isGeoJsonPosition)) {
|
|
1719
|
+
errors.push({ path: coordPath, message: "MultiPoint coordinates must be an array of positions" });
|
|
1720
|
+
}
|
|
1721
|
+
break;
|
|
1722
|
+
case "LineString":
|
|
1723
|
+
if (!Array.isArray(coords) || coords.length < 2 || !coords.every(_isGeoJsonPosition)) {
|
|
1724
|
+
errors.push({ path: coordPath, message: "LineString coordinates must be an array of at least 2 positions" });
|
|
1725
|
+
}
|
|
1726
|
+
break;
|
|
1727
|
+
case "MultiLineString":
|
|
1728
|
+
if (!Array.isArray(coords) || !coords.every((line) => Array.isArray(line) && line.length >= 2 && line.every(_isGeoJsonPosition))) {
|
|
1729
|
+
errors.push({ path: coordPath, message: "MultiLineString coordinates must be an array of LineString coordinate arrays" });
|
|
1730
|
+
}
|
|
1731
|
+
break;
|
|
1732
|
+
case "Polygon":
|
|
1733
|
+
_validateGeoJsonPolygonCoords(coords, coordPath, errors, warnings);
|
|
1734
|
+
break;
|
|
1735
|
+
case "MultiPolygon":
|
|
1736
|
+
if (!Array.isArray(coords)) {
|
|
1737
|
+
errors.push({ path: coordPath, message: "MultiPolygon coordinates must be an array of Polygon coordinate arrays" });
|
|
1738
|
+
} else {
|
|
1739
|
+
coords.forEach((poly, i) => _validateGeoJsonPolygonCoords(poly, `${coordPath}[${i}]`, errors, warnings));
|
|
1740
|
+
}
|
|
1741
|
+
break;
|
|
1742
|
+
}
|
|
1743
|
+
}
|
|
1744
|
+
function _validateGeoJsonBbox(bbox, path, errors) {
|
|
1745
|
+
if (bbox === void 0) return;
|
|
1746
|
+
if (!Array.isArray(bbox) || bbox.length % 2 !== 0 || bbox.length < 4 || !bbox.every(_isGeoJsonNumber)) {
|
|
1747
|
+
errors.push({ path: `${path}.bbox`, message: "bbox must be an array of 2*n numbers (min/max per axis)" });
|
|
1748
|
+
}
|
|
1749
|
+
}
|
|
1750
|
+
function _validateGeoJsonFeature(feature, path, errors, warnings) {
|
|
1751
|
+
if (typeof feature !== "object" || feature === null || Array.isArray(feature)) {
|
|
1752
|
+
errors.push({ path, message: "Feature must be an object" });
|
|
1753
|
+
return;
|
|
1754
|
+
}
|
|
1755
|
+
if (feature.type !== "Feature") {
|
|
1756
|
+
errors.push({ path: `${path}.type`, message: '"type" must be "Feature"' });
|
|
1757
|
+
}
|
|
1758
|
+
if (!("properties" in feature) || typeof feature.properties !== "object") {
|
|
1759
|
+
errors.push({ path: `${path}.properties`, message: '"properties" member is required and must be an object or null' });
|
|
1760
|
+
}
|
|
1761
|
+
if (!("geometry" in feature)) {
|
|
1762
|
+
errors.push({ path: `${path}.geometry`, message: '"geometry" member is required (an object or null)' });
|
|
1763
|
+
} else {
|
|
1764
|
+
_validateGeoJsonGeometry(feature.geometry, `${path}.geometry`, errors, warnings);
|
|
1765
|
+
}
|
|
1766
|
+
_validateGeoJsonBbox(feature.bbox, path, errors);
|
|
1767
|
+
}
|
|
1768
|
+
function validateGeoJson(input) {
|
|
1769
|
+
let doc;
|
|
1770
|
+
if (typeof input === "string") {
|
|
1771
|
+
try {
|
|
1772
|
+
doc = JSON.parse(input);
|
|
1773
|
+
} catch (e) {
|
|
1774
|
+
return { valid: false, type: null, errors: [{ path: "$", message: `invalid JSON: ${e.message}` }], warnings: [] };
|
|
1775
|
+
}
|
|
1776
|
+
} else {
|
|
1777
|
+
doc = input;
|
|
1778
|
+
}
|
|
1779
|
+
if (typeof doc !== "object" || doc === null || Array.isArray(doc)) {
|
|
1780
|
+
return { valid: false, type: null, errors: [{ path: "$", message: "document must be a JSON object" }], warnings: [] };
|
|
1781
|
+
}
|
|
1782
|
+
const type = doc.type;
|
|
1783
|
+
if (typeof type !== "string") {
|
|
1784
|
+
return { valid: false, type: null, errors: [{ path: "$.type", message: '"type" member is required' }], warnings: [] };
|
|
1785
|
+
}
|
|
1786
|
+
const errors = [];
|
|
1787
|
+
const warnings = [];
|
|
1788
|
+
_validateGeoJsonBbox(doc.bbox, "$", errors);
|
|
1789
|
+
if (type === "FeatureCollection") {
|
|
1790
|
+
if (!Array.isArray(doc.features)) {
|
|
1791
|
+
errors.push({ path: "$.features", message: 'FeatureCollection must have a "features" array' });
|
|
1792
|
+
} else {
|
|
1793
|
+
doc.features.forEach((feature, i) => _validateGeoJsonFeature(feature, `$.features[${i}]`, errors, warnings));
|
|
1794
|
+
}
|
|
1795
|
+
} else if (type === "Feature") {
|
|
1796
|
+
_validateGeoJsonFeature(doc, "$", errors, warnings);
|
|
1797
|
+
} else if (GEOJSON_GEOMETRY_TYPES.has(type)) {
|
|
1798
|
+
_validateGeoJsonGeometry(doc, "$", errors, warnings);
|
|
1799
|
+
} else {
|
|
1800
|
+
errors.push({ path: "$.type", message: '"type" must be one of Feature, FeatureCollection, or a geometry type' });
|
|
1801
|
+
}
|
|
1802
|
+
return { valid: errors.length === 0, type, errors, warnings };
|
|
1803
|
+
}
|
|
1639
1804
|
|
|
1640
1805
|
exports.applyJsonMergePatch = applyJsonMergePatch;
|
|
1641
1806
|
exports.applyJsonPatch = applyJsonPatch;
|
|
@@ -1666,6 +1831,7 @@ exports.parseStructs = parseStructs;
|
|
|
1666
1831
|
exports.resolveJsonPointer = resolveJsonPointer;
|
|
1667
1832
|
exports.toPascalCase = toPascalCase;
|
|
1668
1833
|
exports.toSnakeCase = toSnakeCase;
|
|
1834
|
+
exports.validateGeoJson = validateGeoJson;
|
|
1669
1835
|
exports.validateJson = validateJson;
|
|
1670
1836
|
exports.validateJsonPath = validateJsonPath;
|
|
1671
1837
|
exports.validateJsonString = validateJsonString;
|
package/dist/tools/json.d.cts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { C as ConvertOptions, a as CsvOptions, D as DiffNode, b as DiffType, G as
|
|
1
|
+
export { C as ConvertOptions, a as CsvOptions, D as DiffNode, b as DiffType, G as GeoJsonIssue, c as GeoJsonValidateResult, d as GoField, e as GoStruct, J as JsonDiffResult, f as JsonParseResult, g as JsonPatchOp, h as JsonPatchOperation, i as JsonPathResult, k as JsonPointerResult, l as JsonSchemaLike, m as JsonSchemaToTsOptions, M as MergePatchResult, P as ParseStatus, n as PythonClass, o as PythonField, p as PythonMode, V as ValidationError, q as ValidationResult, Z as ZodOptions, r as applyJsonMergePatch, s as applyJsonPatch, t as csvToJson, u as detectFormat, v as diffJson, w as diffJsonPatch, x as evaluateJsonPath, y as formatDiffLine, z as formatJson, A as generateExample, B as generateJsonPatch, E as getJsonStats, F as inferGoType, H as inferPythonType, I as inferType, K as jsonSchemaToTypescript, L as jsonToCsv, N as jsonToGo, O as jsonToPython, Q as jsonToTypescript, R as jsonToYaml, S as jsonToZod, T as mergeJsonPatch, U as minifyJson, W as parseJson, X as parseStructs, Y as resolveJsonPointer, _ as toPascalCase, $ as toSnakeCase, a0 as validateGeoJson, a1 as validateJson, a2 as validateJsonPath, a3 as validateJsonString, a4 as yamlToJson } from '../json-BtRszk1w.cjs';
|
package/dist/tools/json.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { C as ConvertOptions, a as CsvOptions, D as DiffNode, b as DiffType, G as
|
|
1
|
+
export { C as ConvertOptions, a as CsvOptions, D as DiffNode, b as DiffType, G as GeoJsonIssue, c as GeoJsonValidateResult, d as GoField, e as GoStruct, J as JsonDiffResult, f as JsonParseResult, g as JsonPatchOp, h as JsonPatchOperation, i as JsonPathResult, k as JsonPointerResult, l as JsonSchemaLike, m as JsonSchemaToTsOptions, M as MergePatchResult, P as ParseStatus, n as PythonClass, o as PythonField, p as PythonMode, V as ValidationError, q as ValidationResult, Z as ZodOptions, r as applyJsonMergePatch, s as applyJsonPatch, t as csvToJson, u as detectFormat, v as diffJson, w as diffJsonPatch, x as evaluateJsonPath, y as formatDiffLine, z as formatJson, A as generateExample, B as generateJsonPatch, E as getJsonStats, F as inferGoType, H as inferPythonType, I as inferType, K as jsonSchemaToTypescript, L as jsonToCsv, N as jsonToGo, O as jsonToPython, Q as jsonToTypescript, R as jsonToYaml, S as jsonToZod, T as mergeJsonPatch, U as minifyJson, W as parseJson, X as parseStructs, Y as resolveJsonPointer, _ as toPascalCase, $ as toSnakeCase, a0 as validateGeoJson, a1 as validateJson, a2 as validateJsonPath, a3 as validateJsonString, a4 as yamlToJson } from '../json-BtRszk1w.js';
|
package/dist/tools/json.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { applyJsonMergePatch, applyJsonPatch, csvToJson, detectFormat, diffJson, diffJsonPatch, evaluateJsonPath, formatDiffLine, formatJson, generateExample, generateJsonPatch, getJsonStats, inferGoType, inferPythonType, inferType, jsonSchemaToTypescript, jsonToCsv, jsonToGo, jsonToPython, jsonToTypescript, jsonToYaml, jsonToZod, mergeJsonPatch, minifyJson, parseJson, parseStructs, resolveJsonPointer, toPascalCase, toSnakeCase, validateJson, validateJsonPath, validateJsonString, yamlToJson } from '../chunk-
|
|
1
|
+
export { applyJsonMergePatch, applyJsonPatch, csvToJson, detectFormat, diffJson, diffJsonPatch, evaluateJsonPath, formatDiffLine, formatJson, generateExample, generateJsonPatch, getJsonStats, inferGoType, inferPythonType, inferType, jsonSchemaToTypescript, jsonToCsv, jsonToGo, jsonToPython, jsonToTypescript, jsonToYaml, jsonToZod, mergeJsonPatch, minifyJson, parseJson, parseStructs, resolveJsonPointer, toPascalCase, toSnakeCase, validateGeoJson, validateJson, validateJsonPath, validateJsonString, yamlToJson } from '../chunk-PAMHORKV.js';
|
|
2
2
|
import '../chunk-MLKGABMK.js';
|
package/dist/tools/text.cjs
CHANGED
|
@@ -3258,6 +3258,62 @@ function checkAcronymExpansion(text) {
|
|
|
3258
3258
|
issues.sort((a, b) => a.index - b.index);
|
|
3259
3259
|
return { acronyms, issues };
|
|
3260
3260
|
}
|
|
3261
|
+
var WEASEL_PHRASES = [
|
|
3262
|
+
"many experts believe",
|
|
3263
|
+
"some experts say",
|
|
3264
|
+
"experts agree",
|
|
3265
|
+
"critics argue",
|
|
3266
|
+
"studies show",
|
|
3267
|
+
"studies have shown",
|
|
3268
|
+
"research shows",
|
|
3269
|
+
"research suggests",
|
|
3270
|
+
"it is widely believed",
|
|
3271
|
+
"it is widely known",
|
|
3272
|
+
"it is widely regarded",
|
|
3273
|
+
"it is generally accepted",
|
|
3274
|
+
"it is often said",
|
|
3275
|
+
"it has been suggested",
|
|
3276
|
+
"it is said that",
|
|
3277
|
+
"some say",
|
|
3278
|
+
"some people believe",
|
|
3279
|
+
"some people think",
|
|
3280
|
+
"many believe",
|
|
3281
|
+
"many people think",
|
|
3282
|
+
"many claim",
|
|
3283
|
+
"observers note",
|
|
3284
|
+
"sources say",
|
|
3285
|
+
"according to some",
|
|
3286
|
+
"widely regarded as",
|
|
3287
|
+
"many consider",
|
|
3288
|
+
"some scientists believe",
|
|
3289
|
+
"some argue",
|
|
3290
|
+
"reportedly",
|
|
3291
|
+
"allegedly"
|
|
3292
|
+
];
|
|
3293
|
+
function _weaselRegex(phrase) {
|
|
3294
|
+
const tokens = phrase.split(/\s+/).map((t) => t.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"));
|
|
3295
|
+
return new RegExp("\\b" + tokens.join("\\s+") + "\\b", "gi");
|
|
3296
|
+
}
|
|
3297
|
+
function detectWeaselWords(text) {
|
|
3298
|
+
const totalWords = (text.match(/[A-Za-z0-9']+/g) ?? []).length;
|
|
3299
|
+
const matches = [];
|
|
3300
|
+
for (const phrase of WEASEL_PHRASES) {
|
|
3301
|
+
const re = _weaselRegex(phrase);
|
|
3302
|
+
const indices = [];
|
|
3303
|
+
let m;
|
|
3304
|
+
while ((m = re.exec(text)) !== null) {
|
|
3305
|
+
indices.push(m.index);
|
|
3306
|
+
if (m.index === re.lastIndex) re.lastIndex++;
|
|
3307
|
+
}
|
|
3308
|
+
if (indices.length > 0) {
|
|
3309
|
+
matches.push({ phrase, count: indices.length, indices });
|
|
3310
|
+
}
|
|
3311
|
+
}
|
|
3312
|
+
matches.sort((a, b) => b.count - a.count || a.phrase.localeCompare(b.phrase));
|
|
3313
|
+
const totalMatches = matches.reduce((s, x) => s + x.count, 0);
|
|
3314
|
+
const density = totalWords > 0 ? Math.round(totalMatches / totalWords * 1e3) / 10 : 0;
|
|
3315
|
+
return { totalWords, totalMatches, density, matches };
|
|
3316
|
+
}
|
|
3261
3317
|
|
|
3262
3318
|
exports.CASE_FORMATS = CASE_FORMATS;
|
|
3263
3319
|
exports.DEFAULT_CONVERT_OPTIONS = DEFAULT_CONVERT_OPTIONS;
|
|
@@ -3284,6 +3340,7 @@ exports.csvToMarkdown = csvToMarkdown;
|
|
|
3284
3340
|
exports.detectDelimiter = detectDelimiter;
|
|
3285
3341
|
exports.detectFillerWords = detectFillerWords;
|
|
3286
3342
|
exports.detectPassiveVoice = detectPassiveVoice;
|
|
3343
|
+
exports.detectWeaselWords = detectWeaselWords;
|
|
3287
3344
|
exports.detectWordyPhrases = detectWordyPhrases;
|
|
3288
3345
|
exports.diffLines = diffLines;
|
|
3289
3346
|
exports.diffLinesSimple = diffLinesSimple;
|
package/dist/tools/text.d.cts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { A as AcronymCheckResult, a as AcronymIssue, b as AcronymIssueType, c as AcronymUsage, d as AsciiFont, e as AsciiOptions, C as CASE_FORMATS, f as CaseFormat, g as ConvertOptions, D as DEFAULT_CONVERT_OPTIONS, h as DashIssue, i as DashIssueType, j as DashUsageResult, k as DiffFile, l as DiffHunk, m as DiffLine, n as DiffResult, o as DiffType, p as DiffViewerLine, E as EMOJI_TABLE, q as ESCAPE_MODES, r as EmojiEntry, s as EscapeMode, F as FillerCategory, u as FillerMatch, v as FillerWordResult, K as KeywordDensityEntry, w as KeywordDensityOptions, x as KeywordDensityResult, L as LINE_OPS, y as LineOp, z as LineType, B as LoremUnit, M as MORSE_CODE, G as MarkdownResult, H as MorseOptions, O as OxfordCommaInstance, I as OxfordCommaResult, P as ParsedDiff, J as ParsedTable, N as PassiveVoiceMatch, Q as PassiveVoiceResult, R as PassiveVoiceSentence, S as ReadabilityResult, T as ReadabilityScore, U as SentenceLengthBucket, V as SentenceLengthDistribution, W as SlugSeparator, X as StringDistanceMode, Y as StringDistanceResult, Z as TableOptions, _ as TextAnalysis, $ as
|
|
1
|
+
export { A as AcronymCheckResult, a as AcronymIssue, b as AcronymIssueType, c as AcronymUsage, d as AsciiFont, e as AsciiOptions, C as CASE_FORMATS, f as CaseFormat, g as ConvertOptions, D as DEFAULT_CONVERT_OPTIONS, h as DashIssue, i as DashIssueType, j as DashUsageResult, k as DiffFile, l as DiffHunk, m as DiffLine, n as DiffResult, o as DiffType, p as DiffViewerLine, E as EMOJI_TABLE, q as ESCAPE_MODES, r as EmojiEntry, s as EscapeMode, F as FillerCategory, u as FillerMatch, v as FillerWordResult, K as KeywordDensityEntry, w as KeywordDensityOptions, x as KeywordDensityResult, L as LINE_OPS, y as LineOp, z as LineType, B as LoremUnit, M as MORSE_CODE, G as MarkdownResult, H as MorseOptions, O as OxfordCommaInstance, I as OxfordCommaResult, P as ParsedDiff, J as ParsedTable, N as PassiveVoiceMatch, Q as PassiveVoiceResult, R as PassiveVoiceSentence, S as ReadabilityResult, T as ReadabilityScore, U as SentenceLengthBucket, V as SentenceLengthDistribution, W as SlugSeparator, X as StringDistanceMode, Y as StringDistanceResult, Z as TableOptions, _ as TextAnalysis, $ as WeaselWordMatch, a0 as WeaselWordResult, a1 as WordCountResult, a2 as WordyPhraseMatch, a3 as WordyPhraseResult, a4 as addBorder, a5 as analyzeKeywordDensity, a6 as analyzeSentenceLengths, a7 as analyzeText, a8 as applyOp, a9 as applyOps, aa as calculateStringDistance, ab as centerText, ac as checkAcronymExpansion, ad as checkDashUsage, ae as checkOxfordCommaConsistency, af as convertAll, ag as convertCase, ah as countWords, ai as csvToHtml, aj as csvToMarkdown, ak as detectDelimiter, al as detectFillerWords, am as detectPassiveVoice, an as detectWeaselWords, ao as detectWordyPhrases, ap as diffLines, aq as diffLinesSimple, ar as diffStats, as as escapeAll, at as escapeString, au as extractHeadings, av as formatReadingTime, aw as generate, ax as generateDiff, ay as generateHtmlTable, az as generateMarkdownTable, aA as generateParagraphs, aB as generateSentences, aC as generateWords, aD as getAvailableFonts, aE as getEmojiByCategory, aF as getEmojiByChar, aG as getEmojiByShortcode, aH as getEmojiCategories, aI as getMorseForChar, aJ as getMorseTiming, aK as htmlToMarkdown, aL as isValidMorse, aM as markdownToHtml, aN as morseToText, aO as numberToOrdinal, aP as numberToRoman, aQ as numberToWords, aR as ordinalWords, aS as parseDiff, aT as parseTableData, aU as readabilityScore, aV as renderMarkdown, aW as romanToNumber, aX as scoreReadability, aY as searchEmoji, aZ as sentenceCount, a_ as slugify, a$ as slugifyAll, b0 as syllableCount, b1 as textToAscii, b2 as textToMorse, b3 as unescapeString, b4 as wordFrequency } from '../text-DFCNpyvH.cjs';
|
package/dist/tools/text.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { A as AcronymCheckResult, a as AcronymIssue, b as AcronymIssueType, c as AcronymUsage, d as AsciiFont, e as AsciiOptions, C as CASE_FORMATS, f as CaseFormat, g as ConvertOptions, D as DEFAULT_CONVERT_OPTIONS, h as DashIssue, i as DashIssueType, j as DashUsageResult, k as DiffFile, l as DiffHunk, m as DiffLine, n as DiffResult, o as DiffType, p as DiffViewerLine, E as EMOJI_TABLE, q as ESCAPE_MODES, r as EmojiEntry, s as EscapeMode, F as FillerCategory, u as FillerMatch, v as FillerWordResult, K as KeywordDensityEntry, w as KeywordDensityOptions, x as KeywordDensityResult, L as LINE_OPS, y as LineOp, z as LineType, B as LoremUnit, M as MORSE_CODE, G as MarkdownResult, H as MorseOptions, O as OxfordCommaInstance, I as OxfordCommaResult, P as ParsedDiff, J as ParsedTable, N as PassiveVoiceMatch, Q as PassiveVoiceResult, R as PassiveVoiceSentence, S as ReadabilityResult, T as ReadabilityScore, U as SentenceLengthBucket, V as SentenceLengthDistribution, W as SlugSeparator, X as StringDistanceMode, Y as StringDistanceResult, Z as TableOptions, _ as TextAnalysis, $ as
|
|
1
|
+
export { A as AcronymCheckResult, a as AcronymIssue, b as AcronymIssueType, c as AcronymUsage, d as AsciiFont, e as AsciiOptions, C as CASE_FORMATS, f as CaseFormat, g as ConvertOptions, D as DEFAULT_CONVERT_OPTIONS, h as DashIssue, i as DashIssueType, j as DashUsageResult, k as DiffFile, l as DiffHunk, m as DiffLine, n as DiffResult, o as DiffType, p as DiffViewerLine, E as EMOJI_TABLE, q as ESCAPE_MODES, r as EmojiEntry, s as EscapeMode, F as FillerCategory, u as FillerMatch, v as FillerWordResult, K as KeywordDensityEntry, w as KeywordDensityOptions, x as KeywordDensityResult, L as LINE_OPS, y as LineOp, z as LineType, B as LoremUnit, M as MORSE_CODE, G as MarkdownResult, H as MorseOptions, O as OxfordCommaInstance, I as OxfordCommaResult, P as ParsedDiff, J as ParsedTable, N as PassiveVoiceMatch, Q as PassiveVoiceResult, R as PassiveVoiceSentence, S as ReadabilityResult, T as ReadabilityScore, U as SentenceLengthBucket, V as SentenceLengthDistribution, W as SlugSeparator, X as StringDistanceMode, Y as StringDistanceResult, Z as TableOptions, _ as TextAnalysis, $ as WeaselWordMatch, a0 as WeaselWordResult, a1 as WordCountResult, a2 as WordyPhraseMatch, a3 as WordyPhraseResult, a4 as addBorder, a5 as analyzeKeywordDensity, a6 as analyzeSentenceLengths, a7 as analyzeText, a8 as applyOp, a9 as applyOps, aa as calculateStringDistance, ab as centerText, ac as checkAcronymExpansion, ad as checkDashUsage, ae as checkOxfordCommaConsistency, af as convertAll, ag as convertCase, ah as countWords, ai as csvToHtml, aj as csvToMarkdown, ak as detectDelimiter, al as detectFillerWords, am as detectPassiveVoice, an as detectWeaselWords, ao as detectWordyPhrases, ap as diffLines, aq as diffLinesSimple, ar as diffStats, as as escapeAll, at as escapeString, au as extractHeadings, av as formatReadingTime, aw as generate, ax as generateDiff, ay as generateHtmlTable, az as generateMarkdownTable, aA as generateParagraphs, aB as generateSentences, aC as generateWords, aD as getAvailableFonts, aE as getEmojiByCategory, aF as getEmojiByChar, aG as getEmojiByShortcode, aH as getEmojiCategories, aI as getMorseForChar, aJ as getMorseTiming, aK as htmlToMarkdown, aL as isValidMorse, aM as markdownToHtml, aN as morseToText, aO as numberToOrdinal, aP as numberToRoman, aQ as numberToWords, aR as ordinalWords, aS as parseDiff, aT as parseTableData, aU as readabilityScore, aV as renderMarkdown, aW as romanToNumber, aX as scoreReadability, aY as searchEmoji, aZ as sentenceCount, a_ as slugify, a$ as slugifyAll, b0 as syllableCount, b1 as textToAscii, b2 as textToMorse, b3 as unescapeString, b4 as wordFrequency } from '../text-DFCNpyvH.js';
|
package/dist/tools/text.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { CASE_FORMATS, DEFAULT_CONVERT_OPTIONS, EMOJI_TABLE, ESCAPE_MODES, LINE_OPS, MORSE_CODE, addBorder, analyzeKeywordDensity, analyzeSentenceLengths, analyzeText, applyOp, applyOps, calculateStringDistance, centerText, checkAcronymExpansion, checkDashUsage, checkOxfordCommaConsistency, convertAll, convertCase, countWords, csvToHtml, csvToMarkdown, detectDelimiter, detectFillerWords, detectPassiveVoice, detectWordyPhrases, diffLines, diffLinesSimple, diffStats, escapeAll, escapeString, extractHeadings, formatReadingTime, generate, generateDiff, generateHtmlTable, generateMarkdownTable, generateParagraphs, generateSentences, generateWords, getAvailableFonts, getEmojiByCategory, getEmojiByChar, getEmojiByShortcode, getEmojiCategories, getMorseForChar, getMorseTiming, htmlToMarkdown, isValidMorse, markdownToHtml, morseToText, numberToOrdinal, numberToRoman, numberToWords, ordinalWords, parseDiff, parseTableData, readabilityScore, renderMarkdown, romanToNumber, scoreReadability, searchEmoji, sentenceCount, slugify, slugifyAll, syllableCount, textToAscii, textToMorse, unescapeString, wordFrequency } from '../chunk-
|
|
1
|
+
export { CASE_FORMATS, DEFAULT_CONVERT_OPTIONS, EMOJI_TABLE, ESCAPE_MODES, LINE_OPS, MORSE_CODE, addBorder, analyzeKeywordDensity, analyzeSentenceLengths, analyzeText, applyOp, applyOps, calculateStringDistance, centerText, checkAcronymExpansion, checkDashUsage, checkOxfordCommaConsistency, convertAll, convertCase, countWords, csvToHtml, csvToMarkdown, detectDelimiter, detectFillerWords, detectPassiveVoice, detectWeaselWords, detectWordyPhrases, diffLines, diffLinesSimple, diffStats, escapeAll, escapeString, extractHeadings, formatReadingTime, generate, generateDiff, generateHtmlTable, generateMarkdownTable, generateParagraphs, generateSentences, generateWords, getAvailableFonts, getEmojiByCategory, getEmojiByChar, getEmojiByShortcode, getEmojiCategories, getMorseForChar, getMorseTiming, htmlToMarkdown, isValidMorse, markdownToHtml, morseToText, numberToOrdinal, numberToRoman, numberToWords, ordinalWords, parseDiff, parseTableData, readabilityScore, renderMarkdown, romanToNumber, scoreReadability, searchEmoji, sentenceCount, slugify, slugifyAll, syllableCount, textToAscii, textToMorse, unescapeString, wordFrequency } from '../chunk-2YWKRNDM.js';
|
|
2
2
|
import '../chunk-MLKGABMK.js';
|