@jackens/nnn 2026.8.31 → 2026.9.2

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 +200 -423
  2. package/nnn.js +113 -138
  3. package/package.json +1 -3
  4. package/readme.md +296 -670
package/nnn.d.ts CHANGED
@@ -1,144 +1,101 @@
1
1
  /**
2
- * Represents a CSS rule node for the {@link c} helper.
3
- * Keys are CSS properties or nested selectors.
2
+ * Represents a CSS rule node for the {@link c} helper. Keys
3
+ * are CSS properties or nested selectors.
4
4
  */
5
5
  export type CNode = {
6
6
  [attributeOrSelector: string]: string | number | CNode | undefined;
7
7
  };
8
8
  /**
9
- * Represents the root CSS object for the {@link c} helper.
10
- * Keys are top-level selectors or at-rules.
9
+ * A minimal CSS-in-JS helper that converts a JavaScript
10
+ * object hierarchy into a CSS string.
11
+ *
12
+ * @param node An object describing CSS rules. Keys are
13
+ * selectors or at-rules; values are either CSS property
14
+ * values or nested rule objects. A selector key may
15
+ * contain comma-separated alternatives (e.g. `'.b,.c'`);
16
+ * when nested, each alternative is combined with each
17
+ * parent alternative (cartesian product), producing a
18
+ * comma-joined selector list (e.g. `'a.b,a.c'`).
19
+ * @param splitter A delimiter used to create unique keys
20
+ * (default: `'$$'`). The substring from `splitter` to the
21
+ * end of a key is ignored (e.g., `src$$1` → `src`).
22
+ *
23
+ * @returns A CSS string representing the compiled rules.
11
24
  */
12
- export type CRoot = Record<PropertyKey, CNode>;
25
+ export declare const c: (node: CNode, splitter?: string) => string;
13
26
  /**
14
- * A minimal CSS-in-JS helper
15
- * that converts a JavaScript object hierarchy
16
- * into a CSS string.
27
+ * Creates a tag function for escaping interpolated values
28
+ * in template literals.
17
29
  *
18
- * @param root
30
+ * @param escapeFn A function that takes a value and returns
31
+ * its escaped string representation.
19
32
  *
20
- * An object describing CSS rules.
21
- * Keys are selectors or at-rules;
22
- * values are either CSS property values
23
- * or nested rule objects.
24
- *
25
- * @param splitter
26
- *
27
- * A delimiter used to create unique keys (default: `'$$'`).
28
- * The substring from `splitter` to the end of a key
29
- * is ignored (e.g., `src$$1` → `src`).
30
- *
31
- * @returns
32
- *
33
- * A CSS string representing the compiled rules.
34
- *
35
- * @remarks
36
- *
37
- * - Keys whose values are primitives (`string` | `number`)
38
- * are treated as CSS properties.
39
- * - In property keys, uppercase letters
40
- * become lowercase with a `-` prefix
41
- * (e.g., `fontFamily` → `font-family`);
42
- * underscores become hyphens
43
- * (e.g., `font_family` → `font-family`).
44
- * - Comma-separated selector keys
45
- * expand into multiple selectors
46
- * (e.g., `{ div: { '.a,.b': { margin: 1 } } }` →
47
- * `div.a,div.b{margin:1}`).
48
- * - Top-level keys starting with `@` (at-rules)
49
- * are not concatenated with child selectors.
50
- */
51
- export declare const c: (root: CRoot, splitter?: string) => string;
52
- /**
53
- * Creates a tag function
54
- * for escaping interpolated values in template literals.
55
- *
56
- * @param escapeFn
57
- *
58
- * A function that takes a value
59
- * and returns its escaped string representation.
60
- *
61
- * @returns
62
- *
63
- * A tag function that escapes interpolated values
64
- * using the provided escape map.
33
+ * @returns A tag function that escapes interpolated values
34
+ * using the provided escape function.
65
35
  */
66
36
  export declare const createEscape: (escapeFn: (value: any) => string) => (template: TemplateStringsArray, ...values: unknown[]) => string;
