nko-kit 0.0.0-stage → 0.2.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/dist/text.js ADDED
@@ -0,0 +1,121 @@
1
+ import { NASALIZATION, NKO_RANGE_END, NKO_RANGE_START, TONE_MARKS, } from "./chars.js";
2
+ const NKO_DIGIT_ZERO = 0x07c0;
3
+ function isNkoCodePoint(cp) {
4
+ return cp >= NKO_RANGE_START && cp <= NKO_RANGE_END;
5
+ }
6
+ /** True if the text contains at least one N'Ko character. */
7
+ export function containsNko(text) {
8
+ for (const ch of text) {
9
+ if (isNkoCodePoint(ch.codePointAt(0)))
10
+ return true;
11
+ }
12
+ return false;
13
+ }
14
+ /**
15
+ * True if every letter of the text is N'Ko. Spaces, digits and
16
+ * punctuation are ignored.
17
+ */
18
+ export function isNko(text) {
19
+ let letters = 0;
20
+ for (const ch of text) {
21
+ const cp = ch.codePointAt(0);
22
+ if (isNkoCodePoint(cp)) {
23
+ letters++;
24
+ continue;
25
+ }
26
+ if (/\p{L}/u.test(ch))
27
+ return false;
28
+ }
29
+ return letters > 0;
30
+ }
31
+ /**
32
+ * Puts combining marks in canonical order (nasalization before tone)
33
+ * so that two spellings of the same word compare equal.
34
+ */
35
+ export function normalizeNko(text) {
36
+ return text.normalize("NFC");
37
+ }
38
+ /** Removes tone marks, keeps nasalization. Useful for search. */
39
+ export function stripTones(text) {
40
+ let out = "";
41
+ for (const ch of text) {
42
+ if (ch in TONE_MARKS)
43
+ continue;
44
+ out += ch;
45
+ }
46
+ return out;
47
+ }
48
+ /** Removes tone marks and nasalization. */
49
+ export function stripDiacritics(text) {
50
+ return stripTones(text).split(NASALIZATION).join("");
51
+ }
52
+ /** ߁߉߄߉ → 1949 */
53
+ export function toLatinDigits(text) {
54
+ return text.replace(/[\u07C0-\u07C9]/g, (d) => String(d.charCodeAt(0) - NKO_DIGIT_ZERO));
55
+ }
56
+ /** 1949 → ߁߉߄߉ */
57
+ export function toNkoDigits(text) {
58
+ return text.replace(/[0-9]/g, (d) => String.fromCharCode(NKO_DIGIT_ZERO + Number(d)));
59
+ }
60
+ /**
61
+ * Wraps N'Ko text in Unicode directional isolates (RLI … PDI) so it
62
+ * displays right-to-left correctly inside left-to-right text, as the
63
+ * W3C recommends.
64
+ */
65
+ export function isolateRtl(text) {
66
+ return `\u2067${text}\u2069`;
67
+ }
68
+ /**
69
+ * Unicode blocks of right-to-left scripts. Every letter inside them is
70
+ * right-to-left and every letter outside is not (checked against the
71
+ * Unicode 17 character database).
72
+ */
73
+ const RTL_BLOCKS = [
74
+ [0x0590, 0x08ff], // Hebrew, Arabic, Syriac, Thaana, N'Ko, Samaritan, Mandaic
75
+ [0xfb1d, 0xfdff], // Hebrew and Arabic presentation forms
76
+ [0xfe70, 0xfeff], // Arabic presentation forms B
77
+ [0x10800, 0x10fff], // Garay, Hanifi Rohingya, Yezidi and older scripts
78
+ [0x1e800, 0x1efff], // Adlam, Mende Kikakui, Arabic mathematical letters
79
+ ];
80
+ const LETTER = /\p{L}/u;
81
+ /** Modifier letters that are neutral for the bidi algorithm (Unicode 17). */
82
+ const NEUTRAL_LETTER = /[\u02B9\u02BA\u02C6-\u02CF\u02EC\u0374\u2E2F\uA67F\uA717-\uA71F\uA788]/u;
83
+ function isRtlBlock(cp) {
84
+ return RTL_BLOCKS.some(([start, end]) => cp >= start && cp <= end);
85
+ }
86
+ /**
87
+ * Direction of a text from its first strong character, like the HTML
88
+ * attribute dir="auto" and rule P2 of the Unicode bidi algorithm: N'Ko,
89
+ * Arabic, Hebrew, Adlam… give "rtl", Latin and other letters give "ltr".
90
+ * N'Ko and Adlam digits and the marks LRM, RLM and ALM also decide; other
91
+ * digits, punctuation, emoji and text inside directional isolates are
92
+ * skipped. A text with no strong character gives "neutral".
93
+ */
94
+ export function textDirection(text) {
95
+ let isolates = 0;
96
+ for (const ch of text) {
97
+ const cp = ch.codePointAt(0);
98
+ if (cp >= 0x2066 && cp <= 0x2068) {
99
+ isolates++; // LRI, RLI, FSI
100
+ continue;
101
+ }
102
+ if (cp === 0x2069) {
103
+ if (isolates > 0)
104
+ isolates--; // PDI
105
+ continue;
106
+ }
107
+ if (isolates > 0)
108
+ continue;
109
+ if (cp === 0x200e)
110
+ return "ltr"; // LEFT-TO-RIGHT MARK
111
+ if (cp === 0x200f || cp === 0x061c)
112
+ return "rtl"; // RIGHT-TO-LEFT MARK, ARABIC LETTER MARK
113
+ if ((cp >= 0x07c0 && cp <= 0x07c9) || (cp >= 0x1e950 && cp <= 0x1e959)) {
114
+ return "rtl"; // N'Ko and Adlam digits are strong right-to-left
115
+ }
116
+ if (!LETTER.test(ch) || NEUTRAL_LETTER.test(ch))
117
+ continue;
118
+ return isRtlBlock(cp) ? "rtl" : "ltr";
119
+ }
120
+ return "neutral";
121
+ }
@@ -0,0 +1,31 @@
1
+ export interface ToLatinOptions {
2
+ /**
3
+ * "none" (default): no tones, like everyday Latin Bambara.
4
+ * "accents": tones as accents (á high, à low, ǎ rising).
5
+ */
6
+ tones?: "none" | "accents";
7
+ /**
8
+ * With tones: "accents", also write the default short falling tone
9
+ * (unmarked in N'Ko) as â. Off by default.
10
+ */
11
+ markFalling?: boolean;
12
+ /** Convert N'Ko digits to 0-9. Default true. */
13
+ digits?: boolean;
14
+ }
15
+ export interface Warning {
16
+ /**
17
+ * Index of the character the warning is about, counted in code points
18
+ * of the source text after NFC normalization.
19
+ */
20
+ index: number;
21
+ char: string;
22
+ message: string;
23
+ }
24
+ export interface ToLatinResult {
25
+ text: string;
26
+ warnings: Warning[];
27
+ }
28
+ /** N'Ko → Latin Bambara, with warnings for uncertain letters. */
29
+ export declare function toLatinDetailed(source: string, options?: ToLatinOptions): ToLatinResult;
30
+ /** N'Ko → Latin Bambara. */
31
+ export declare function toLatin(source: string, options?: ToLatinOptions): string;
@@ -0,0 +1,124 @@
1
+ import { AMBIGUOUS_LETTERS, CONSONANTS, DAGBASINNA, DOUBLE_DOT_ABOVE, DROPPED, LATIN_TONE_ACCENTS, NASALIZATION, PUNCTUATION, SYLLABIC_N, TONE_MARKS, VOWELS, } from "./chars.js";
2
+ import { toLatinDigits } from "./text.js";
3
+ function tokenize(source) {
4
+ const chars = Array.from(source.normalize("NFC"));
5
+ const units = [];
6
+ for (let i = 0; i < chars.length; i++) {
7
+ const ch = chars[i];
8
+ const start = i;
9
+ if (ch in VOWELS || ch === SYLLABIC_N) {
10
+ let tone;
11
+ let nasal = false;
12
+ while (i + 1 < chars.length) {
13
+ const next = chars[i + 1];
14
+ if (next in TONE_MARKS)
15
+ tone = TONE_MARKS[next];
16
+ else if (next === NASALIZATION)
17
+ nasal = true;
18
+ else if (next === DOUBLE_DOT_ABOVE) {
19
+ /* ignored on vowels */
20
+ }
21
+ else
22
+ break;
23
+ i++;
24
+ }
25
+ units.push(ch === SYLLABIC_N
26
+ ? { kind: "syllabicN", tone, nasal, index: start }
27
+ : { kind: "vowel", base: VOWELS[ch], tone, nasal, index: start });
28
+ }
29
+ else if (ch in CONSONANTS) {
30
+ let dotted = false;
31
+ while (i + 1 < chars.length && chars[i + 1] === DOUBLE_DOT_ABOVE) {
32
+ dotted = true;
33
+ i++;
34
+ }
35
+ units.push({ kind: "consonant", base: ch, dotted, index: start });
36
+ }
37
+ else if (ch === DAGBASINNA) {
38
+ units.push({ kind: "noVowel", index: i });
39
+ }
40
+ else if (DROPPED.has(ch)) {
41
+ continue;
42
+ }
43
+ else {
44
+ units.push({ kind: "other", text: PUNCTUATION[ch] ?? ch, index: i });
45
+ }
46
+ }
47
+ return units;
48
+ }
49
+ function accentFor(tone, opts) {
50
+ if (opts.tones !== "accents")
51
+ return "";
52
+ if (!tone)
53
+ return opts.markFalling ? LATIN_TONE_ACCENTS.falling : "";
54
+ return LATIN_TONE_ACCENTS[tone.tone];
55
+ }
56
+ function writeVowel(base, tone, nasal, opts) {
57
+ const accent = accentFor(tone, opts);
58
+ const long = tone?.long ? base : "";
59
+ return base + accent + long + (nasal ? "n" : "");
60
+ }
61
+ /**
62
+ * In N'Ko, when two syllables in a row share the same vowel, the first
63
+ * vowel is not written: ߓߡߊߣߊ߲ is read "bamanan". This finds the vowel
64
+ * a bare consonant borrows from the next syllable.
65
+ */
66
+ function borrowedVowel(units, from) {
67
+ const next = units[from + 1];
68
+ if (!next || next.kind !== "consonant")
69
+ return undefined;
70
+ for (let j = from + 1; j < units.length; j++) {
71
+ const u = units[j];
72
+ if (u.kind === "vowel")
73
+ return u;
74
+ if (u.kind !== "consonant")
75
+ return undefined;
76
+ }
77
+ return undefined;
78
+ }
79
+ /** N'Ko → Latin Bambara, with warnings for uncertain letters. */
80
+ export function toLatinDetailed(source, options = {}) {
81
+ const opts = { tones: "none", digits: true, ...options };
82
+ const units = tokenize(source);
83
+ const warnings = [];
84
+ let out = "";
85
+ units.forEach((u, idx) => {
86
+ switch (u.kind) {
87
+ case "vowel":
88
+ out += writeVowel(u.base, u.tone, u.nasal, opts);
89
+ break;
90
+ case "syllabicN":
91
+ out += "n" + accentFor(u.tone, opts) + (u.nasal ? "n" : "");
92
+ break;
93
+ case "consonant": {
94
+ out += CONSONANTS[u.base];
95
+ if (AMBIGUOUS_LETTERS.has(u.base) || u.dotted) {
96
+ warnings.push({
97
+ index: u.index,
98
+ char: u.base,
99
+ message: u.dotted
100
+ ? "Letter with double dot (borrowed sound): check the reading."
101
+ : "This letter can be read several ways depending on the dialect.",
102
+ });
103
+ }
104
+ const borrowed = borrowedVowel(units, idx);
105
+ if (borrowed && borrowed.kind === "vowel") {
106
+ out += writeVowel(borrowed.base, borrowed.tone, false, opts);
107
+ }
108
+ break;
109
+ }
110
+ case "noVowel":
111
+ break;
112
+ case "other":
113
+ out += u.text;
114
+ break;
115
+ }
116
+ });
117
+ if (opts.digits)
118
+ out = toLatinDigits(out);
119
+ return { text: out.normalize("NFC"), warnings };
120
+ }
121
+ /** N'Ko → Latin Bambara. */
122
+ export function toLatin(source, options = {}) {
123
+ return toLatinDetailed(source, options).text;
124
+ }
@@ -0,0 +1,48 @@
1
+ import type { Warning } from "./toLatin.js";
2
+ export interface ToNkoOptions {
3
+ /** Convert 0-9 to N'Ko digits. Default true. */
4
+ digits?: boolean;
5
+ /**
6
+ * Drop a repeated vowel the way N'Ko writing does: when two adjacent
7
+ * consonants are followed by the same vowel, the vowel after the first
8
+ * consonant is not written ("bolo" → ߓߟߏ). Default false.
9
+ *
10
+ * Source: Richard Ishida, N'Ko orthography notes, "Vowel absence",
11
+ * https://r12a.github.io/scripts/nkoo/nqo.html. The rule does not apply
12
+ * when the two consonants are the same ("fafa" → ߝߊߝߊ). The source says
13
+ * nothing about tones, nasal vowels, long vowels or chains, so in those
14
+ * cases the vowel is kept: nasal or long vowels, different tones, a tone
15
+ * given on only one of the two vowels, and a vowel whose following
16
+ * syllable already lost its own. When neither vowel has a tone, the
17
+ * vowel is dropped with a warning, because the two tones could differ.
18
+ */
19
+ elideVowels?: boolean;
20
+ /**
21
+ * Read the older Latin spellings è for ɛ and ò for ɔ. A grave accent on
22
+ * e or o then marks the vowel, not a low tone. Default false.
23
+ *
24
+ * Source: An ka taa, "Bambara's Latin Alphabet", notes 8 and 9,
25
+ * https://kalan.ankataa.com/bambara-beg/grammar-i/bambaras-latin-alphabet.
26
+ */
27
+ legacyLatin?: boolean;
28
+ }
29
+ export interface ToNkoResult {
30
+ text: string;
31
+ warnings: Warning[];
32
+ /**
33
+ * Number of vowels written without a tone mark because the Latin
34
+ * text did not give the tone. A fluent writer has to add them.
35
+ */
36
+ missingTones: number;
37
+ }
38
+ /**
39
+ * Latin Bambara → N'Ko, assisted mode.
40
+ *
41
+ * Everyday Latin Bambara does not write tones, but N'Ko must. Tones
42
+ * given as accents (á à ǎ â) are converted; every other vowel is left
43
+ * unmarked and counted in `missingTones` so a person can finish the job.
44
+ * All vowels are written in full unless `elideVowels` is set.
45
+ */
46
+ export declare function toNkoDetailed(source: string, options?: ToNkoOptions): ToNkoResult;
47
+ /** Latin Bambara → N'Ko (assisted mode, see toNkoDetailed). */
48
+ export declare function toNko(source: string, options?: ToNkoOptions): string;
package/dist/toNko.js ADDED
@@ -0,0 +1,242 @@
1
+ import { NASALIZATION, SYLLABIC_N } from "./chars.js";
2
+ import { toNkoDigits } from "./text.js";
3
+ const LATIN_VOWELS = {
4
+ a: "ߊ",
5
+ e: "ߋ",
6
+ i: "ߌ",
7
+ "ɛ": "ߍ",
8
+ u: "ߎ",
9
+ o: "ߏ",
10
+ "ɔ": "ߐ",
11
+ };
12
+ const LATIN_CONSONANTS = {
13
+ b: "ߓ",
14
+ p: "ߔ",
15
+ t: "ߕ",
16
+ j: "ߖ",
17
+ c: "ߗ",
18
+ d: "ߘ",
19
+ r: "ߙ",
20
+ s: "ߛ",
21
+ g: "ߜ",
22
+ f: "ߝ",
23
+ k: "ߞ",
24
+ l: "ߟ",
25
+ m: "ߡ",
26
+ "ɲ": "ߢ",
27
+ n: "ߣ",
28
+ h: "ߤ",
29
+ w: "ߥ",
30
+ y: "ߦ",
31
+ };
32
+ const PUNCT = {
33
+ ",": "߸",
34
+ "!": "߹",
35
+ "?": "؟",
36
+ ";": "؛",
37
+ };
38
+ const GRAVE = "̀";
39
+ const ACCENT_TONES = {
40
+ "́": "high",
41
+ [GRAVE]: "low",
42
+ "̌": "rising",
43
+ "̂": "falling",
44
+ };
45
+ const SHORT_MARKS = {
46
+ high: "߫",
47
+ low: "߬",
48
+ rising: "߭",
49
+ falling: "", // short falling is the unmarked form
50
+ };
51
+ const LONG_MARKS = {
52
+ high: "߯",
53
+ low: "߰",
54
+ rising: "߱",
55
+ falling: "߮",
56
+ };
57
+ const isVowel = (c) => c !== undefined && c in LATIN_VOWELS;
58
+ const isLetter = (c) => c !== undefined && /\p{L}/u.test(c);
59
+ /**
60
+ * Applies the repeated-vowel rule (see ToNkoOptions.elideVowels). Works
61
+ * from the end so that a vowel is only dropped before a vowel that stays.
62
+ */
63
+ function dropRepeatedVowels(units, warnings) {
64
+ for (let k = units.length - 4; k >= 0; k--) {
65
+ const c1 = units[k];
66
+ const v1 = units[k + 1];
67
+ const c2 = units[k + 2];
68
+ const v2 = units[k + 3];
69
+ if (c1?.kind !== "consonant" || v1?.kind !== "vowel")
70
+ continue;
71
+ if (c2?.kind !== "consonant" || v2?.kind !== "vowel")
72
+ continue;
73
+ if (c1.nko === c2.nko || v1.latin !== v2.latin || v2.dropped)
74
+ continue;
75
+ if (v1.long || v2.long || v1.nasal || v2.nasal || v1.tone !== v2.tone)
76
+ continue;
77
+ v1.dropped = true;
78
+ if (v1.tone === undefined) {
79
+ warnings.push({
80
+ index: v1.index,
81
+ char: v1.latin,
82
+ message: "Vowel dropped assuming both syllables have the same tone: check.",
83
+ });
84
+ }
85
+ }
86
+ }
87
+ /**
88
+ * Latin Bambara → N'Ko, assisted mode.
89
+ *
90
+ * Everyday Latin Bambara does not write tones, but N'Ko must. Tones
91
+ * given as accents (á à ǎ â) are converted; every other vowel is left
92
+ * unmarked and counted in `missingTones` so a person can finish the job.
93
+ * All vowels are written in full unless `elideVowels` is set.
94
+ */
95
+ export function toNkoDetailed(source, options = {}) {
96
+ const opts = { digits: true, elideVowels: false, legacyLatin: false, ...options };
97
+ // Work on decomposed, lower-case text so accents can be read as tone
98
+ // marks, but remember where each piece came from in the NFC text so
99
+ // warning indices match what toLatinDetailed reports.
100
+ const chars = [];
101
+ const origin = [];
102
+ Array.from(source.normalize("NFC")).forEach((ch, pos) => {
103
+ for (const piece of ch.normalize("NFD").toLowerCase()) {
104
+ chars.push(piece);
105
+ origin.push(pos);
106
+ }
107
+ });
108
+ const warnings = [];
109
+ const units = [];
110
+ const readTone = (i) => {
111
+ let tone;
112
+ while (i < chars.length && ACCENT_TONES[chars[i]] !== undefined) {
113
+ tone = ACCENT_TONES[chars[i]];
114
+ i++;
115
+ }
116
+ return [tone, i];
117
+ };
118
+ /** The Latin vowel letter at i and the index after it, if there is one. */
119
+ const readVowel = (i) => {
120
+ const c = chars[i];
121
+ if (c === undefined || !isVowel(c))
122
+ return undefined;
123
+ if (opts.legacyLatin && (c === "e" || c === "o") && chars[i + 1] === GRAVE) {
124
+ return [c === "e" ? "ɛ" : "ɔ", i + 2];
125
+ }
126
+ return [c, i + 1];
127
+ };
128
+ let i = 0;
129
+ while (i < chars.length) {
130
+ const c = chars[i];
131
+ const prev = chars[i - 1];
132
+ const vowel = readVowel(i);
133
+ if (vowel) {
134
+ const [latin, afterLetter] = vowel;
135
+ let [tone, j] = readTone(afterLetter);
136
+ let long = false;
137
+ const second = readVowel(j);
138
+ if (second && second[0] === latin) {
139
+ long = true;
140
+ const [tone2, k] = readTone(second[1]);
141
+ tone = tone ?? tone2;
142
+ j = k;
143
+ }
144
+ let nasal = false;
145
+ if (chars[j] === "n" && !isVowel(chars[j + 1]) && chars[j + 1] !== "y") {
146
+ nasal = true;
147
+ j++;
148
+ }
149
+ units.push({ kind: "vowel", latin, tone, long, nasal, index: origin[i], dropped: false });
150
+ i = j;
151
+ continue;
152
+ }
153
+ // Syllabic n: a word-initial n before a consonant, or n alone.
154
+ if (c === "n" && !isLetter(prev) && !isVowel(chars[i + 1]) && chars[i + 1] !== "y") {
155
+ const [tone, j] = readTone(i + 1);
156
+ units.push({ kind: "text", nko: SYLLABIC_N + (tone ? SHORT_MARKS[tone] : "") });
157
+ i = j;
158
+ continue;
159
+ }
160
+ const two = c + (chars[i + 1] ?? "");
161
+ if (two === "ny" && isVowel(chars[i + 2])) {
162
+ units.push({ kind: "consonant", nko: "ߢ" });
163
+ i += 2;
164
+ continue;
165
+ }
166
+ if (two === "rr") {
167
+ units.push({ kind: "consonant", nko: "ߚ" });
168
+ i += 2;
169
+ continue;
170
+ }
171
+ if (two === "gb") {
172
+ units.push({ kind: "consonant", nko: "ߜ" });
173
+ i += 2;
174
+ continue;
175
+ }
176
+ if (two === "sh") {
177
+ warnings.push({ index: origin[i], char: "sh", message: "'sh' written as ߛ (s): check." });
178
+ units.push({ kind: "consonant", nko: "ߛ" });
179
+ i += 2;
180
+ continue;
181
+ }
182
+ if (c === "ŋ") {
183
+ warnings.push({ index: origin[i], char: c, message: "'ŋ' written as ߒ: check." });
184
+ units.push({ kind: "text", nko: SYLLABIC_N });
185
+ i++;
186
+ continue;
187
+ }
188
+ if (c in LATIN_CONSONANTS) {
189
+ units.push({ kind: "consonant", nko: LATIN_CONSONANTS[c] });
190
+ i++;
191
+ continue;
192
+ }
193
+ if (c in PUNCT) {
194
+ units.push({ kind: "text", nko: PUNCT[c] });
195
+ i++;
196
+ continue;
197
+ }
198
+ if (isLetter(c)) {
199
+ warnings.push({
200
+ index: origin[i],
201
+ char: c,
202
+ message: `No N'Ko letter for '${c}' yet: left as is.`,
203
+ });
204
+ }
205
+ units.push({ kind: "text", nko: c });
206
+ i++;
207
+ }
208
+ if (opts.elideVowels)
209
+ dropRepeatedVowels(units, warnings);
210
+ let out = "";
211
+ let missingTones = 0;
212
+ for (const u of units) {
213
+ if (u.kind !== "vowel") {
214
+ out += u.nko;
215
+ continue;
216
+ }
217
+ if (u.dropped)
218
+ continue;
219
+ let mark = "";
220
+ if (u.tone)
221
+ mark = u.long ? LONG_MARKS[u.tone] : SHORT_MARKS[u.tone];
222
+ else {
223
+ missingTones++;
224
+ if (u.long) {
225
+ warnings.push({
226
+ index: u.index,
227
+ char: u.latin,
228
+ message: "Long vowel without a tone: the tone mark must be added by hand.",
229
+ });
230
+ }
231
+ }
232
+ out += LATIN_VOWELS[u.latin] + (u.nasal ? NASALIZATION : "") + mark;
233
+ }
234
+ if (opts.digits)
235
+ out = toNkoDigits(out);
236
+ warnings.sort((a, b) => a.index - b.index);
237
+ return { text: out.normalize("NFC"), warnings, missingTones };
238
+ }
239
+ /** Latin Bambara → N'Ko (assisted mode, see toNkoDetailed). */
240
+ export function toNko(source, options = {}) {
241
+ return toNkoDetailed(source, options).text;
242
+ }
package/package.json CHANGED
@@ -1,6 +1,60 @@
1
1
  {
2
2
  "name": "nko-kit",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.2.0",
4
+ "description": "N'Ko and Bambara toolkit: N'Ko ↔ Latin transliteration, tones, digits, RTL helpers. Zero dependencies.",
5
+ "keywords": [
6
+ "nko",
7
+ "n'ko",
8
+ "bambara",
9
+ "bamanankan",
10
+ "manding",
11
+ "mali",
12
+ "transliteration",
13
+ "rtl",
14
+ "africa"
15
+ ],
16
+ "author": "Hamed Domo Ouologuem",
17
+ "license": "MIT",
18
+ "repository": {
19
+ "type": "git",
20
+ "url": "git+https://github.com/MomoOuologuem/nko-kit.git"
21
+ },
22
+ "type": "module",
23
+ "main": "./dist/cjs/index.js",
24
+ "module": "./dist/index.js",
25
+ "types": "./dist/index.d.ts",
26
+ "exports": {
27
+ ".": {
28
+ "import": {
29
+ "types": "./dist/index.d.ts",
30
+ "default": "./dist/index.js"
31
+ },
32
+ "require": {
33
+ "types": "./dist/cjs/index.d.ts",
34
+ "default": "./dist/cjs/index.js"
35
+ }
36
+ },
37
+ "./package.json": "./package.json"
38
+ },
39
+ "files": [
40
+ "dist"
41
+ ],
42
+ "sideEffects": false,
43
+ "engines": {
44
+ "node": ">=18"
45
+ },
46
+ "directories": {
47
+ "test": "test"
48
+ },
49
+ "scripts": {
50
+ "build": "node scripts/clean.mjs && tsc -p tsconfig.json && tsc -p tsconfig.cjs.json && node scripts/mark-cjs.mjs",
51
+ "test": "vitest run",
52
+ "prepublishOnly": "npm run build && npm test && npm run test:dist",
53
+ "clean": "node scripts/clean.mjs",
54
+ "test:dist": "node scripts/check-dist.mjs"
55
+ },
56
+ "devDependencies": {
57
+ "typescript": "^5.9.3",
58
+ "vitest": "^2.1.9"
59
+ }
60
+ }