yomitan-core 0.1.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/README.md +485 -0
- package/dist/anki-connect-BQyCGW3O.cjs +513 -0
- package/dist/anki-connect-BQyCGW3O.cjs.map +1 -0
- package/dist/anki-connect-CPPuhyiQ.js +6 -0
- package/dist/anki-connect-DbrQHphS.js +495 -0
- package/dist/anki-connect-DbrQHphS.js.map +1 -0
- package/dist/anki-connect-DcheJrp-.cjs +6 -0
- package/dist/anki.cjs +1758 -0
- package/dist/anki.cjs.map +1 -0
- package/dist/anki.d.cts +751 -0
- package/dist/anki.d.cts.map +1 -0
- package/dist/anki.d.ts +751 -0
- package/dist/anki.d.ts.map +1 -0
- package/dist/anki.js +1751 -0
- package/dist/anki.js.map +1 -0
- package/dist/audio-D9DvYyB7.d.cts +48 -0
- package/dist/audio-D9DvYyB7.d.cts.map +1 -0
- package/dist/audio-DQulUkDM.d.ts +48 -0
- package/dist/audio-DQulUkDM.d.ts.map +1 -0
- package/dist/audio-url-generator-BXvQaqUi.cjs +4 -0
- package/dist/audio-url-generator-Dy2hb2Mm.cjs +414 -0
- package/dist/audio-url-generator-Dy2hb2Mm.cjs.map +1 -0
- package/dist/audio-url-generator-Qi0rfzHz.js +4 -0
- package/dist/audio-url-generator-pFQAB5Nb.js +390 -0
- package/dist/audio-url-generator-pFQAB5Nb.js.map +1 -0
- package/dist/audio.cjs +7 -0
- package/dist/audio.d.cts +86 -0
- package/dist/audio.d.cts.map +1 -0
- package/dist/audio.d.ts +86 -0
- package/dist/audio.d.ts.map +1 -0
- package/dist/audio.js +4 -0
- package/dist/batch-processor-BR-gB3H3.js +84 -0
- package/dist/batch-processor-BR-gB3H3.js.map +1 -0
- package/dist/batch-processor-CSF1acTw.cjs +3 -0
- package/dist/batch-processor-DFqM_L-_.cjs +91 -0
- package/dist/batch-processor-DFqM_L-_.cjs.map +1 -0
- package/dist/batch-processor-Quo9jUyf.js +3 -0
- package/dist/chunk-BCwAaXi7.cjs +31 -0
- package/dist/cjk-util-Dp0ZU0sh.cjs +167 -0
- package/dist/cjk-util-Dp0ZU0sh.cjs.map +1 -0
- package/dist/cjk-util-DubXBGDG.js +94 -0
- package/dist/cjk-util-DubXBGDG.js.map +1 -0
- package/dist/core-BUpclilG.d.cts +102 -0
- package/dist/core-BUpclilG.d.cts.map +1 -0
- package/dist/core-DFUj5GtA.d.ts +102 -0
- package/dist/core-DFUj5GtA.d.ts.map +1 -0
- package/dist/database.cjs +7 -0
- package/dist/database.d.cts +4 -0
- package/dist/database.d.ts +4 -0
- package/dist/database.js +5 -0
- package/dist/dictionary-D7l-qFt1.d.cts +316 -0
- package/dist/dictionary-D7l-qFt1.d.cts.map +1 -0
- package/dist/dictionary-_vzfBLWi.d.ts +316 -0
- package/dist/dictionary-_vzfBLWi.d.ts.map +1 -0
- package/dist/dictionary-data-util-CHnRdYZ9.cjs +378 -0
- package/dist/dictionary-data-util-CHnRdYZ9.cjs.map +1 -0
- package/dist/dictionary-data-util-CfOLfEDE.js +323 -0
- package/dist/dictionary-data-util-CfOLfEDE.js.map +1 -0
- package/dist/dictionary-database-BDC2f9zc.d.ts +58 -0
- package/dist/dictionary-database-BDC2f9zc.d.ts.map +1 -0
- package/dist/dictionary-database-CU4TsvCC.js +393 -0
- package/dist/dictionary-database-CU4TsvCC.js.map +1 -0
- package/dist/dictionary-database-DsOi04Sg.d.cts +58 -0
- package/dist/dictionary-database-DsOi04Sg.d.cts.map +1 -0
- package/dist/dictionary-database-lvFvftnO.cjs +412 -0
- package/dist/dictionary-database-lvFvftnO.cjs.map +1 -0
- package/dist/dictionary-importer-BkQQSBhm.d.ts +237 -0
- package/dist/dictionary-importer-BkQQSBhm.d.ts.map +1 -0
- package/dist/dictionary-importer-Cen1z6co.js +1821 -0
- package/dist/dictionary-importer-Cen1z6co.js.map +1 -0
- package/dist/dictionary-importer-DYmmWmcX.cjs +8 -0
- package/dist/dictionary-importer-Da3AuTZw.d.cts +237 -0
- package/dist/dictionary-importer-Da3AuTZw.d.cts.map +1 -0
- package/dist/dictionary-importer-Dhn75iZ4.cjs +1834 -0
- package/dist/dictionary-importer-Dhn75iZ4.cjs.map +1 -0
- package/dist/dictionary-importer-xWkel0h-.js +8 -0
- package/dist/dictionary-update-checker-BNE4pGTx.js +4 -0
- package/dist/dictionary-update-checker-Byjvifd2.cjs +75 -0
- package/dist/dictionary-update-checker-Byjvifd2.cjs.map +1 -0
- package/dist/dictionary-update-checker-YdpalZ41.cjs +4 -0
- package/dist/dictionary-update-checker-kKukiovj.js +69 -0
- package/dist/dictionary-update-checker-kKukiovj.js.map +1 -0
- package/dist/display-generator-BGVWiI0t.js +746 -0
- package/dist/display-generator-BGVWiI0t.js.map +1 -0
- package/dist/display-generator-BMQmG5Ov.cjs +9 -0
- package/dist/display-generator-BxZ7mBjP.js +9 -0
- package/dist/display-generator-DyP-HNzP.cjs +758 -0
- package/dist/display-generator-DyP-HNzP.cjs.map +1 -0
- package/dist/errors-BSezaJwm.cjs +35 -0
- package/dist/errors-BSezaJwm.cjs.map +1 -0
- package/dist/errors-DuuDSO5N.js +22 -0
- package/dist/errors-DuuDSO5N.js.map +1 -0
- package/dist/frequency-ranking-BXjfhhUQ.js +3 -0
- package/dist/frequency-ranking-Cx1kkIrw.cjs +3 -0
- package/dist/frequency-ranking-DEJMTMdg.js +159 -0
- package/dist/frequency-ranking-DEJMTMdg.js.map +1 -0
- package/dist/frequency-ranking-DVYxTXN-.cjs +166 -0
- package/dist/frequency-ranking-DVYxTXN-.cjs.map +1 -0
- package/dist/furigana-5HK97CY8.js +4 -0
- package/dist/furigana-9bBI9-qe.d.ts +47 -0
- package/dist/furigana-9bBI9-qe.d.ts.map +1 -0
- package/dist/furigana-B3-0y231.js +471 -0
- package/dist/furigana-B3-0y231.js.map +1 -0
- package/dist/furigana-CjOhzvZt.d.cts +47 -0
- package/dist/furigana-CjOhzvZt.d.cts.map +1 -0
- package/dist/furigana-DpZLcues.cjs +609 -0
- package/dist/furigana-DpZLcues.cjs.map +1 -0
- package/dist/furigana-h3v2ub4-.cjs +4 -0
- package/dist/import.cjs +12 -0
- package/dist/import.d.cts +107 -0
- package/dist/import.d.cts.map +1 -0
- package/dist/import.d.ts +107 -0
- package/dist/import.d.ts.map +1 -0
- package/dist/import.js +9 -0
- package/dist/index.cjs +275 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +211 -0
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.ts +211 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +238 -0
- package/dist/index.js.map +1 -0
- package/dist/json-DGd-cunA.js +17 -0
- package/dist/json-DGd-cunA.js.map +1 -0
- package/dist/json-DKWp-B7Y.cjs +30 -0
- package/dist/json-DKWp-B7Y.cjs.map +1 -0
- package/dist/language-KN_u-nTR.d.ts +104 -0
- package/dist/language-KN_u-nTR.d.ts.map +1 -0
- package/dist/language-xAbQxgXc.d.cts +104 -0
- package/dist/language-xAbQxgXc.d.cts.map +1 -0
- package/dist/language.cjs +15626 -0
- package/dist/language.cjs.map +1 -0
- package/dist/language.d.cts +959 -0
- package/dist/language.d.cts.map +1 -0
- package/dist/language.d.ts +959 -0
- package/dist/language.d.ts.map +1 -0
- package/dist/language.js +15522 -0
- package/dist/language.js.map +1 -0
- package/dist/log-D8KtR3aP.cjs +67 -0
- package/dist/log-D8KtR3aP.cjs.map +1 -0
- package/dist/log-hgSll-dS.js +60 -0
- package/dist/log-hgSll-dS.js.map +1 -0
- package/dist/lookup.cjs +13 -0
- package/dist/lookup.d.cts +161 -0
- package/dist/lookup.d.cts.map +1 -0
- package/dist/lookup.d.ts +161 -0
- package/dist/lookup.d.ts.map +1 -0
- package/dist/lookup.js +10 -0
- package/dist/media-loader-BABA_E4W.js +3 -0
- package/dist/media-loader-Ce9cuANS.cjs +21 -0
- package/dist/media-loader-Ce9cuANS.cjs.map +1 -0
- package/dist/media-loader-qRti-Q6h.js +14 -0
- package/dist/media-loader-qRti-Q6h.js.map +1 -0
- package/dist/media-loader-xlUGaJrx.cjs +3 -0
- package/dist/multi-language-transformer-AlxOM6b3.js +637 -0
- package/dist/multi-language-transformer-AlxOM6b3.js.map +1 -0
- package/dist/multi-language-transformer-MdbQBBOt.cjs +685 -0
- package/dist/multi-language-transformer-MdbQBBOt.cjs.map +1 -0
- package/dist/multi-language-transformer-SEhcJXEB.d.ts +63 -0
- package/dist/multi-language-transformer-SEhcJXEB.d.ts.map +1 -0
- package/dist/multi-language-transformer-Ul9mbRce.d.cts +63 -0
- package/dist/multi-language-transformer-Ul9mbRce.d.cts.map +1 -0
- package/dist/pronunciation-generator-BtBc4q_V.js +397 -0
- package/dist/pronunciation-generator-BtBc4q_V.js.map +1 -0
- package/dist/pronunciation-generator-CBYdXYou.js +4 -0
- package/dist/pronunciation-generator-CFbZlf5J.cjs +445 -0
- package/dist/pronunciation-generator-CFbZlf5J.cjs.map +1 -0
- package/dist/pronunciation-generator-DOz9hEuk.cjs +4 -0
- package/dist/render.cjs +2796 -0
- package/dist/render.cjs.map +1 -0
- package/dist/render.d.cts +424 -0
- package/dist/render.d.cts.map +1 -0
- package/dist/render.d.ts +424 -0
- package/dist/render.d.ts.map +1 -0
- package/dist/render.js +2777 -0
- package/dist/render.js.map +1 -0
- package/dist/sentence-parser-BPAJNzqW.js +126 -0
- package/dist/sentence-parser-BPAJNzqW.js.map +1 -0
- package/dist/sentence-parser-BVIOI64h.cjs +132 -0
- package/dist/sentence-parser-BVIOI64h.cjs.map +1 -0
- package/dist/sentence-parser-BoHO3cHn.js +5 -0
- package/dist/sentence-parser-DQVLSW0z.cjs +5 -0
- package/dist/structured-content-generator-BtOApkTW.cjs +4 -0
- package/dist/structured-content-generator-Bx62RYa8.js +4 -0
- package/dist/structured-content-generator-CLnybumI.js +276 -0
- package/dist/structured-content-generator-CLnybumI.js.map +1 -0
- package/dist/structured-content-generator-DrwkB0-k.cjs +282 -0
- package/dist/structured-content-generator-DrwkB0-k.cjs.map +1 -0
- package/dist/text-utilities-B7PIythe.js +8 -0
- package/dist/text-utilities-B7PIythe.js.map +1 -0
- package/dist/text-utilities-Del2Ivkg.cjs +15 -0
- package/dist/text-utilities-Del2Ivkg.cjs.map +1 -0
- package/dist/translator-CRPlPzqi.cjs +1545 -0
- package/dist/translator-CRPlPzqi.cjs.map +1 -0
- package/dist/translator-CWgG5drA.js +1539 -0
- package/dist/translator-CWgG5drA.js.map +1 -0
- package/dist/translator-CaGtJvnQ.cjs +6 -0
- package/dist/translator-Cc6OGxrW.d.ts +180 -0
- package/dist/translator-Cc6OGxrW.d.ts.map +1 -0
- package/dist/translator-CcA-s-W4.d.cts +180 -0
- package/dist/translator-CcA-s-W4.d.cts.map +1 -0
- package/dist/translator-CuJOTK6l.js +6 -0
- package/dist/utilities-C-lbZaJE.cjs +52 -0
- package/dist/utilities-C-lbZaJE.cjs.map +1 -0
- package/dist/utilities-bi3EF-q5.js +33 -0
- package/dist/utilities-bi3EF-q5.js.map +1 -0
- package/package.json +102 -0
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
import { KanjiDictionaryEntry, TermDictionaryEntry, TermSourceMatchType } from "./dictionary-D7l-qFt1.cjs";
|
|
2
|
+
import { DictionaryDB } from "./dictionary-database-DsOi04Sg.cjs";
|
|
3
|
+
|
|
4
|
+
//#region src/types/translation.d.ts
|
|
5
|
+
type SearchResolution = 'letter' | 'word';
|
|
6
|
+
type FindKanjiOptions = {
|
|
7
|
+
enabledDictionaryMap: KanjiEnabledDictionaryMap;
|
|
8
|
+
removeNonJapaneseCharacters: boolean;
|
|
9
|
+
};
|
|
10
|
+
type FindKanjiDictionary = {
|
|
11
|
+
index: number;
|
|
12
|
+
alias: string;
|
|
13
|
+
};
|
|
14
|
+
type FindTermsOptions = {
|
|
15
|
+
matchType: FindTermsMatchType;
|
|
16
|
+
deinflect: boolean;
|
|
17
|
+
primaryReading: string;
|
|
18
|
+
mainDictionary: string;
|
|
19
|
+
sortFrequencyDictionary: string | null;
|
|
20
|
+
sortFrequencyDictionaryOrder: FindTermsSortOrder;
|
|
21
|
+
removeNonJapaneseCharacters: boolean;
|
|
22
|
+
textReplacements: FindTermsTextReplacements;
|
|
23
|
+
enabledDictionaryMap: TermEnabledDictionaryMap;
|
|
24
|
+
excludeDictionaryDefinitions: Set<string> | null;
|
|
25
|
+
searchResolution: SearchResolution;
|
|
26
|
+
language: string;
|
|
27
|
+
};
|
|
28
|
+
type FindTermsMatchType = TermSourceMatchType;
|
|
29
|
+
type FindTermsSortOrder = 'ascending' | 'descending';
|
|
30
|
+
type FindTermsTextReplacement = {
|
|
31
|
+
pattern: RegExp;
|
|
32
|
+
replacement: string;
|
|
33
|
+
};
|
|
34
|
+
type FindTermsTextReplacements = (FindTermsTextReplacement[] | null)[];
|
|
35
|
+
type FindTermDictionary = {
|
|
36
|
+
index: number;
|
|
37
|
+
alias: string;
|
|
38
|
+
allowSecondarySearches: boolean;
|
|
39
|
+
partsOfSpeechFilter: boolean;
|
|
40
|
+
useDeinflections: boolean;
|
|
41
|
+
};
|
|
42
|
+
type TermEnabledDictionaryMap = Map<string, FindTermDictionary>;
|
|
43
|
+
type KanjiEnabledDictionaryMap = Map<string, FindKanjiDictionary>; //#endregion
|
|
44
|
+
//#region src/lookup/translator.d.ts
|
|
45
|
+
|
|
46
|
+
//# sourceMappingURL=translation.d.ts.map
|
|
47
|
+
type TermDictionaryEntry$1 = TermDictionaryEntry;
|
|
48
|
+
type FindTermsMode = 'group' | 'term' | 'merge' | 'simple';
|
|
49
|
+
/**
|
|
50
|
+
* Class which finds term and kanji dictionary entries for text.
|
|
51
|
+
*/
|
|
52
|
+
declare class Translator {
|
|
53
|
+
private _database;
|
|
54
|
+
private _multiLanguageTransformer;
|
|
55
|
+
private _tagCache;
|
|
56
|
+
private _stringComparer;
|
|
57
|
+
private _numberRegex;
|
|
58
|
+
private _textProcessors;
|
|
59
|
+
private _readingNormalizers;
|
|
60
|
+
constructor(database: DictionaryDB);
|
|
61
|
+
/**
|
|
62
|
+
* Initializes the instance for use. The public API should not be used until this function has been called.
|
|
63
|
+
*/
|
|
64
|
+
prepare(): void;
|
|
65
|
+
/**
|
|
66
|
+
* Clears the database tag cache. This should be executed if the database is changed.
|
|
67
|
+
*/
|
|
68
|
+
clearDatabaseCaches(): void;
|
|
69
|
+
/**
|
|
70
|
+
* Finds term definitions for the given text.
|
|
71
|
+
*/
|
|
72
|
+
findTerms(mode: FindTermsMode, text: string, options: FindTermsOptions): Promise<{
|
|
73
|
+
dictionaryEntries: TermDictionaryEntry$1[];
|
|
74
|
+
originalTextLength: number;
|
|
75
|
+
}>;
|
|
76
|
+
/**
|
|
77
|
+
* Finds kanji definitions for the given text.
|
|
78
|
+
*/
|
|
79
|
+
findKanji(text: string, options: FindKanjiOptions): Promise<KanjiDictionaryEntry[]>;
|
|
80
|
+
/**
|
|
81
|
+
* Gets a list of frequency information for a given list of term-reading pairs
|
|
82
|
+
* and a list of dictionaries.
|
|
83
|
+
*/
|
|
84
|
+
getTermFrequencies(termReadingList: {
|
|
85
|
+
term: string;
|
|
86
|
+
reading: string | null;
|
|
87
|
+
}[], dictionaries: string[]): Promise<{
|
|
88
|
+
term: string;
|
|
89
|
+
reading: string | null;
|
|
90
|
+
dictionary: string;
|
|
91
|
+
hasReading: boolean;
|
|
92
|
+
frequency: number;
|
|
93
|
+
displayValue: string | null;
|
|
94
|
+
displayValueParsed: boolean;
|
|
95
|
+
}[]>;
|
|
96
|
+
private _findTermsInternal;
|
|
97
|
+
private _getDictionaryEntries;
|
|
98
|
+
private _findExistingEntry;
|
|
99
|
+
private _mergeTextProcessorRuleChains;
|
|
100
|
+
private _mergeInflectionRuleChains;
|
|
101
|
+
private _areArraysEqualIgnoreOrder;
|
|
102
|
+
private _getDeinflections;
|
|
103
|
+
private _getDictionaryDeinflections;
|
|
104
|
+
private _addEntriesToDeinflections;
|
|
105
|
+
private _groupDeinflectionsByTerm;
|
|
106
|
+
private _matchEntriesToDeinflections;
|
|
107
|
+
private _getAlgorithmDeinflections;
|
|
108
|
+
private _getTextVariants;
|
|
109
|
+
private _getProcessedText;
|
|
110
|
+
private _getNextSubstring;
|
|
111
|
+
private _applyTextReplacements;
|
|
112
|
+
private _getJapaneseChineseKoreanOnlyText;
|
|
113
|
+
private _getTextReplacementsVariants;
|
|
114
|
+
private _createDeinflection;
|
|
115
|
+
private _getRelatedDictionaryEntries;
|
|
116
|
+
private _addRelatedDictionaryEntries;
|
|
117
|
+
private _addSecondaryRelatedDictionaryEntries;
|
|
118
|
+
private _groupDictionaryEntriesByHeadword;
|
|
119
|
+
private _groupDictionaryEntriesByTerm;
|
|
120
|
+
private _groupDictionaryEntries;
|
|
121
|
+
private _removeExcludedDefinitions;
|
|
122
|
+
private _removeUnusedHeadwords;
|
|
123
|
+
private _updateDefinitionHeadwordIndices;
|
|
124
|
+
private _updateArrayItemsHeadwordIndex;
|
|
125
|
+
private _removeArrayItemsWithDictionary;
|
|
126
|
+
private _removeArrayItemsWithDictionary2;
|
|
127
|
+
private _removeTagGroupsWithDictionary;
|
|
128
|
+
private _expandTagGroupsAndGroup;
|
|
129
|
+
private _expandTagGroups;
|
|
130
|
+
private _groupTags;
|
|
131
|
+
private _mergeSimilarTags;
|
|
132
|
+
private _getTagNamesWithCategory;
|
|
133
|
+
private _flagRedundantDefinitionTags;
|
|
134
|
+
private _addTermMeta;
|
|
135
|
+
private _addKanjiMeta;
|
|
136
|
+
private _expandKanjiStats;
|
|
137
|
+
private _sortKanjiStats;
|
|
138
|
+
private _convertStringToNumber;
|
|
139
|
+
private _getFrequencyInfo;
|
|
140
|
+
private _getNameBase;
|
|
141
|
+
private _getSecondarySearchDictionaryMap;
|
|
142
|
+
private _getDictionaryOrder;
|
|
143
|
+
private _getDictionaryAlias;
|
|
144
|
+
private _createMapKey;
|
|
145
|
+
private _toNumberArray;
|
|
146
|
+
private _createKanjiStat;
|
|
147
|
+
private _createKanjiFrequency;
|
|
148
|
+
private _createKanjiDictionaryEntry;
|
|
149
|
+
private _createTag;
|
|
150
|
+
private _createSource;
|
|
151
|
+
private _createTermHeadword;
|
|
152
|
+
private _createTermDefinition;
|
|
153
|
+
private _createTermPronunciation;
|
|
154
|
+
private _createTermFrequency;
|
|
155
|
+
private _createTermDictionaryEntry;
|
|
156
|
+
private _createTermDictionaryEntryFromDatabaseEntry;
|
|
157
|
+
private _createGroupedDictionaryEntry;
|
|
158
|
+
private _sortHeadwords;
|
|
159
|
+
private _getHeadwordMatchCounts;
|
|
160
|
+
private _addUniqueSimple;
|
|
161
|
+
private _addUniqueSources;
|
|
162
|
+
private _addTermHeadwords;
|
|
163
|
+
private _addUniqueTermHeadwordIndex;
|
|
164
|
+
private _addTermDefinitionsFast;
|
|
165
|
+
private _addTermDefinitions;
|
|
166
|
+
private _sortDatabaseEntriesByIndex;
|
|
167
|
+
private _sortKanjiDictionaryEntries;
|
|
168
|
+
private _sortTermDictionaryEntries;
|
|
169
|
+
private _sortTermDictionaryEntryDefinitions;
|
|
170
|
+
private _sortTermDictionaryEntriesById;
|
|
171
|
+
private _sortTermDictionaryEntrySimpleData;
|
|
172
|
+
private _sortKanjiDictionaryEntryData;
|
|
173
|
+
private _updateSortFrequencies;
|
|
174
|
+
private _getShortestTextProcessingChainLength;
|
|
175
|
+
private _getShortestInflectionChainLength;
|
|
176
|
+
private _addUserFacingInflections;
|
|
177
|
+
private _hasAny;
|
|
178
|
+
} //#endregion
|
|
179
|
+
export { FindKanjiDictionary, FindKanjiOptions, FindTermDictionary, FindTermsMatchType, FindTermsMode, FindTermsOptions, FindTermsSortOrder, FindTermsTextReplacement, FindTermsTextReplacements, KanjiEnabledDictionaryMap, SearchResolution, TermEnabledDictionaryMap, Translator };
|
|
180
|
+
//# sourceMappingURL=translator-CcA-s-W4.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"translator-CcA-s-W4.d.cts","names":[],"sources":["../src/types/translation.ts","../src/lookup/translator.ts"],"sourcesContent":null,"mappings":";;;;KAEY,gBAAA;KAEA,gBAAA;wBACc;EAHd,2BAAgB,EAAA,OAAA;AAE5B,CAAA;AAKY,KAAA,mBAAA,GAAmB;EAKnB,KAAA,EAAA,MAAA;EAAgB,KAAA,EAAA,MAAA;CAAA;AAMM,KANtB,gBAAA,GAMsB;EAAkB,SAE9B,EAPP,kBAOO;EAAyB,SACrB,EAAA,OAAA;EAAwB,cAChB,EAAA,MAAA;EAAG,cACf,EAAA,MAAA;EAAgB,uBAAA,EAAA,MAAA,GAAA,IAAA;EAI1B,4BAAkB,EATI,kBASJ;EAElB,2BAAkB,EAAA,OAAA;EAElB,gBAAA,EAXU,yBAYT;EAID,oBAAA,EAfc,wBAee;EAE7B,4BAAkB,EAhBI,GAgBJ,CAAA,MAAA,CAAA,GAAA,IAAA;EAQlB,gBAAA,EAvBU,gBAuBc;EAAA,QAAA,EAAA,MAAA;CAAA;AAAG,KAnB3B,kBAAA,GAAkB,mBAmBS;AAAG,KAjB9B,kBAAA,GAiB8B,WAAA,GAAA,YAAA;AAE9B,KAjBA,wBAAA,GAiByB;EAAA,OAAA,EAhBxB,MAgBwB;EAAA,WAAe,EAAA,MAAA;CAAmB;AAA5B,KAZ/B,yBAAA,GAY+B,CAZF,wBAYE,EAAA,GAAA,IAAA,CAAA,EAAA;KAV/B,kBAAA;;;ECkBP,sBAAA,EAAmB,OAAA;EA6CZ,mBAAa,EAAA,OAAA;;;KDvDb,wBAAA,GAA2B,YAAY;ACmMtC,KDjMD,yBAAA,GAA4B,GCiMjB,CAAA,MAAA,EDjM6B,mBCiM7B,CAAA,CAAA;;;;KAzLlB,qBAAA,GAAmB;ADxDZ,KCqGA,aAAA,GDrGgB,OAAA,GAAA,MAAA,GAAA,OAAA,GAAA,QAAA;AAE5B;AAKA;AAKA;AAA4B,cCqOf,UAAA,CDrOe;EAAA,QACb,SAAA;EAAkB,QAKC,yBAAA;EAAkB,QAE9B,SAAA;EAAyB,QACrB,eAAA;EAAwB,QAChB,YAAA;EAAG,QACf,eAAA;EAAgB,QAAA,mBAAA;EAI1B,WAAA,CAAA,QAAA,EC+Nc,YD/NI;EAElB;AAEZ;AAKA;EAEY,OAAA,CAAA,CAAA,EAAA,IAAA;EAQA;;;EAAyD,mBAA9B,CAAA,CAAA,EAAA,IAAA;EAAG;AAE1C;;EAAqC,SAAe,CAAA,IAAA,EC4OtC,aD5OsC,EAAA,IAAA,EAAA,MAAA,EAAA,OAAA,EC4OzB,gBD5OyB,CAAA,EC+O7C,OD/O6C,CAAA;IAAZ,iBAAA,EC+OJ,qBD/OI,EAAA;IAAG,kBAAA,EAAA,MAAA;;;;AChBc;EAqE7C,SAAA,CAAA,IAAA,EAAa,MAAA,EAAA,OAAA,EA0LX,gBA1LW,CAAA,EAiRiD,OAjRjD,CAiR8C,oBAjR9C,EAAA,CAAA;;;;AA4IzB;EAAuB,kBAAA,CAAA,eAAA,EAAA;IASG,IAAA,EAAA,MAAA;IAkCZ,OAAA,EAAA,MAAA,GAAA,IAAA;EAAa,CAAA,EAAA,EAAA,YAAA,EAAA,MAAA,EAAA,CAAA,EAiJpB,OAjJoB,CAAA;IAGS,IAAA,EAAA,MAAA;IAA7B,OAAA,EAAA,MAAA,GAAA,IAAA;IAAO,UAAA,EAAA,MAAA;IAuFyD,UAAA,EAAA,OAAA;IAAG,SAAA,EAAA,MAAA;IAuDnE,YAAA,EAAA,MAAA,GAAA,IAAA;IAAO,kBAAA,EAAA,OAAA"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
//#region src/util/utilities.ts
|
|
4
|
+
/**
|
|
5
|
+
* Reverses a string.
|
|
6
|
+
*/
|
|
7
|
+
function stringReverse(string) {
|
|
8
|
+
return [...string].reverse().join("");
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Creates an unresolved promise that can be resolved later.
|
|
12
|
+
*/
|
|
13
|
+
function deferPromise() {
|
|
14
|
+
let resolve;
|
|
15
|
+
let reject;
|
|
16
|
+
const promise = new Promise((resolve2, reject2) => {
|
|
17
|
+
resolve = resolve2;
|
|
18
|
+
reject = reject2;
|
|
19
|
+
});
|
|
20
|
+
return {
|
|
21
|
+
promise,
|
|
22
|
+
resolve,
|
|
23
|
+
reject
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Checks if a value is a non-null object that is not an array.
|
|
28
|
+
*/
|
|
29
|
+
function isObjectNotArray(value) {
|
|
30
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
//#endregion
|
|
34
|
+
Object.defineProperty(exports, 'deferPromise', {
|
|
35
|
+
enumerable: true,
|
|
36
|
+
get: function () {
|
|
37
|
+
return deferPromise;
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
Object.defineProperty(exports, 'isObjectNotArray', {
|
|
41
|
+
enumerable: true,
|
|
42
|
+
get: function () {
|
|
43
|
+
return isObjectNotArray;
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
Object.defineProperty(exports, 'stringReverse', {
|
|
47
|
+
enumerable: true,
|
|
48
|
+
get: function () {
|
|
49
|
+
return stringReverse;
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
//# sourceMappingURL=utilities-C-lbZaJE.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utilities-C-lbZaJE.cjs","names":["string: string","resolve: ((value: T) => void) | undefined","reject: ((reason?: RejectionReason) => void) | undefined","value: unknown"],"sources":["../src/util/utilities.ts"],"sourcesContent":["import type { DeferredPromiseDetails, RejectionReason, SerializableObject, UnknownObject } from '../types/core';\n\n/**\n * Converts any string into a form that can be passed into the RegExp constructor.\n */\nexport function escapeRegExp(string: string): string {\n return string.replace(/[.*+\\-?^${}()|[\\]\\\\]/g, '\\\\$&');\n}\n\n/**\n * Reverses a string.\n */\nexport function stringReverse(string: string): string {\n return [...string].reverse().join('');\n}\n\n/**\n * Creates a deep clone of an object or value.\n */\nexport function clone<T = unknown>(value: T): T {\n if (value === null) {\n return null as T;\n }\n switch (typeof value) {\n case 'boolean':\n case 'number':\n case 'string':\n case 'bigint':\n case 'symbol':\n case 'undefined':\n return value;\n default:\n return cloneInternal(value, new Set());\n }\n}\n\nfunction cloneInternal<T = unknown>(value: T, visited: Set<unknown>): T {\n if (value === null) {\n return null as T;\n }\n switch (typeof value) {\n case 'boolean':\n case 'number':\n case 'string':\n case 'bigint':\n case 'symbol':\n case 'undefined':\n return value;\n case 'object':\n return (\n Array.isArray(value)\n ? cloneArray(value, visited)\n : cloneObject(value as unknown as SerializableObject, visited)\n ) as T;\n default:\n throw new Error(`Cannot clone object of type ${typeof value}`);\n }\n}\n\nfunction cloneArray(value: unknown[], visited: Set<unknown>): unknown[] {\n if (visited.has(value)) {\n throw new Error('Circular');\n }\n try {\n visited.add(value);\n const result = [];\n for (const item of value) {\n result.push(cloneInternal(item, visited));\n }\n return result;\n } finally {\n visited.delete(value);\n }\n}\n\nfunction cloneObject(value: SerializableObject, visited: Set<unknown>): SerializableObject {\n if (visited.has(value)) {\n throw new Error('Circular');\n }\n try {\n visited.add(value);\n const result: SerializableObject = {};\n for (const key in value) {\n if (Object.prototype.hasOwnProperty.call(value, key)) {\n result[key] = cloneInternal(value[key], visited);\n }\n }\n return result;\n } finally {\n visited.delete(value);\n }\n}\n\n/**\n * Checks if an object or value is deeply equal to another object or value.\n */\nexport function deepEqual(value1: unknown, value2: unknown): boolean {\n if (value1 === value2) {\n return true;\n }\n const type = typeof value1;\n if (typeof value2 !== type) {\n return false;\n }\n switch (type) {\n case 'object':\n case 'function':\n return deepEqualInternal(value1, value2, new Set());\n default:\n return false;\n }\n}\n\nfunction deepEqualInternal(value1: unknown, value2: unknown, visited1: Set<unknown>): boolean {\n if (value1 === value2) {\n return true;\n }\n const type = typeof value1;\n if (typeof value2 !== type) {\n return false;\n }\n switch (type) {\n case 'object':\n case 'function': {\n if (value1 === null || value2 === null) {\n return false;\n }\n const array = Array.isArray(value1);\n if (array !== Array.isArray(value2)) {\n return false;\n }\n if (visited1.has(value1)) {\n return false;\n }\n visited1.add(value1);\n return array\n ? areArraysEqual(value1 as unknown[], value2 as unknown[], visited1)\n : areObjectsEqual(value1 as UnknownObject, value2 as UnknownObject, visited1);\n }\n default:\n return false;\n }\n}\n\nfunction areObjectsEqual(value1: UnknownObject, value2: UnknownObject, visited1: Set<unknown>): boolean {\n const keys1 = Object.keys(value1);\n const keys2 = Object.keys(value2);\n if (keys1.length !== keys2.length) {\n return false;\n }\n const keys1Set = new Set(keys1);\n for (const key of keys2) {\n if (!keys1Set.has(key) || !deepEqualInternal(value1[key], value2[key], visited1)) {\n return false;\n }\n }\n return true;\n}\n\nfunction areArraysEqual(value1: unknown[], value2: unknown[], visited1: Set<unknown>): boolean {\n const length = value1.length;\n if (length !== value2.length) {\n return false;\n }\n for (let i = 0; i < length; ++i) {\n if (!deepEqualInternal(value1[i], value2[i], visited1)) {\n return false;\n }\n }\n return true;\n}\n\n/**\n * Creates a new base-16 string of a sequence of random bytes.\n */\nexport function generateId(length: number): string {\n const array = new Uint8Array(length);\n crypto.getRandomValues(array);\n let id = '';\n for (const value of array) {\n id += value.toString(16).padStart(2, '0');\n }\n return id;\n}\n\n/**\n * Creates an unresolved promise that can be resolved later.\n */\nexport function deferPromise<T = unknown>(): DeferredPromiseDetails<T> {\n let resolve: ((value: T) => void) | undefined;\n let reject: ((reason?: RejectionReason) => void) | undefined;\n const promise = new Promise<T>((resolve2, reject2) => {\n resolve = resolve2;\n reject = reject2;\n });\n return {\n promise,\n resolve: resolve as (value: T) => void,\n reject: reject as (reason?: RejectionReason) => void,\n };\n}\n\n/**\n * Creates a promise that is resolved after a set delay.\n */\nexport function promiseTimeout(delay: number): Promise<void> {\n return delay <= 0\n ? Promise.resolve()\n : new Promise((resolve) => {\n setTimeout(resolve, delay);\n });\n}\n\n/**\n * Checks if a value is a non-null object that is not an array.\n */\nexport function isObjectNotArray(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n"],"mappings":";;;;;;AAYA,SAAgB,cAAcA,QAAwB;AAClD,QAAO,CAAC,GAAG,MAAO,EAAC,SAAS,CAAC,KAAK,GAAG;AACxC;;;;AA8KD,SAAgB,eAAuD;CACnE,IAAIC;CACJ,IAAIC;CACJ,MAAM,UAAU,IAAI,QAAW,CAAC,UAAU,YAAY;AAClD,YAAU;AACV,WAAS;CACZ;AACD,QAAO;EACH;EACS;EACD;CACX;AACJ;;;;AAgBD,SAAgB,iBAAiBC,OAAkD;AAC/E,eAAc,UAAU,YAAY,UAAU,SAAS,MAAM,QAAQ,MAAM;AAC9E"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
//#region src/util/utilities.ts
|
|
2
|
+
/**
|
|
3
|
+
* Reverses a string.
|
|
4
|
+
*/
|
|
5
|
+
function stringReverse(string) {
|
|
6
|
+
return [...string].reverse().join("");
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Creates an unresolved promise that can be resolved later.
|
|
10
|
+
*/
|
|
11
|
+
function deferPromise() {
|
|
12
|
+
let resolve;
|
|
13
|
+
let reject;
|
|
14
|
+
const promise = new Promise((resolve2, reject2) => {
|
|
15
|
+
resolve = resolve2;
|
|
16
|
+
reject = reject2;
|
|
17
|
+
});
|
|
18
|
+
return {
|
|
19
|
+
promise,
|
|
20
|
+
resolve,
|
|
21
|
+
reject
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Checks if a value is a non-null object that is not an array.
|
|
26
|
+
*/
|
|
27
|
+
function isObjectNotArray(value) {
|
|
28
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
//#endregion
|
|
32
|
+
export { deferPromise, isObjectNotArray, stringReverse };
|
|
33
|
+
//# sourceMappingURL=utilities-bi3EF-q5.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utilities-bi3EF-q5.js","names":["string: string","resolve: ((value: T) => void) | undefined","reject: ((reason?: RejectionReason) => void) | undefined","value: unknown"],"sources":["../src/util/utilities.ts"],"sourcesContent":["import type { DeferredPromiseDetails, RejectionReason, SerializableObject, UnknownObject } from '../types/core';\n\n/**\n * Converts any string into a form that can be passed into the RegExp constructor.\n */\nexport function escapeRegExp(string: string): string {\n return string.replace(/[.*+\\-?^${}()|[\\]\\\\]/g, '\\\\$&');\n}\n\n/**\n * Reverses a string.\n */\nexport function stringReverse(string: string): string {\n return [...string].reverse().join('');\n}\n\n/**\n * Creates a deep clone of an object or value.\n */\nexport function clone<T = unknown>(value: T): T {\n if (value === null) {\n return null as T;\n }\n switch (typeof value) {\n case 'boolean':\n case 'number':\n case 'string':\n case 'bigint':\n case 'symbol':\n case 'undefined':\n return value;\n default:\n return cloneInternal(value, new Set());\n }\n}\n\nfunction cloneInternal<T = unknown>(value: T, visited: Set<unknown>): T {\n if (value === null) {\n return null as T;\n }\n switch (typeof value) {\n case 'boolean':\n case 'number':\n case 'string':\n case 'bigint':\n case 'symbol':\n case 'undefined':\n return value;\n case 'object':\n return (\n Array.isArray(value)\n ? cloneArray(value, visited)\n : cloneObject(value as unknown as SerializableObject, visited)\n ) as T;\n default:\n throw new Error(`Cannot clone object of type ${typeof value}`);\n }\n}\n\nfunction cloneArray(value: unknown[], visited: Set<unknown>): unknown[] {\n if (visited.has(value)) {\n throw new Error('Circular');\n }\n try {\n visited.add(value);\n const result = [];\n for (const item of value) {\n result.push(cloneInternal(item, visited));\n }\n return result;\n } finally {\n visited.delete(value);\n }\n}\n\nfunction cloneObject(value: SerializableObject, visited: Set<unknown>): SerializableObject {\n if (visited.has(value)) {\n throw new Error('Circular');\n }\n try {\n visited.add(value);\n const result: SerializableObject = {};\n for (const key in value) {\n if (Object.prototype.hasOwnProperty.call(value, key)) {\n result[key] = cloneInternal(value[key], visited);\n }\n }\n return result;\n } finally {\n visited.delete(value);\n }\n}\n\n/**\n * Checks if an object or value is deeply equal to another object or value.\n */\nexport function deepEqual(value1: unknown, value2: unknown): boolean {\n if (value1 === value2) {\n return true;\n }\n const type = typeof value1;\n if (typeof value2 !== type) {\n return false;\n }\n switch (type) {\n case 'object':\n case 'function':\n return deepEqualInternal(value1, value2, new Set());\n default:\n return false;\n }\n}\n\nfunction deepEqualInternal(value1: unknown, value2: unknown, visited1: Set<unknown>): boolean {\n if (value1 === value2) {\n return true;\n }\n const type = typeof value1;\n if (typeof value2 !== type) {\n return false;\n }\n switch (type) {\n case 'object':\n case 'function': {\n if (value1 === null || value2 === null) {\n return false;\n }\n const array = Array.isArray(value1);\n if (array !== Array.isArray(value2)) {\n return false;\n }\n if (visited1.has(value1)) {\n return false;\n }\n visited1.add(value1);\n return array\n ? areArraysEqual(value1 as unknown[], value2 as unknown[], visited1)\n : areObjectsEqual(value1 as UnknownObject, value2 as UnknownObject, visited1);\n }\n default:\n return false;\n }\n}\n\nfunction areObjectsEqual(value1: UnknownObject, value2: UnknownObject, visited1: Set<unknown>): boolean {\n const keys1 = Object.keys(value1);\n const keys2 = Object.keys(value2);\n if (keys1.length !== keys2.length) {\n return false;\n }\n const keys1Set = new Set(keys1);\n for (const key of keys2) {\n if (!keys1Set.has(key) || !deepEqualInternal(value1[key], value2[key], visited1)) {\n return false;\n }\n }\n return true;\n}\n\nfunction areArraysEqual(value1: unknown[], value2: unknown[], visited1: Set<unknown>): boolean {\n const length = value1.length;\n if (length !== value2.length) {\n return false;\n }\n for (let i = 0; i < length; ++i) {\n if (!deepEqualInternal(value1[i], value2[i], visited1)) {\n return false;\n }\n }\n return true;\n}\n\n/**\n * Creates a new base-16 string of a sequence of random bytes.\n */\nexport function generateId(length: number): string {\n const array = new Uint8Array(length);\n crypto.getRandomValues(array);\n let id = '';\n for (const value of array) {\n id += value.toString(16).padStart(2, '0');\n }\n return id;\n}\n\n/**\n * Creates an unresolved promise that can be resolved later.\n */\nexport function deferPromise<T = unknown>(): DeferredPromiseDetails<T> {\n let resolve: ((value: T) => void) | undefined;\n let reject: ((reason?: RejectionReason) => void) | undefined;\n const promise = new Promise<T>((resolve2, reject2) => {\n resolve = resolve2;\n reject = reject2;\n });\n return {\n promise,\n resolve: resolve as (value: T) => void,\n reject: reject as (reason?: RejectionReason) => void,\n };\n}\n\n/**\n * Creates a promise that is resolved after a set delay.\n */\nexport function promiseTimeout(delay: number): Promise<void> {\n return delay <= 0\n ? Promise.resolve()\n : new Promise((resolve) => {\n setTimeout(resolve, delay);\n });\n}\n\n/**\n * Checks if a value is a non-null object that is not an array.\n */\nexport function isObjectNotArray(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n"],"mappings":";;;;AAYA,SAAgB,cAAcA,QAAwB;AAClD,QAAO,CAAC,GAAG,MAAO,EAAC,SAAS,CAAC,KAAK,GAAG;AACxC;;;;AA8KD,SAAgB,eAAuD;CACnE,IAAIC;CACJ,IAAIC;CACJ,MAAM,UAAU,IAAI,QAAW,CAAC,UAAU,YAAY;AAClD,YAAU;AACV,WAAS;CACZ;AACD,QAAO;EACH;EACS;EACD;CACX;AACJ;;;;AAgBD,SAAgB,iBAAiBC,OAAkD;AAC/E,eAAc,UAAU,YAAY,UAAU,SAAS,MAAM,QAAQ,MAAM;AAC9E"}
|
package/package.json
ADDED
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "yomitan-core",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Core dictionary lookup, language processing, and rendering engine extracted from the Yomitan browser extension.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"engines": {
|
|
7
|
+
"node": ">=18.0.0"
|
|
8
|
+
},
|
|
9
|
+
"license": "GPL-3.0-or-later",
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "git",
|
|
12
|
+
"url": "git+https://github.com/louismollick/yomitan-core.git"
|
|
13
|
+
},
|
|
14
|
+
"exports": {
|
|
15
|
+
".": {
|
|
16
|
+
"import": "./dist/index.js",
|
|
17
|
+
"require": "./dist/index.cjs",
|
|
18
|
+
"types": "./dist/index.d.ts"
|
|
19
|
+
},
|
|
20
|
+
"./database": {
|
|
21
|
+
"import": "./dist/database.js",
|
|
22
|
+
"require": "./dist/database.cjs",
|
|
23
|
+
"types": "./dist/database.d.ts"
|
|
24
|
+
},
|
|
25
|
+
"./import": {
|
|
26
|
+
"import": "./dist/import.js",
|
|
27
|
+
"require": "./dist/import.cjs",
|
|
28
|
+
"types": "./dist/import.d.ts"
|
|
29
|
+
},
|
|
30
|
+
"./lookup": {
|
|
31
|
+
"import": "./dist/lookup.js",
|
|
32
|
+
"require": "./dist/lookup.cjs",
|
|
33
|
+
"types": "./dist/lookup.d.ts"
|
|
34
|
+
},
|
|
35
|
+
"./language": {
|
|
36
|
+
"import": "./dist/language.js",
|
|
37
|
+
"require": "./dist/language.cjs",
|
|
38
|
+
"types": "./dist/language.d.ts"
|
|
39
|
+
},
|
|
40
|
+
"./anki": {
|
|
41
|
+
"import": "./dist/anki.js",
|
|
42
|
+
"require": "./dist/anki.cjs",
|
|
43
|
+
"types": "./dist/anki.d.ts"
|
|
44
|
+
},
|
|
45
|
+
"./render": {
|
|
46
|
+
"import": "./dist/render.js",
|
|
47
|
+
"require": "./dist/render.cjs",
|
|
48
|
+
"types": "./dist/render.d.ts"
|
|
49
|
+
},
|
|
50
|
+
"./audio": {
|
|
51
|
+
"import": "./dist/audio.js",
|
|
52
|
+
"require": "./dist/audio.cjs",
|
|
53
|
+
"types": "./dist/audio.d.ts"
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
"main": "./dist/index.cjs",
|
|
57
|
+
"module": "./dist/index.js",
|
|
58
|
+
"types": "./dist/index.d.ts",
|
|
59
|
+
"files": [
|
|
60
|
+
"dist",
|
|
61
|
+
"README.md",
|
|
62
|
+
"LICENSE"
|
|
63
|
+
],
|
|
64
|
+
"scripts": {
|
|
65
|
+
"build": "tsdown",
|
|
66
|
+
"dev": "tsdown --watch",
|
|
67
|
+
"test": "vitest run",
|
|
68
|
+
"test:watch": "vitest",
|
|
69
|
+
"lint": "biome check .",
|
|
70
|
+
"lint:fix": "biome check --fix .",
|
|
71
|
+
"format": "biome format --write .",
|
|
72
|
+
"typecheck": "tsc --noEmit",
|
|
73
|
+
"prepublishOnly": "npm run build"
|
|
74
|
+
},
|
|
75
|
+
"dependencies": {
|
|
76
|
+
"@zip.js/zip.js": "^2.7.54",
|
|
77
|
+
"ajv": "^8.17.1",
|
|
78
|
+
"dexie": "^4.0.10",
|
|
79
|
+
"yomitan-handlebars": "git+https://github.com/yomidevs/yomitan-handlebars.git#12aff5e3550954d7d3a98a5917ff7d579f3cce25"
|
|
80
|
+
},
|
|
81
|
+
"optionalDependencies": {
|
|
82
|
+
"@resvg/resvg-wasm": "^2.6.2",
|
|
83
|
+
"hangul-js": "^0.2.6",
|
|
84
|
+
"kanji-processor": "^1.0.2"
|
|
85
|
+
},
|
|
86
|
+
"peerDependencies": {
|
|
87
|
+
"linkedom": "^0.18.10"
|
|
88
|
+
},
|
|
89
|
+
"peerDependenciesMeta": {
|
|
90
|
+
"linkedom": {
|
|
91
|
+
"optional": true
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
"devDependencies": {
|
|
95
|
+
"@biomejs/biome": "^1.9.4",
|
|
96
|
+
"fake-indexeddb": "^6.0.0",
|
|
97
|
+
"jsdom": "^25.0.1",
|
|
98
|
+
"tsdown": "^0.9.0",
|
|
99
|
+
"typescript": "^5.7.2",
|
|
100
|
+
"vitest": "^3.0.9"
|
|
101
|
+
}
|
|
102
|
+
}
|