@jackens/nnn 2026.2.19 → 2026.2.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. package/nnn.d.ts +31 -31
  2. package/nnn.js +130 -130
  3. package/package.json +9 -8
  4. package/readme.md +139 -172
package/nnn.js CHANGED
@@ -1,42 +1,42 @@
1
- // src/nnn/is_array.ts
2
- var is_array = Array.isArray;
1
+ // src/nnn/isArray.ts
2
+ var isArray = Array.isArray;
3
3
 
4
- // src/nnn/is_number.ts
5
- var is_number = (arg) => typeof arg === "number";
4
+ // src/nnn/isNumber.ts
5
+ var isNumber = (arg) => typeof arg === "number";
6
6
 
7
- // src/nnn/is_string.ts
8
- var is_string = (arg) => typeof arg === "string";
7
+ // src/nnn/isString.ts
8
+ var isString = (arg) => typeof arg === "string";
9
9
 
10
10
  // src/nnn/c.ts
11
11
  var _c = (node, prefix, result, splitter) => {
12
12
  const queue = [[node, prefix]];
13
13
  while (queue.length > 0) {
14
- const [style_0, prefix_0] = queue.shift();
15
- if (style_0 == null || prefix_0 == null) {
14
+ const [style0, prefix0] = queue.shift();
15
+ if (style0 == null || prefix0 == null) {
16
16
  continue;
17
17
  }
18
- if (is_array(style_0)) {
19
- result.push(prefix_0, prefix_0 !== "" ? "{" : "", style_0.join(";"), prefix_0 !== "" ? "}" : "");
18
+ if (isArray(style0)) {
19
+ result.push(prefix0, prefix0 !== "" ? "{" : "", style0.join(";"), prefix0 !== "" ? "}" : "");
20
20
  } else {
21
21
  const todo = [];
22
22
  let attributes = [];
23
- let attributes_pushed = false;
24
- for (const key in style_0) {
25
- const value = style_0[key];
26
- if (is_string(value) || is_number(value)) {
27
- if (!attributes_pushed) {
28
- attributes_pushed = true;
23
+ let attributesPushed = false;
24
+ for (const key in style0) {
25
+ const value = style0[key];
26
+ if (isString(value) || isNumber(value)) {
27
+ if (!attributesPushed) {
28
+ attributesPushed = true;
29
29
  attributes = [];
30
- todo.push([attributes, prefix_0]);
30
+ todo.push([attributes, prefix0]);
31
31
  }
32
32
  const attribute = key.split(splitter)[0].replace(/_/g, "-").replace(/([A-Z])/g, (_, letter) => "-" + letter.toLowerCase());
33
33
  attributes.push(`${attribute}:${value}`);
34
34
  } else if (value != null) {
35
- attributes_pushed = false;
36
- const prefix_n = [];
37
- const key_chunks = key.split(",");
38
- prefix_0.split(",").forEach((prefix_chunk) => key_chunks.forEach((key_chunk) => prefix_n.push(prefix_chunk + key_chunk)));
39
- todo.push([value, prefix_n.join()]);
35
+ attributesPushed = false;
36
+ const prefixN = [];
37
+ const keyChunks = key.split(",");
38
+ prefix0.split(",").forEach((prefixChunk) => keyChunks.forEach((keyChunk) => prefixN.push(prefixChunk + keyChunk)));
39
+ todo.push([value, prefixN.join()]);
40
40
  }
41
41
  }
42
42
  queue.unshift(...todo);
@@ -59,44 +59,44 @@ var c = (root, splitter = "$$") => {
59
59
  }
60
60
  return chunks.join("");
61
61
  };
62
- // src/nnn/csv_parse.ts
62
+ // src/nnn/csvParse.ts
63
63
  var MAIN_PATTERN = /\n|(?<!")("(?:[^"]|"")*")(?!")/g;
64
- var csv_parse = (csv, separator = ",") => {
65
- const line_pattern = new RegExp(`${separator}|(?<!")\\s*"((?:[^"]|"")*)"\\s*(?!")`, "g");
66
- return csv.replace(/\r/g, "").replace(/\n+$/, "").replace(MAIN_PATTERN, (_, chunk) => chunk ?? "\r").split("\r").map((line) => line.replace(line_pattern, (_, chunk) => chunk == null ? "\r" : chunk.replace(/""/g, '"')).split("\r"));
64
+ var csvParse = (csv, separator = ",") => {
65
+ const linePattern = new RegExp(`${separator}|(?<!")\\s*"((?:[^"]|"")*)"\\s*(?!")`, "g");
66
+ return csv.replace(/\r/g, "").replace(/\n+$/, "").replace(MAIN_PATTERN, (_, chunk) => chunk ?? "\r").split("\r").map((line) => line.replace(linePattern, (_, chunk) => chunk == null ? "\r" : chunk.replace(/""/g, '"')).split("\r"));
67
67
  };
68
- // src/nnn/is_record.ts
69
- var is_record = (arg) => typeof arg === "object" && arg != null && !is_array(arg);
68
+ // src/nnn/isRecord.ts
69
+ var isRecord = (arg) => typeof arg === "object" && arg != null && !isArray(arg);
70
70
 
71
71
  // src/nnn/h.ts
72
- var _h = (namespace_uri) => {
73
- const create_element = namespace_uri == null ? (tag) => document.createElement(tag) : (tag) => document.createElementNS(namespace_uri, tag);
74
- const h = (tag_or_node, ...args) => {
75
- const node = is_string(tag_or_node) ? create_element(tag_or_node) : tag_or_node;
72
+ var _h = (namespaceUri) => {
73
+ const createElement = namespaceUri == null ? (tag) => document.createElement(tag) : (tag) => document.createElementNS(namespaceUri, tag);
74
+ const h = (tagOrNode, ...args) => {
75
+ const node = isString(tagOrNode) ? createElement(tagOrNode) : tagOrNode;
76
76
  args.forEach((arg) => {
77
77
  let child = null;
78
78
  if (arg instanceof Node) {
79
79
  child = arg;
80
- } else if (is_array(arg)) {
80
+ } else if (isArray(arg)) {
81
81
  child = h(...arg);
82
- } else if (is_record(arg)) {
82
+ } else if (isRecord(arg)) {
83
83
  for (const name in arg) {
84
84
  const value = arg[name];
85
85
  if (name[0] === "$") {
86
86
  const name1 = name.slice(1);
87
- if (is_record(value)) {
87
+ if (isRecord(value)) {
88
88
  node[name1] ??= {};
89
89
  Object.assign(node[name1], value);
90
90
  } else {
91
91
  node[name1] = value;
92
92
  }
93
93
  } else if (node instanceof Element) {
94
- const index_of_colon = name.indexOf(":");
95
- if (index_of_colon >= 0) {
96
- const ns_key = name.slice(0, index_of_colon);
97
- if (ns_key === "xlink") {
94
+ const indexOfColon = name.indexOf(":");
95
+ if (indexOfColon >= 0) {
96
+ const nsKey = name.slice(0, indexOfColon);
97
+ if (nsKey === "xlink") {
98
98
  const ns = "http://www.w3.org/1999/xlink";
99
- const basename = name.slice(index_of_colon + 1);
99
+ const basename = name.slice(indexOfColon + 1);
100
100
  if (value === true) {
101
101
  node.setAttributeNS(ns, basename, "");
102
102
  } else if (value === false) {
@@ -116,7 +116,7 @@ var _h = (namespace_uri) => {
116
116
  }
117
117
  }
118
118
  }
119
- } else if (is_string(arg) || is_number(arg)) {
119
+ } else if (isString(arg) || isNumber(arg)) {
120
120
  child = document.createTextNode(arg);
121
121
  }
122
122
  if (child != null) {
@@ -130,54 +130,54 @@ var _h = (namespace_uri) => {
130
130
  var h = /* @__PURE__ */ _h();
131
131
  var s = /* @__PURE__ */ _h("http://www.w3.org/2000/svg");
132
132
 
133
- // src/nnn/fix_pl_typography.ts
133
+ // src/nnn/fixPlTypography.ts
134
134
  var TAGS_TO_SKIP = ["IFRAME", "NOSCRIPT", "PRE", "SCRIPT", "STYLE", "TEXTAREA"];
135
- var fix_pl_typography = (node) => {
135
+ var fixPlTypography = (node) => {
136
136
  const queue = [node];
137
137
  while (queue.length > 0) {
138
- const node_0 = queue.shift();
139
- if (node_0 instanceof Element) {
140
- node_0.childNodes.forEach((child_node) => {
141
- if (child_node instanceof Text) {
142
- queue.push(child_node);
143
- } else if (child_node instanceof Element && !TAGS_TO_SKIP.includes(child_node.tagName)) {
144
- queue.push(child_node);
138
+ const node0 = queue.shift();
139
+ if (node0 instanceof Element) {
140
+ node0.childNodes.forEach((childNode) => {
141
+ if (childNode instanceof Text) {
142
+ queue.push(childNode);
143
+ } else if (childNode instanceof Element && !TAGS_TO_SKIP.includes(childNode.tagName)) {
144
+ queue.push(childNode);
145
145
  }
146
146
  });
147
- } else if (node_0 instanceof Text) {
148
- const node_value = node_0.nodeValue?.trim?.();
149
- if (node_value != null) {
150
- let previous_node = node_0;
151
- node_value.split(/(\s|\(|„)([aiouwz—]\s)/gi).forEach((chunk, i) => {
147
+ } else if (node0 instanceof Text) {
148
+ const nodeValue = node0.nodeValue?.trim?.();
149
+ if (nodeValue != null) {
150
+ let previousNode = node0;
151
+ nodeValue.split(/(\s|\(|„)([aiouwz—]\s)/gi).forEach((chunk, i) => {
152
152
  i %= 3;
153
- const current_node = i === 2 ? h("span", { style: "white-space:nowrap" }, chunk) : i === 1 ? document.createTextNode(chunk) : document.createTextNode(chunk.replace(/(\/(?=[^/\s])|\.(?=[^\s]))/g, "$1​"));
154
- if (node_0.parentNode != null) {
155
- node_0.parentNode.insertBefore(current_node, previous_node.nextSibling);
153
+ const currentNode = i === 2 ? h("span", { style: "white-space:nowrap" }, chunk) : i === 1 ? document.createTextNode(chunk) : document.createTextNode(chunk.replace(/(\/(?=[^/\s])|\.(?=[^\s]))/g, "$1​"));
154
+ if (node0.parentNode != null) {
155
+ node0.parentNode.insertBefore(currentNode, previousNode.nextSibling);
156
156
  }
157
- previous_node = current_node;
157
+ previousNode = currentNode;
158
158
  });
159
- node_0.parentNode?.removeChild(node_0);
159
+ node0.parentNode?.removeChild(node0);
160
160
  }
161
161
  }
162
162
  }
163
163
  };
164
- // src/nnn/has_own.ts
165
- var has_own = (ref, key) => ref != null && Object.hasOwn(ref, key);
166
- // src/nnn/is_finite_number.ts
167
- var is_finite_number = Number.isFinite;
168
- // src/nnn/js_on_parse.ts
169
- var js_on_parse = (handlers, text) => JSON.parse(text, (key, value) => {
170
- if (is_record(value)) {
171
- let is_second_key = false;
164
+ // src/nnn/hasOwn.ts
165
+ var hasOown = (ref, key) => ref != null && Object.hasOwn(ref, key);
166
+ // src/nnn/isFiniteNumber.ts
167
+ var isFiniteNumber = Number.isFinite;
168
+ // src/nnn/jsOnParse.ts
169
+ var jsOnParse = (handlers, text) => JSON.parse(text, (key, value) => {
170
+ if (isRecord(value)) {
171
+ let isSecondKey = false;
172
172
  for (key in value) {
173
- if (is_second_key) {
173
+ if (isSecondKey) {
174
174
  return value;
175
175
  }
176
- is_second_key = true;
176
+ isSecondKey = true;
177
177
  }
178
178
  const handler = handlers[key];
179
179
  const params = value[key];
180
- if (handler instanceof Function && is_array(params)) {
180
+ if (handler instanceof Function && isArray(params)) {
181
181
  return handler(...params);
182
182
  }
183
183
  }
@@ -247,17 +247,17 @@ var monokai = {
247
247
  }
248
248
  }
249
249
  };
250
- // src/nnn/new_tokenizer.ts
251
- var new_tokenizer = (decorator, ...specs) => (code) => {
250
+ // src/nnn/newTokenizer.ts
251
+ var newTokenizer = (decorator, ...specs) => (code) => {
252
252
  const result = [];
253
253
  while (code.length > 0) {
254
- let best_metadata;
255
- let best_index = Infinity;
256
- let best_chunk = "";
254
+ let bestMetadata;
255
+ let bestIndex = Infinity;
256
+ let bestChunk = "";
257
257
  for (const [metadata, pattern] of specs) {
258
258
  let index = -1;
259
259
  let chunk = "";
260
- if (is_string(pattern) && pattern.length > 0) {
260
+ if (isString(pattern) && pattern.length > 0) {
261
261
  index = code.indexOf(pattern);
262
262
  chunk = code.slice(index, index + pattern.length);
263
263
  }
@@ -266,18 +266,18 @@ var new_tokenizer = (decorator, ...specs) => (code) => {
266
266
  index = match?.index ?? -1;
267
267
  chunk = match?.[0] ?? "";
268
268
  }
269
- if (index >= 0 && chunk.length > 0 && (index < best_index || index === best_index && chunk.length > best_chunk.length)) {
270
- best_metadata = metadata;
271
- best_index = index;
272
- best_chunk = chunk;
269
+ if (index >= 0 && chunk.length > 0 && (index < bestIndex || index === bestIndex && chunk.length > bestChunk.length)) {
270
+ bestMetadata = metadata;
271
+ bestIndex = index;
272
+ bestChunk = chunk;
273
273
  }
274
274
  }
275
- if (best_metadata != null) {
276
- if (best_index > 0) {
277
- result.push(decorator(code.slice(0, best_index)));
275
+ if (bestMetadata != null) {
276
+ if (bestIndex > 0) {
277
+ result.push(decorator(code.slice(0, bestIndex)));
278
278
  }
279
- result.push(decorator(best_chunk, best_metadata));
280
- code = code.slice(best_index + best_chunk.length);
279
+ result.push(decorator(bestChunk, bestMetadata));
280
+ code = code.slice(bestIndex + bestChunk.length);
281
281
  } else {
282
282
  result.push(decorator(code));
283
283
  break;
@@ -286,7 +286,7 @@ var new_tokenizer = (decorator, ...specs) => (code) => {
286
286
  return result;
287
287
  };
288
288
 
289
- // src/nnn/nanolight_ts.ts
289
+ // src/nnn/nanolightTs.ts
290
290
  var COMMENT = "comment";
291
291
  var IDENTIFIER_1 = "identifier-1";
292
292
  var IDENTIFIER_2 = "identifier-2";
@@ -299,97 +299,97 @@ var NUMBER = "number";
299
299
  var OPERATOR = "operator";
300
300
  var PUNCTUATION = "punctuation";
301
301
  var STRING = "string";
302
- var nanolight_ts = /* @__PURE__ */ new_tokenizer((chunk, name) => name != null ? ["span", { class: name }, chunk] : chunk, [STRING, /".*?"/], [STRING, /'.*?'/], [STRING, /`[\s\S]*?`/], [COMMENT, /\/\*[\s\S]*?\*\//], [COMMENT, /(?<!\\)\/\/.*?(?=\n)/], [NUMBER, /0b[01_]+/], [NUMBER, /0o[01234567_]+/], [NUMBER, /0x[\dabcdef_]+/], [NUMBER, /\d[\d_]*(\.[\d_]+)?(e[+-]?[\d_]+)?/], [OPERATOR, "!"], [OPERATOR, "!="], [OPERATOR, "!=="], [OPERATOR, "%"], [OPERATOR, "%="], [OPERATOR, "&&"], [OPERATOR, "&&="], [OPERATOR, "&"], [OPERATOR, "&="], [OPERATOR, "*"], [OPERATOR, "**"], [OPERATOR, "**="], [OPERATOR, "*="], [OPERATOR, "+"], [OPERATOR, "++"], [OPERATOR, "+="], [OPERATOR, "-"], [OPERATOR, "--"], [OPERATOR, "-="], [OPERATOR, "..."], [OPERATOR, "/"], [OPERATOR, "/="], [OPERATOR, ":"], [OPERATOR, "<"], [OPERATOR, "<<"], [OPERATOR, "<<="], [OPERATOR, "<="], [OPERATOR, "="], [OPERATOR, "=="], [OPERATOR, "==="], [OPERATOR, "=>"], [OPERATOR, ">"], [OPERATOR, ">="], [OPERATOR, ">>"], [OPERATOR, ">>="], [OPERATOR, ">>>"], [OPERATOR, ">>>="], [OPERATOR, "?"], [OPERATOR, "?"], [OPERATOR, "??"], [OPERATOR, "??="], [OPERATOR, "^"], [OPERATOR, "^="], [OPERATOR, "|"], [OPERATOR, "|="], [OPERATOR, "||"], [OPERATOR, "||="], [OPERATOR, "~"], [OPERATOR, "~="], [OPERATOR, /(?<=\s):/], [PUNCTUATION, "("], [PUNCTUATION, ")"], [PUNCTUATION, ","], [PUNCTUATION, "."], [PUNCTUATION, ":"], [PUNCTUATION, ";"], [PUNCTUATION, "?."], [PUNCTUATION, "["], [PUNCTUATION, "]"], [PUNCTUATION, "{"], [PUNCTUATION, "}"], [KEYWORD_1, "as"], [KEYWORD_1, "async"], [KEYWORD_1, "await"], [KEYWORD_1, "break"], [KEYWORD_1, "case"], [KEYWORD_1, "catch"], [KEYWORD_1, "class"], [KEYWORD_1, "const"], [KEYWORD_1, "continue"], [KEYWORD_1, "debugger"], [KEYWORD_1, "default"], [KEYWORD_1, "delete"], [KEYWORD_1, "do"], [KEYWORD_1, "else"], [KEYWORD_1, "export"], [KEYWORD_1, "extends"], [KEYWORD_1, "finally"], [KEYWORD_1, "for"], [KEYWORD_1, "from"], [KEYWORD_1, "function"], [KEYWORD_1, "function*"], [KEYWORD_1, "goto"], [KEYWORD_1, "if"], [KEYWORD_1, "import"], [KEYWORD_1, "in"], [KEYWORD_1, "instanceof"], [KEYWORD_1, "is"], [KEYWORD_1, "keyof"], [KEYWORD_1, "let"], [KEYWORD_1, "new"], [KEYWORD_1, "of"], [KEYWORD_1, "package"], [KEYWORD_1, "return"], [KEYWORD_1, "super"], [KEYWORD_1, "switch"], [KEYWORD_1, "this"], [KEYWORD_1, "throw"], [KEYWORD_1, "try"], [KEYWORD_1, "type"], [KEYWORD_1, "typeof"], [KEYWORD_1, "var"], [KEYWORD_1, "void"], [KEYWORD_1, "while"], [KEYWORD_1, "with"], [KEYWORD_1, "yield"], [KEYWORD_1, "yield*"], [KEYWORD_2, "false"], [KEYWORD_2, "Infinity"], [KEYWORD_2, "NaN"], [KEYWORD_2, "null"], [KEYWORD_2, "true"], [KEYWORD_2, "undefined"], [KEYWORD_3, "any"], [KEYWORD_3, "bigint"], [KEYWORD_3, "boolean"], [KEYWORD_3, "eval"], [KEYWORD_3, "number"], [KEYWORD_3, "string"], [KEYWORD_3, "symbol"], [KEYWORD_3, "unknown"], [IDENTIFIER_1, /[\p{Lu}_$][\p{Lu}\d_$]*/u], [IDENTIFIER_2, /[\p{L}_$][\p{L}\d_$]*(?=[(`])/u], [IDENTIFIER_3, /\p{Lu}[\p{L}\d_$]*/u], [IDENTIFIER_4, /[\p{L}_$][\p{L}\d_$]*/u]);
303
- // src/nnn/new_escape.ts
304
- var escape_values = (escape_map, values) => values.map((value) => (value == null ? escape_map.get(value) : escape_map.get(value?.constructor))?.(value) ?? "");
305
- var new_escape = (escape_map) => (template, ...values) => String.raw(template, ...escape_values(escape_map, values));
306
- // src/nnn/new_noun_form.ts
302
+ var nanolightTs = /* @__PURE__ */ newTokenizer((chunk, name) => name != null ? ["span", { class: name }, chunk] : chunk, [COMMENT, /\/\*.*?\*\//s], [COMMENT, /(?<!\\)\/\/.*?(?=\n)/], [STRING, /".*?"/], [STRING, /'.*?'/], [STRING, /`.*?`/s], [STRING, /\/[^\s]*[^\\]\/[dgimsuvy]*/], [NUMBER, /0b[01_]+/], [NUMBER, /0o[01234567_]+/], [NUMBER, /0x[\dabcdef_]+/], [NUMBER, /\d[\d_]*(\.[\d_]+)?(e[+-]?[\d_]+)?/], [OPERATOR, "!"], [OPERATOR, "!="], [OPERATOR, "!=="], [OPERATOR, "%"], [OPERATOR, "%="], [OPERATOR, "&&"], [OPERATOR, "&&="], [OPERATOR, "&"], [OPERATOR, "&="], [OPERATOR, "*"], [OPERATOR, "**"], [OPERATOR, "**="], [OPERATOR, "*="], [OPERATOR, "+"], [OPERATOR, "++"], [OPERATOR, "+="], [OPERATOR, "-"], [OPERATOR, "--"], [OPERATOR, "-="], [OPERATOR, "..."], [OPERATOR, "/"], [OPERATOR, "/="], [OPERATOR, ":"], [OPERATOR, "<"], [OPERATOR, "<<"], [OPERATOR, "<<="], [OPERATOR, "<="], [OPERATOR, "="], [OPERATOR, "=="], [OPERATOR, "==="], [OPERATOR, "=>"], [OPERATOR, ">"], [OPERATOR, ">="], [OPERATOR, ">>"], [OPERATOR, ">>="], [OPERATOR, ">>>"], [OPERATOR, ">>>="], [OPERATOR, "?"], [OPERATOR, "?"], [OPERATOR, "??"], [OPERATOR, "??="], [OPERATOR, "^"], [OPERATOR, "^="], [OPERATOR, "|"], [OPERATOR, "|="], [OPERATOR, "||"], [OPERATOR, "||="], [OPERATOR, "~"], [OPERATOR, "~="], [OPERATOR, /(?<=\s):/], [PUNCTUATION, "("], [PUNCTUATION, ")"], [PUNCTUATION, ","], [PUNCTUATION, "."], [PUNCTUATION, ":"], [PUNCTUATION, ";"], [PUNCTUATION, "?."], [PUNCTUATION, "["], [PUNCTUATION, "]"], [PUNCTUATION, "{"], [PUNCTUATION, "}"], [KEYWORD_1, "as"], [KEYWORD_1, "async"], [KEYWORD_1, "await"], [KEYWORD_1, "break"], [KEYWORD_1, "case"], [KEYWORD_1, "catch"], [KEYWORD_1, "class"], [KEYWORD_1, "const"], [KEYWORD_1, "continue"], [KEYWORD_1, "debugger"], [KEYWORD_1, "default"], [KEYWORD_1, "delete"], [KEYWORD_1, "do"], [KEYWORD_1, "else"], [KEYWORD_1, "export"], [KEYWORD_1, "extends"], [KEYWORD_1, "finally"], [KEYWORD_1, "for"], [KEYWORD_1, "from"], [KEYWORD_1, "function"], [KEYWORD_1, "function*"], [KEYWORD_1, "goto"], [KEYWORD_1, "if"], [KEYWORD_1, "import"], [KEYWORD_1, "in"], [KEYWORD_1, "instanceof"], [KEYWORD_1, "is"], [KEYWORD_1, "keyof"], [KEYWORD_1, "let"], [KEYWORD_1, "new"], [KEYWORD_1, "of"], [KEYWORD_1, "package"], [KEYWORD_1, "return"], [KEYWORD_1, "super"], [KEYWORD_1, "switch"], [KEYWORD_1, "this"], [KEYWORD_1, "throw"], [KEYWORD_1, "try"], [KEYWORD_1, "type"], [KEYWORD_1, "typeof"], [KEYWORD_1, "var"], [KEYWORD_1, "void"], [KEYWORD_1, "while"], [KEYWORD_1, "with"], [KEYWORD_1, "yield"], [KEYWORD_1, "yield*"], [KEYWORD_2, "false"], [KEYWORD_2, "Infinity"], [KEYWORD_2, "NaN"], [KEYWORD_2, "null"], [KEYWORD_2, "true"], [KEYWORD_2, "undefined"], [KEYWORD_3, "any"], [KEYWORD_3, "bigint"], [KEYWORD_3, "boolean"], [KEYWORD_3, "eval"], [KEYWORD_3, "number"], [KEYWORD_3, "string"], [KEYWORD_3, "symbol"], [KEYWORD_3, "unknown"], [IDENTIFIER_1, /[\p{Lu}_$][\p{Lu}\d_$]*/u], [IDENTIFIER_2, /[\p{L}_$][\p{L}\d_$]*(?=[(`])/u], [IDENTIFIER_3, /\p{Lu}[\p{L}\d_$]*/u], [IDENTIFIER_4, /[\p{L}_$][\p{L}\d_$]*/u]);
303
+ // src/nnn/newEscape.ts
304
+ var escapeValues = (escapeMap, values) => values.map((value) => (value == null ? escapeMap.get(value) : escapeMap.get(value?.constructor))?.(value) ?? "");
305
+ var newEscape = (escapeMap) => (template, ...values) => String.raw(template, ...escapeValues(escapeMap, values));
306
+ // src/nnn/newNounForm.ts
307
307
  var PLURAL_RULES = {};
308
- var new_noun_form = (locale, forms) => (value) => forms[(PLURAL_RULES[locale] ??= new Intl.PluralRules(locale)).select(value)] ?? forms.other ?? "";
308
+ var newNounForm = (locale, forms) => (value) => forms[(PLURAL_RULES[locale] ??= new Intl.PluralRules(locale)).select(value)] ?? forms.other ?? "";
309
309
  // src/nnn/omit.ts
310
310
  var omit = (ref, keys) => Object.fromEntries(Object.entries(ref).filter(([key]) => !keys.includes(key)));
311
311
  // src/nnn/pick.ts
312
312
  var pick = (ref, keys) => Object.fromEntries(Object.entries(ref).filter(([key]) => keys.includes(key)));
313
313
  // src/nnn/vivify.ts
314
314
  var ARRAY_INDEX_REGEXP = /^(0|[1-9]\d*)$/;
315
- var is_object = (ref) => typeof ref === "object";
316
- var get_target = (parent, parent_key, key) => parent[parent_key] ??= is_string(key) && ARRAY_INDEX_REGEXP.test(key) ? [] : {};
317
- var _vivify = (parent, parent_key) => {
318
- return parent != null && is_object(parent) ? new Proxy(parent, {
315
+ var isObject = (ref) => typeof ref === "object";
316
+ var getTarget = (parent, parentKey, key) => parent[parentKey] ??= isString(key) && ARRAY_INDEX_REGEXP.test(key) ? [] : {};
317
+ var _vivify = (parent, parentKey) => {
318
+ return parent != null && isObject(parent) ? new Proxy(parent, {
319
319
  get(_, key) {
320
- const target = get_target(parent, parent_key, key);
320
+ const target = getTarget(parent, parentKey, key);
321
321
  const value = target[key];
322
- return is_string(key) && is_object(target) && (value == null || is_object(value)) ? _vivify(target, key) : value;
322
+ return isString(key) && isObject(target) && (value == null || isObject(value)) ? _vivify(target, key) : value;
323
323
  },
324
324
  set(_, key, value) {
325
- const target = get_target(parent, parent_key, key);
325
+ const target = getTarget(parent, parentKey, key);
326
326
  target[key] = value;
327
327
  return true;
328
328
  },
329
329
  deleteProperty(_, key) {
330
- const target = get_target(parent, parent_key, key);
330
+ const target = getTarget(parent, parentKey, key);
331
331
  return delete target[key];
332
332
  }
333
- }) : parent?.[parent_key];
333
+ }) : parent?.[parentKey];
334
334
  };
335
335
  var vivify = (ref) => _vivify({ _: ref }, "_");
336
336
 
337
337
  // src/nnn/rwd.ts
338
- var rwd = (root, selector, cell_width_px, cell_height_px, ...specs) => {
338
+ var rwd = (root, selector, cellWidthPx, cellHeightPx, ...specs) => {
339
339
  const main = vivify(root)[selector];
340
340
  main.boxSizing = "border-box";
341
341
  main.display = "block";
342
342
  main.float = "left";
343
343
  main.width = "100%";
344
- main.height = `${cell_height_px}px`;
344
+ main.height = `${cellHeightPx}px`;
345
345
  specs.sort(([a], [b]) => a - b);
346
- for (let [max_width, width, height] of specs) {
347
- const node = max_width === 1 ? main : vivify(root)[`@media(min-width:${cell_width_px * max_width}px)`][selector];
346
+ for (let [maxWidth, width, height] of specs) {
347
+ const node = maxWidth === 1 ? main : vivify(root)[`@media(min-width:${cellWidthPx * maxWidth}px)`][selector];
348
348
  width ??= 1;
349
349
  height ??= 1;
350
350
  let gcd = 100 * width;
351
- let tmp = max_width;
351
+ let tmp = maxWidth;
352
352
  while (tmp > 0) {
353
353
  [gcd, tmp] = [tmp, gcd % tmp];
354
354
  }
355
- const w_100_per_gcd = 100 * width / gcd;
356
- node.width = max_width === gcd ? `${w_100_per_gcd}%` : `calc(${w_100_per_gcd}% / ${max_width / gcd})`;
357
- node.height = `${cell_height_px * height}px`;
355
+ const widthOverGcd = 100 * width / gcd;
356
+ node.width = maxWidth === gcd ? `${widthOverGcd}%` : `calc(${widthOverGcd}% / ${maxWidth / gcd})`;
357
+ node.height = `${cellHeightPx * height}px`;
358
358
  }
359
359
  };
360
- // src/nnn/svg_use.ts
361
- var svg_use = (id, ...args) => s("svg", ["use", { "xlink:href": "#" + id }], ...args);
362
- // src/nnn/uuid_v1.ts
360
+ // src/nnn/svgUse.ts
361
+ var svgUse = (id, ...args) => s("svg", ["use", { "xlink:href": "#" + id }], ...args);
362
+ // src/nnn/uuidV1.ts
363
363
  var ZEROS = /* @__PURE__ */ "0".repeat(16);
364
364
  var counter = 0;
365
- var uuid_v1 = (date = new Date, node = Math.random().toString(16).slice(2)) => {
365
+ var uuidV1 = (date = new Date, node = Math.random().toString(16).slice(2)) => {
366
366
  const time = ZEROS + (1e4 * (+date + 12219292800000)).toString(16);
367
367
  counter = counter + 1 & 16383;
368
368
  return time.slice(-8).concat("-", time.slice(-12, -8), -1, time.slice(-15, -12), "-", (8 | counter >> 12).toString(16), (ZEROS + (counter & 4095).toString(16)).slice(-3), "-", (ZEROS + node).slice(-12));
369
369
  };
370
370
  export {
371
371
  vivify,
372
- uuid_v1,
373
- svg_use,
372
+ uuidV1,
373
+ svgUse,
374
374
  s,
375
375
  rwd,
376
376
  pick,
377
377
  omit,
378
- new_tokenizer,
379
- new_noun_form,
380
- new_escape,
381
- nanolight_ts,
378
+ newTokenizer,
379
+ newNounForm,
380
+ newEscape,
381
+ nanolightTs,
382
382
  monokai,
383
- js_on_parse,
384
- is_string,
385
- is_record,
386
- is_number,
387
- is_finite_number,
388
- is_array,
389
- has_own,
383
+ jsOnParse,
384
+ isString,
385
+ isRecord,
386
+ isNumber,
387
+ isFiniteNumber,
388
+ isArray,
389
+ hasOown,
390
390
  h,
391
- fix_pl_typography,
392
- escape_values,
393
- csv_parse,
391
+ fixPlTypography,
392
+ escapeValues,
393
+ csvParse,
394
394
  c
395
395
  };
package/package.json CHANGED
@@ -14,13 +14,13 @@
14
14
  "HyperScript",
15
15
  "in",
16
16
  "is",
17
- "is_array",
18
- "is_finite_number",
19
- "is_number",
20
- "is_record",
21
- "is_string",
17
+ "isArray",
18
+ "isFiniteNumber",
19
+ "isNumber",
20
+ "isRecord",
21
+ "isString",
22
22
  "JS-to-CSS",
23
- "js_on_parse",
23
+ "jsOnParse",
24
24
  "JSON",
25
25
  "Monokai",
26
26
  "nanolight",
@@ -35,7 +35,8 @@
35
35
  "tokenizer",
36
36
  "typography",
37
37
  "uuid",
38
- "uuidv1",
38
+ "uuid1",
39
+ "uuidV1",
39
40
  "vivify"
40
41
  ],
41
42
  "license": "MIT",
@@ -43,5 +44,5 @@
43
44
  "name": "@jackens/nnn",
44
45
  "type": "module",
45
46
  "types": "nnn.d.ts",
46
- "version": "2026.2.19"
47
+ "version": "2026.2.23"
47
48
  }