67
37
  /**
68
- * A helper for building simple tokenizers
69
- * (see also {@link nanolightTs}).
70
- *
71
- * @param decorator
72
- *
73
- * A function that wraps each matched chunk.
74
- * It receives the matched text (`chunk`)
75
- * and optionally the `metadata`
76
- * associated with the pattern that produced the match.
77
- * For unmatched text between patterns,
78
- * `metadata` is `undefined`.
79
- *
80
- * @param specs
81
- *
82
- * An array of tuples `[metadata, pattern]` where:
83
- * - `metadata`: arbitrary data (e.g., a CSS class name)
84
- * passed to `decorator` when the pattern matches.
85
- * - `pattern`: a `string` or `RegExp`
86
- * to match against the input.
87
- *
88
- * @returns
89
- *
90
- * A tokenizer function that accepts a code string
91
- * and returns an array of decorated tokens.
38
+ * A helper for building simple tokenizers (see also
39
+ * {@link nanolightTs}).
92
40
  *
93
41
  * @remarks
94
42
  *
95
- * 1. Matches starting at an earlier position
96
- * take precedence.
97
- * 2. Among matches at the same position,
98
- * the longer one wins.
99
- * 3. Among matches of the same position and length,
100
- * the one defined earlier wins.
43
+ * 1. Matches starting at an earlier position take
44
+ * precedence.
45
+ * 2. Among matches at the same position, the longer one
46
+ * wins.
47
+ * 3. Among matches of the same position and length, the one
48
+ * defined earlier wins.
49
+ *
50
+ * @param decorator A function that wraps each matched
51
+ * chunk. It receives the matched text (`chunk`) and
52
+ * optionally the `metadata` associated with the pattern
53
+ * that produced the match. For unmatched text between
54
+ * patterns, `metadata` is `undefined`.
55
+ * @param specs An array of tuples `[metadata, pattern]`
56
+ * where:
57
+ *
58
+ * - `metadata`: arbitrary data (e.g., a CSS class name)
59
+ * passed to `decorator` when the pattern matches.
60
+ * - `pattern`: a `string` or `RegExp` to match against the
61
+ * input.
62
+ *
63
+ * @returns A tokenizer function that accepts a code string
64
+ * and returns an array of decorated tokens.
101
65
  */
102
66
  export declare const createTokenizer: <M, T>(decorator: (chunk: string, metadata?: M) => T, ...specs: [M, string | RegExp][]) => (code: string) => T[];
103
67
  /**
104
- * Parses a CSV string
105
- * into a two-dimensional array of strings.
68
+ * Parses a CSV string into a two-dimensional array of
69
+ * strings.
106
70
  *
107
71
  * Supports quoted fields with escaped double quotes (`""`).
108
72
  * Carriage returns are normalized.
109
73
  *
110
- * @param csv
111
- *
112
- * The CSV string to parse.
113
- *
114
- * @param separator
115
- *
116
- * The field delimiter (default: `','`).
117
- *
118
- * @returns
74
+ * @param csv The CSV string to parse.
75
+ * @param separator The field delimiter (default: `','`).
119
76
  *
120
- * A 2D array where each inner array
121
- * represents a row of fields.
77
+ * @returns A 2D array where each inner array represents a
78
+ * row of fields.
122
79
  */
123
80
  export declare const csvParse: (csv: string, separator?: string) => string[][];
