@jackens/nnn 2025.9.4 → 2025.9.6

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 (3) hide show
  1. package/nnn.d.ts +6 -5
  2. package/package.json +1 -1
  3. package/readme.md +40 -33
package/nnn.d.ts CHANGED
@@ -97,15 +97,17 @@ export declare const has_own: (ref: unknown, key: unknown) => boolean;
97
97
  /**
98
98
  * Checks whether the argument is an array.
99
99
  */
100
- export declare const is_array: (arg: any) => arg is any[];
101
- declare const FINITE_NUMBER: unique symbol;
102
- type Finite_Number = number & {
100
+ export declare const is_array: (arg: unknown) => arg is unknown[];
101
+ /**
102
+ * `number` type excluding `±Infinity` and `NaN`.
103
+ */
104
+ export type Finite_Number = number & {
103
105
  readonly [FINITE_NUMBER]: true;
104
106
  };
105
107
  /**
106
108
  * Checks whether the argument is a finite number (excluding `±Infinity` and `NaN`).
107
109
  */
108
- export declare const is_finite_number: ((arg: unknown) => arg is Finite_Number);
110
+ export declare const is_finite_number: (arg: unknown) => arg is Finite_Number;
109
111
  /**
110
112
  * Checks whether the argument is a number.
111
113
  */
@@ -135,7 +137,6 @@ export {};
135
137
  * ```
136
138
  */
137
139
  export declare const js_on_parse: (handlers: Record<PropertyKey, Function>, text: string) => any;
138
- import type { H_Args_1 } from './h.js';
139
140
  /**
140
141
  * Generic syntax highlighting helper (see also `nanolight_js`).
141
142
  */
package/package.json CHANGED
@@ -36,5 +36,5 @@
36
36
  "name": "@jackens/nnn",
37
37
  "type": "module",
38
38
  "types": "nnn.d.ts",
39
- "version": "2025.9.4"
39
+ "version": "2025.9.6"
40
40
  }
package/readme.md CHANGED
@@ -28,33 +28,34 @@ import { «something» } from './node_modules/@jackens/nnn/nnn.js'
28
28
 
29
29
  ## Exports
30
30
 
31
- - `C_Node`: Argument type for the `c` helper.
32
- - `C_Root`: Argument type for the `c` helper.
33
- - `Escape_Map`: Argument type accepted by the `escape_values` and `escape` helpers.
34
- - `H_Args`: Argument type for the `h` and `s` helpers.
35
- - `H_Args_1`: Argument type for the `h` and `s` helpers.
36
- - `c`: A minimal JS-to-CSS (CSS‑in‑JS) helper.
37
- - `csv_parse`: A tiny CSV parsing helper.
38
- - `escape`: Escapes interpolated template `values` using the provided `escape_map`.
39
- - `escape_values`: Escapes array `values` using the provided `escape_map`.
40
- - `fix_typography`: Applies Polish‑specific typographic corrections.
41
- - `h`: A lightweight [HyperScript](https://github.com/hyperhype/hyperscript)-style helper for creating and modifying `HTMLElement`s (see also `s`).
42
- - `has_own`: A replacement to the `in` operator (not to be confused with `for-in`).
43
- - `is_array`: Checks whether the argument is an array.
44
- - `is_finite_number`: Checks whether the argument is a finite number (excluding `±Infinity` and `NaN`).
45
- - `is_number`: Checks whether the argument is a number.
46
- - `is_record`: Checks whether the argument is a plain object record.
47
- - `is_string`: Checks whether the argument is a string.
48
- - `js_on_parse`: `JSON.parse` with “JavaScript turned on”.
49
- - `nanolight`: Generic syntax highlighting helper (see also `nanolight_js`).
50
- - `nanolight_js`: JavaScript syntax highlighting helper (built on `nanolight`).
51
- - `omit`: Runtime implementation of TypeScript’s `Omit` (see also `pick`).
52
- - `pick`: Runtime implementation of TypeScript’s `Pick` (see also `omit`).
53
- - `pl_ural`: Chooses the appropriate Polish noun form based on a numeric value.
54
- - `pro`: A `Proxy`-based helper that safely creates nested structures on access and allows deep assignment without guards.
55
- - `s`: A lightweight [HyperScript](https://github.com/hyperhype/hyperscript)-style helper for creating and modifying `SVGElement`s (see also `h`).
56
- - `svg_use`: Shorthand for: `s('svg', ['use', { 'xlink:href': '#' + id }], ...args)`.
57
- - `uuid_v1`: Generates a UUID v1 (time-based) identifier.
31
+ - [`C_Node`](#C_Node): Argument type for the `c` helper.
32
+ - [`C_Root`](#C_Root): Argument type for the `c` helper.
33
+ - [`Escape_Map`](#Escape_Map): Argument type accepted by the `escape_values` and `escape` helpers.
34
+ - [`Finite_Number`](#Finite_Number): `number` type excluding `±Infinity` and `NaN`.
35
+ - [`H_Args`](#H_Args): Argument type for the `h` and `s` helpers.
36
+ - [`H_Args_1`](#H_Args_1): Argument type for the `h` and `s` helpers.
37
+ - [`c`](#c): A minimal JS-to-CSS (CSS‑in‑JS) helper.
38
+ - [`csv_parse`](#csv_parse): A tiny CSV parsing helper.
39
+ - [`escape`](#escape): Escapes interpolated template `values` using the provided `escape_map`.
40
+ - [`escape_values`](#escape_values): Escapes array `values` using the provided `escape_map`.
41
+ - [`fix_typography`](#fix_typography): Applies Polish‑specific typographic corrections.
42
+ - [`h`](#h): A lightweight [HyperScript](https://github.com/hyperhype/hyperscript)-style helper for creating and modifying `HTMLElement`s (see also `s`).
43
+ - [`has_own`](#has_own): A replacement to the `in` operator (not to be confused with `for-in`).
44
+ - [`is_array`](#is_array): Checks whether the argument is an array.
45
+ - [`is_finite_number`](#is_finite_number): Checks whether the argument is a finite number (excluding `±Infinity` and `NaN`).
46
+ - [`is_number`](#is_number): Checks whether the argument is a number.
47
+ - [`is_record`](#is_record): Checks whether the argument is a plain object record.
48
+ - [`is_string`](#is_string): Checks whether the argument is a string.
49
+ - [`js_on_parse`](#js_on_parse): `JSON.parse` with “JavaScript turned on”.
50
+ - [`nanolight`](#nanolight): Generic syntax highlighting helper (see also `nanolight_js`).
51
+ - [`nanolight_js`](#nanolight_js): JavaScript syntax highlighting helper (built on `nanolight`).
52
+ - [`omit`](#omit): Runtime implementation of TypeScript’s `Omit` (see also `pick`).
53
+ - [`pick`](#pick): Runtime implementation of TypeScript’s `Pick` (see also `omit`).
54
+ - [`pl_ural`](#pl_ural): Chooses the appropriate Polish noun form based on a numeric value.
55
+ - [`pro`](#pro): A `Proxy`-based helper that safely creates nested structures on access and allows deep assignment without guards.
56
+ - [`s`](#s): A lightweight [HyperScript](https://github.com/hyperhype/hyperscript)-style helper for creating and modifying `SVGElement`s (see also `h`).
57
+ - [`svg_use`](#svg_use): Shorthand for: `s('svg', ['use', { 'xlink:href': '#' + id }], ...args)`.
58
+ - [`uuid_v1`](#uuid_v1): Generates a UUID v1 (time-based) identifier.
58
59
 
59
60
  ### C_Node
60
61
 
@@ -82,6 +83,16 @@ type Escape_Map = Map<unknown, (value?: unknown) => string>;
82
83
 
83
84
  Argument type accepted by the `escape_values` and `escape` helpers.
84
85
 
86
+ ### Finite_Number
87
+
88
+ ```ts
89
+ type Finite_Number = number & {
90
+ readonly [FINITE_NUMBER]: true;
91
+ };
92
+ ```
93
+
94
+ `number` type excluding `±Infinity` and `NaN`.
95
+
85
96
  ### H_Args
86
97
 
87
98
  ```ts
@@ -534,11 +545,7 @@ expect(has_own(undefined, 'key')).to.be.false
534
545
  ### is_array
535
546
 
536
547
  ```ts
537
- const is_array: (arg: any) => arg is any[];
538
- declare const FINITE_NUMBER: unique symbol;
539
- type Finite_Number = number & {
540
- readonly [FINITE_NUMBER]: true;
541
- };
548
+ const is_array: (arg: unknown) => arg is unknown[];
542
549
  ```
543
550
 
544
551
  Checks whether the argument is an array.
@@ -546,7 +553,7 @@ Checks whether the argument is an array.
546
553
  ### is_finite_number
547
554
 
548
555
  ```ts
549
- const is_finite_number: ((arg: unknown) => arg is Finite_Number);
556
+ const is_finite_number: (arg: unknown) => arg is Finite_Number;
550
557
  ```
551
558
 
552
559
  Checks whether the argument is a finite number (excluding `±Infinity` and `NaN`).