124
81
  /**
125
- * Applies Polish-specific typographic corrections
126
- * to a DOM subtree.
82
+ * Applies Polish-specific typographic corrections to a DOM
83
+ * subtree.
127
84
  *
128
85
  * This function prevents orphaned conjunctions
129
86
  * (single-letter words like “a”, “i”, “o”, “u”, “w”, “z”)
130
- * from appearing at the end of a line
131
- * by wrapping them with the following word
132
- * in a non-breaking span.
133
- * It also inserts zero-width spaces
134
- * after slashes and dots to allow line breaks.
135
- *
136
- * @param node
137
- *
138
- * The root DOM node to process.
139
- * All descendant text nodes are corrected recursively,
140
- * except those inside `IFRAME`, `NOSCRIPT`, `PRE`,
141
- * `SCRIPT`, `STYLE`, or `TEXTAREA` elements.
87
+ * and the em dash (“—”) from appearing at the end of a
88
+ * line. It wraps each such character together with the
89
+ * whitespace that follows it in a `white-space:nowrap`
90
+ * span, removing the only line-break opportunity between it
91
+ * and the next word so the two stay glued together. It also
92
+ * inserts zero-width spaces after slashes and dots to allow
93
+ * line breaks.
94
+ *
95
+ * @param node The root DOM node to process. All descendant
96
+ * text nodes are corrected recursively, except those
97
+ * inside `IFRAME`, `NOSCRIPT`, `PRE`, `SCRIPT`, `STYLE`,
98
+ * or `TEXTAREA` elements.
142
99
  */
143
100
  export declare const fixPlTypography: (node: Node) => void;
144
101
  /**
@@ -152,33 +109,31 @@ export type HArgs1 = Record<PropertyKey, unknown> | null | undefined | Node | st
152
109
  */
153
110
  export type HArgs = [string | Node, ...HArgs1[]];
154
111
  /**
155
- * A lightweight *HyperScript*-style helper
156
- * for creating and modifying `HTMLElement`s
157
- * (see also {@link s}).
158
- *
159
- * @param tagOrNode
160
- *
161
- * If a `string`, it is treated as the tag name
162
- * for a new element.
163
- * If a `Node`, that node is modified in place.
164
- *
165
- * @param args
166
- *
167
- * Additional arguments processed as follows:
168
- * - `Object`: maps attributes/properties.
169
- * Keys starting with `$` set element properties
170
- * (without the `$` prefix);
171
- * other keys set attributes via `setAttribute`.
172
- * A value of `false` removes the attribute.
173
- * - `null`/`undefined`: ignored.
174
- * - `Node`: appended as a child.
175
- * - `string`/`number`: converted to a `Text` node
176
- * and appended.
177
- * - {@link HArgs} array: processed recursively.
178
- *
179
- * @returns
180
- *
181
- * The created or modified `HTMLElement`.
112
+ * A lightweight _HyperScript_-style helper for creating and
113
+ * modifying `HTMLElement`s (see also {@link s}).
114
+ *
115
+ * @param tagOrNode If a `string`, it is treated as the tag
116
+ * name for a new element. If a `Node`, that node is
117
+ * modified in place.
118
+ * @param args Additional arguments processed as follows:
119
+ *
120
+ * - `Object`: maps attributes/properties. Keys starting
121
+ * with `$` set element properties (without the `$`
122
+ * prefix); if the value is a plain object, it is
123
+ * shallow-merged into the existing property instead of
124
+ * replacing it (useful e.g. for `$style`). Other keys
125
+ * set attributes: a key prefixed with `xlink:` sets the
126
+ * attribute via `setAttributeNS` in the XLink
127
+ * namespace; any other key (without a colon) sets it
128
+ * via `setAttribute`. A value of `false` removes the
129
+ * attribute.
130
+ * - `null`/`undefined`: ignored.
131
+ * - `Node`: appended as a child.
132
+ * - `string`/`number`: converted to a `Text` node and
133
+ * appended.
134
+ * - {@link HArgs} array: processed recursively.
135
+ *
136
+ * @returns The created or modified `HTMLElement`.
182
137
  */
183
138
  export declare const h: {
184
139
  <T extends keyof HTMLElementTagNameMap>(tag: T, ...args1: HArgs1[]): HTMLElementTagNameMap[T];
@@ -186,33 +141,30 @@ export declare const h: {
186
141
  (tagOrNode: string | Node, ...args1: HArgs1[]): Node;
187
142
  };
188
143
  /**
189
- * A lightweight *HyperScript*-style helper
190
- * for creating and modifying `SVGElement`s
191
- * (see also {@link h}).
192
- *
193
- * @param tagOrNode
194
- *
195
- * If a `string`, it is treated as the tag name
196
- * for a new element.
197
- * If a `Node`, that node is modified in place.
198
- *
199
- * @param args
200
- *
201
- * Additional arguments processed as follows:
202
- * - `Object`: maps attributes/properties.
203
- * Keys starting with `$` set element properties
204
- * (without the `$` prefix);
205
- * other keys set attributes via `setAttributeNS`.
206
- * A value of `false` removes the attribute.
207
- * - `null`/`undefined`: ignored.
208
- * - `Node`: appended as a child.
209
- * - `string`/`number`: converted to a `Text` node
210
- * and appended.
211
- * - {@link HArgs} array: processed recursively.
212
- *
213
- * @returns
214
- *
215
- * The created or modified `SVGElement`.
144
+ * A lightweight _HyperScript_-style helper for creating and
145
+ * modifying `SVGElement`s (see also {@link h}).
146
+ *
147
+ * @param tagOrNode If a `string`, it is treated as the tag
148
+ * name for a new element. If a `Node`, that node is
149
+ * modified in place.
150
+ * @param args Additional arguments processed as follows:
151
+ *
152
+ * - `Object`: maps attributes/properties. Keys starting
153
+ * with `$` set element properties (without the `$`
154
+ * prefix); if the value is a plain object, it is
155
+ * shallow-merged into the existing property instead of
156
+ * replacing it. Other keys set attributes: a key
157
+ * prefixed with `xlink:` sets the attribute via
158
+ * `setAttributeNS` in the XLink namespace; any other
159
+ * key (without a colon) sets it via `setAttribute`. A
160
+ * value of `false` removes the attribute.
161
+ * - `null`/`undefined`: ignored.
162
+ * - `Node`: appended as a child.
163
+ * - `string`/`number`: converted to a `Text` node and
164
+ * appended.
165
+ * - {@link HArgs} array: processed recursively.
166
+ *
167
+ * @returns The created or modified `SVGElement`.
216
168
  */
217
169
  export declare const s: {
218
170
  <T extends keyof SVGElementTagNameMap>(tag: T, ...args1: HArgs1[]): SVGElementTagNameMap[T];
@@ -220,298 +172,123 @@ export declare const s: {
220
172
  (tagOrNode: string | Node, ...args1: HArgs1[]): Node;
221
173
  };
222
174
  /**
223
- * Shorthand for creating an SVG element
224
- * with a `<use>` child referencing an icon by ID.
175
+ * Shorthand for creating an SVG element with a `<use>`
176
+ * child referencing an icon by ID.
225
177
  *
226
178
  * Equivalent to:
227
- * `s('svg', ['use', { 'xlink:href': '#' + id }], ...args)`.
228
- *
229
- * @param id
230
- *
231
- * The ID of the symbol to reference
232
- * (without the `#` prefix).
233
- *
234
- * @param args
235
179
  *
236
- * Additional arguments passed to the outer `<svg>` element.
180
+ * ```ts
181
+ * s(
182
+ * 'svg',
183
+ * ['use', { 'xlink:href': '#' + id }],
184
+ * ...args
185
+ * )
186
+ * ```
237
187
  *
238
- * @returns
188
+ * @param id The ID of the symbol to reference (without the
189
+ * `#` prefix).
190
+ * @param args Additional arguments passed to the outer
191
+ * `<svg>` element.
239
192
  *
240
- * An `SVGSVGElement` containing a `<use>` element.
193
+ * @returns An `SVGSVGElement` containing a `<use>` element.
241
194
  */
242
195
  export declare const svgUse: (id: string, ...args: HArgs1[]) => SVGSVGElement;
243
196
  /**
244
- * Checks whether an object has the specified key
245
- * as its own property.
246
- *
247
- * A null-safe wrapper around `Object.hasOwn`.
248
- *
249
- * @param ref
250
- *
251
- * The object to check.
252
- *
253
- * @param key
254
- *
255
- * The property key to look for.
256
- *
257
- * @returns
258
- *
259
- * `true` if `ref` is not nullish
260
- * and has `key` as an own property, `false` otherwise.
261
- */
262
- export declare const hasOwn: (ref: unknown, key: unknown) => boolean;
263
- /**
264
- * Checks whether the argument is an array.
265
- *
266
- * @param arg
267
- *
268
- * The value to check.
269
- *
270
- * @returns
271
- *
272
- * `true` if `arg` is an array, `false` otherwise.
273
- */
274
- export declare const isArray: (arg: unknown) => arg is unknown[];
275
- /**
276
- * Checks whether the argument is of type `number`
277
- * (includes `NaN` and `±Infinity`).
278
- *
279
- * @param arg
280
- *
281
- * The value to check.
282
- *
283
- * @returns
284
- *
285
- * `true` if `typeof arg === 'number'`, `false` otherwise.
286
- */
287
- export declare const isNumber: (arg: unknown) => arg is number;
288
- /**
289
- * Checks whether the argument is a finite number
290
- * (excludes `±Infinity` and `NaN`).
291
- *
292
- * @param arg
293
- *
294
- * The value to check.
295
- *
296
- * @returns
297
- *
298
- * `true` if `arg` is a finite number, `false` otherwise.
299
- */
300
- export declare const isFiniteNumber: (arg: unknown) => arg is number;
301
- /**
302
- * Checks whether the argument is an integer number.
303
- *
304
- * @param arg
305
- *
306
- * The value to check.
307
- *
308
- * @returns
309
- *
310
- * `true` if `arg` is an integer number, `false` otherwise.
311
- */
312
- export declare const isInteger: (arg: unknown) => arg is number;
313
- /**
314
- * Checks whether the argument is a string.
315
- *
316
- * @param arg
317
- *
318
- * The value to check.
319
- *
320
- * @returns
321
- *
322
- * `true` if `typeof arg === 'string'`, `false` otherwise.
323
- */
324
- export declare const isString: (arg: unknown) => arg is string;
325
- /**
326
- * Checks whether the argument is a plain object
327
- * (not `null` and not an array).
328
- *
329
- * @param arg
330
- *
331
- * The value to check.
332
- *
333
- * @returns
334
- *
335
- * `true` if `arg` is a plain object, `false` otherwise.
197
+ * A Monokai-inspired color scheme for use with the {@link c}
198
+ * helper and {@link nanolightTs} tokenizer.
336
199
  */
337
- export declare const isRecord: (arg: unknown) => arg is Record<PropertyKey, unknown>;
338
- /**
339
- * Parses JSON with support for
340
- * handler-based value transformation (“JavaScript ON”).
341
- *
342
- * Objects with exactly one property
343
- * whose key exists in `handlers`
344
- * and whose value is an array
345
- * are replaced by invoking the corresponding handler
346
- * with the array elements as arguments.
347
- *
348
- * @param handlers
349
- *
350
- * An object mapping handler names to functions.
351
- *
352
- * @param text
353
- *
354
- * The JSON string to parse.
355
- *
356
- * @returns
357
- *
358
- * The parsed value with handler substitutions applied.
359
- */
360
- export declare const jsOnParse: (handlers: Record<PropertyKey, Function>, text: string) => any;
361
- /**
362
- * A Monokai-inspired color scheme
363
- * for use with the {@link c} helper
364
- * and {@link nanolightTs} tokenizer.
365
- */
366
- export declare const monokai: CRoot;
200
+ export declare const monokai: CNode;
367
201
  /**
368
202
  * A TypeScript/JavaScript syntax highlighting tokenizer
369
203
  * built using {@link createTokenizer}.
370
204
  *
371
- * @param code
372
- *
373
- * The source code string to tokenize.
205
+ * @param code The source code string to tokenize.
374
206
  *
375
- * @returns
376
- *
377
- * An array of {@link HArgs1} elements
378
- * suitable for rendering with {@link h}.
207
+ * @returns An array of {@link HArgs1} elements suitable for
208
+ * rendering with {@link h}.
379
209
  */
380
210
  export declare const nanolightTs: (code: string) => HArgs1[];
381
211
  /**
382
- * Creates a new object excluding the specified keys
383
- * from the source object.
384
- *
385
- * A runtime equivalent
386
- * of TypeScript’s `Omit<T, K>` utility type.
387
- * See also {@link pick}.
388
- *
389
- * @param ref
390
- *
391
- * The source object.
392
- *
393
- * @param keys
394
- *
395
- * An array of keys to exclude from the result.
396
- *
397
- * @returns
398
- *
399
- * A new object without the specified keys.
212
+ * A responsive web design helper that generates CSS rules
213
+ * for a grid-like layout.
214
+ *
215
+ * @param root The CSS root object to populate (see
216
+ * {@link c}).
217
+ * @param selector The CSS selector for the grid item.
218
+ * @param cellWidthPx The base cell width in pixels.
219
+ * @param cellHeightPx The base cell height in pixels.
220
+ * @param specs An array of breakpoint specifications, each
221
+ * a tuple of:
222
+ *
223
+ * - `maxWidth`: maximum number of cells per row (defines
224
+ * the viewport breakpoint).
225
+ * - `width` (optional, default `1`): number of horizontal
226
+ * cells the element spans.
227
+ * - `height` (optional, default `1`): number of vertical
228
+ * cells the element spans.
400
229
  */
401
- export declare const omit: <T, K extends keyof T>(ref: T, keys: unknown[]) => Omit<T, K>;
230
+ export declare const rwd: (root: CNode, selector: string, cellWidthPx: number, cellHeightPx: number, ...specs: [number, number?, number?][]) => void;
402
231
  /**
403
- * Creates a new object containing only the specified keys
404
- * from the source object.
405
- *
406
- * A runtime equivalent
407
- * of TypeScript’s `Pick<T, K>` utility type.
408
- * See also {@link omit}.
409
- *
410
- * @param ref
411
- *
412
- * The source object.
413
- *
414
- * @param keys
415
- *
416
- * An array of keys to include in the result.
232
+ * Generates a UUID v1 (time-based) identifier.
417
233
  *
418
- * @returns
234
+ * @param date The date to use for the timestamp portion
235
+ * (default: current date/time).
236
+ * @param node A hexadecimal `string` for the node portion
237
+ * (default: random). Must match `/^[0-9a-f]*$/`; it is
238
+ * trimmed to the last 12 characters and left-padded with
239
+ * zeros if shorter.
419
240
  *
420
- * A new object with only the specified keys.
241
+ * @returns A UUID v1 `string` in the standard format
242
+ * `xxxxxxxx-xxxx-1xxx-xxxx-xxxxxxxxxxxx`.
421
243
  */
422
- export declare const pick: <T, K extends keyof T>(ref: T, keys: unknown[]) => Pick<T, K>;
244
+ export declare const uuidV1: (date?: Date, node?: string) => string;
423
245
  /**
424
- * A responsive web design helper
425
- * that generates CSS rules for a grid-like layout.
426
- *
427
- * @param root
428
- *
429
- * The CSS root object to populate (see {@link c}).
430
- *
431
- * @param selector
246
+ * A Proxy-based helper for auto-vivification of nested
247
+ * object structures.
432
248
  *
433
- * The CSS selector for the grid item.
249
+ * Accessing, assigning, or deleting any nested property on
250
+ * the returned proxy automatically creates intermediate
251
+ * objects (or arrays for numeric-string keys matching
252
+ * `^(0|[1-9]\d*)$`) as needed, allowing deep operations
253
+ * without explicit null checks.
434
254
  *
435
- * @param cellWidthPx
255
+ * Intermediates of the last level in a get-only property
256
+ * chain are NOT auto-created. For example,
257
+ * `vivify(ref).one.two` will create `ref.one` as `{}`, but
258
+ * will NOT create `ref.one.two`. Only when a deeper access,
259
+ * assignment, or deletion occurs, e.g.
436
260
  *
437
- * The base cell width in pixels.
261
+ * ```ts
262
+ * delete vivify(ref).one.two.three
263
+ * ```
438
264
  *
439
- * @param cellHeightPx
265
+ * or
440
266
  *
441
- * The base cell height in pixels.
267
+ * ```ts
268
+ * vivify(ref).one.two.three = 4
269
+ * ```
442
270
  *
443
- * @param specs
271
+ * Will `ref.one.two` be materialized.
444
272
  *
445
- * An array of breakpoint specifications, each a tuple of:
446
- * - `maxWidth`: maximum number of cells per row
447
- * (defines the viewport breakpoint).
448
- * - `width` (optional, default `1`):
449
- * number of horizontal cells the element spans.
450
- * - `height` (optional, default `1`):
451
- * number of vertical cells the element spans.
452
- */
453
- export declare const rwd: (root: CRoot, selector: string, cellWidthPx: number, cellHeightPx: number, ...specs: [number, number?, number?][]) => void;
454
- /**
455
- * Generates a UUID v1 (time-based) identifier.
456
- *
457
- * @param date
273
+ * When traversal reaches a primitive value, no
274
+ * auto-creation happens; the primitive’s own property is
275
+ * returned instead (e.g. accessing `.toString.name` on a
276
+ * number yields `'toString'` without modifying the
277
+ * underlying structure).
458
278
  *
459
- * The date to use for the timestamp portion
460
- * (default: current date/time).
279
+ * Deletion on a non-existing intermediate path will
280
+ * auto-create intermediates up to the parent of the deleted
281
+ * key, e.g.
461
282
  *
462
- * @param node
283
+ * ```ts
284
+ * delete vivify(ref).one.two.three
285
+ * ```
463
286
  *
464
- * A hexadecimal `string` for the node portion
465
- * (default: random).
466
- * Must match `/^[0-9a-f]*$/`;
467
- * it is trimmed to the last 12 characters
468
- * and left-padded with zeros if shorter.
287
+ * Will create `ref.one.two` as `{}` if it does not exist.
469
288
  *
470
- * @returns
289
+ * @param ref The root object to wrap.
471
290
  *
472
- * A UUID v1 `string` in the standard format
473
- * `xxxxxxxx-xxxx-1xxx-xxxx-xxxxxxxxxxxx`.
474
- */
475
- export declare const uuidV1: (date?: Date, node?: string) => string;
476
- /**
477
- * A Proxy-based helper for auto-vivification
478
- * of nested object structures.
479
- *
480
- * Accessing, assigning, or deleting any nested property
481
- * on the returned proxy
482
- * automatically creates intermediate objects
483
- * (or arrays for numeric-string keys matching
484
- * `^(0|[1-9]\d*)$`) as needed,
485
- * allowing deep operations without explicit null checks.
486
- *
487
- * Intermediates of the last level
488
- * in a get-only property chain are NOT auto-created.
489
- * For example, `vivify(ref).one.two` will create
490
- * `ref.one` as `{}`, but will NOT create `ref.one.two`.
491
- * Only when a deeper access, assignment, or deletion occurs
492
- * (e.g. `delete vivify(ref).one.two.three`
493
- * or `vivify(ref).one.two.three = 4`)
494
- * will `ref.one.two` be materialized.
495
- *
496
- * When traversal reaches a primitive value,
497
- * no auto-creation happens;
498
- * the primitive’s own property is returned instead
499
- * (e.g. accessing `.toString.name` on a number yields
500
- * `'toString'` without modifying the underlying structure).
501
- *
502
- * Deletion on a non-existing intermediate path
503
- * will auto-create intermediates up to the parent
504
- * of the deleted key
505
- * (e.g. `delete vivify(ref).one.two.three`
506
- * will create `ref.one.two` as `{}` if it does not exist).
507
- *
508
- * @param ref
509
- *
510
- * The root object to wrap.
511
- *
512
- * @returns
513
- *
514
- * A proxy that auto-creates nested objects/arrays
515
- * on property access.
291
+ * @returns A proxy that auto-creates nested objects/arrays
292
+ * on property access.
516
293
  */
517
294
  export declare const vivify: (ref: unknown) => any;