@jackens/nnn 2024.2.10 → 2024.2.11
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/h.d.ts +3 -3
- package/h.js +3 -3
- package/jcss.d.ts +1 -1
- package/jcss.js +1 -1
- package/jsOnParse.d.ts +1 -1
- package/jsOnParse.js +1 -1
- package/locale.d.ts +1 -1
- package/locale.js +1 -1
- package/package.json +1 -1
- package/readme.md +7 -7
package/h.d.ts
CHANGED
|
@@ -6,14 +6,14 @@ export type HArgs = [string | Node, ...HArgs1[]];
|
|
|
6
6
|
/**
|
|
7
7
|
* The type of arguments of the `h` and `s` helpers.
|
|
8
8
|
*/
|
|
9
|
-
export type HArgs1 = Record<
|
|
9
|
+
export type HArgs1 = Partial<Record<PropertyKey, any>> | null | undefined | Node | string | number | [string | Node, ...HArgs1[]];
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* A lightweight [HyperScript](https://github.com/hyperhype/hyperscript)-style helper for creating and modifying `HTMLElement`s (see also `s`).
|
|
13
13
|
*
|
|
14
14
|
* - The first argument of type `string` specifies the tag of the element to be created.
|
|
15
15
|
* - The first argument of type `Node` specifies the element to be modified.
|
|
16
|
-
* - All other arguments of type `Record<
|
|
16
|
+
* - All other arguments of type `Partial<Record<PropertyKey, any>>` are mappings of attributes and properties.
|
|
17
17
|
* Keys starting with `$` specify *properties* (without the leading `$`) to be set on the element being created or modified.
|
|
18
18
|
* (Note that `$` is not a valid attribute name character.)
|
|
19
19
|
* All other keys specify *attributes* to be set by `setAttribute`.
|
|
@@ -32,7 +32,7 @@ export function h(tagOrNode: string | Node, ...args1: HArgs1[]): Node;
|
|
|
32
32
|
*
|
|
33
33
|
* - The first argument of type `string` specifies the tag of the element to be created.
|
|
34
34
|
* - The first argument of type `Node` specifies the element to be modified.
|
|
35
|
-
* - All other arguments of type `Record<
|
|
35
|
+
* - All other arguments of type `Partial<Record<PropertyKey, any>>` are mappings of attributes and properties.
|
|
36
36
|
* Keys starting with `$` specify *properties* (without the leading `$`) to be set on the element being created or modified.
|
|
37
37
|
* (Note that `$` is not a valid attribute name character.)
|
|
38
38
|
* All other keys specify *attributes* to be set by `setAttributeNS`.
|
package/h.js
CHANGED
|
@@ -4,7 +4,7 @@ import { is } from './is.js'
|
|
|
4
4
|
/**
|
|
5
5
|
* The type of arguments of the `h` and `s` helpers.
|
|
6
6
|
*
|
|
7
|
-
* @typedef {Record<
|
|
7
|
+
* @typedef {Partial<Record<PropertyKey, any>> | null | undefined | Node | string | number | HArgs} HArgs1
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
/**
|
|
@@ -113,7 +113,7 @@ const _h = (/** @type {string?=} */ namespaceURI) => {
|
|
|
113
113
|
*
|
|
114
114
|
* - The first argument of type `string` specifies the tag of the element to be created.
|
|
115
115
|
* - The first argument of type `Node` specifies the element to be modified.
|
|
116
|
-
* - All other arguments of type `Record<
|
|
116
|
+
* - All other arguments of type `Partial<Record<PropertyKey, any>>` are mappings of attributes and properties.
|
|
117
117
|
* Keys starting with `$` specify *properties* (without the leading `$`) to be set on the element being created or modified.
|
|
118
118
|
* (Note that `$` is not a valid attribute name character.)
|
|
119
119
|
* All other keys specify *attributes* to be set by `setAttribute`.
|
|
@@ -130,7 +130,7 @@ export const h = _h()
|
|
|
130
130
|
*
|
|
131
131
|
* - The first argument of type `string` specifies the tag of the element to be created.
|
|
132
132
|
* - The first argument of type `Node` specifies the element to be modified.
|
|
133
|
-
* - All other arguments of type `Record<
|
|
133
|
+
* - All other arguments of type `Partial<Record<PropertyKey, any>>` are mappings of attributes and properties.
|
|
134
134
|
* Keys starting with `$` specify *properties* (without the leading `$`) to be set on the element being created or modified.
|
|
135
135
|
* (Note that `$` is not a valid attribute name character.)
|
|
136
136
|
* All other keys specify *attributes* to be set by `setAttributeNS`.
|
package/jcss.d.ts
CHANGED
package/jcss.js
CHANGED
package/jsOnParse.d.ts
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* handlers['«handlerName»'](...«params»)
|
|
14
14
|
* ```
|
|
15
15
|
*/
|
|
16
|
-
export function jsOnParse(handlers: Partial<Record<
|
|
16
|
+
export function jsOnParse(handlers: Partial<Record<PropertyKey, Function>>, text: string): any;
|
|
17
17
|
|
|
18
18
|
export namespace tests {
|
|
19
19
|
function jsOnParse(): void;
|
package/jsOnParse.js
CHANGED
|
@@ -18,7 +18,7 @@ import { is } from './is.js'
|
|
|
18
18
|
* ```
|
|
19
19
|
*/
|
|
20
20
|
export const jsOnParse = (
|
|
21
|
-
/** @type {Partial<Record<
|
|
21
|
+
/** @type {Partial<Record<PropertyKey, Function>>} */ handlers,
|
|
22
22
|
/** @type {string} */ text
|
|
23
23
|
) => JSON.parse(text, (key, value) => {
|
|
24
24
|
if (is(Object, value)) {
|
package/locale.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Language translations helper.
|
|
3
3
|
*/
|
|
4
|
-
export function locale(map: Partial<Record<
|
|
4
|
+
export function locale(map: Partial<Record<PropertyKey, Partial<Record<PropertyKey, string>>>>, defaultVersion: string): (text: string, version?: string) => string;
|
|
5
5
|
|
|
6
6
|
export namespace tests {
|
|
7
7
|
function locale(): void;
|
package/locale.js
CHANGED
|
@@ -4,7 +4,7 @@ import { is } from './is.js'
|
|
|
4
4
|
* Language translations helper.
|
|
5
5
|
*/
|
|
6
6
|
export const locale = (
|
|
7
|
-
/** @type {Partial<Record<
|
|
7
|
+
/** @type {Partial<Record<PropertyKey, Partial<Record<PropertyKey, string>>>>} */ map,
|
|
8
8
|
/** @type {string} */ defaultVersion
|
|
9
9
|
) => (
|
|
10
10
|
/** @type {string} */ text,
|
package/package.json
CHANGED
package/readme.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Jackens’ JavaScript helpers.
|
|
4
4
|
|
|
5
|
-
<sub>Version: <code class="version">2024.2.
|
|
5
|
+
<sub>Version: <code class="version">2024.2.11</code></sub>
|
|
6
6
|
|
|
7
7
|
## Installation
|
|
8
8
|
|
|
@@ -75,7 +75,7 @@ The type of arguments of the `h` and `s` helpers.
|
|
|
75
75
|
### HArgs1
|
|
76
76
|
|
|
77
77
|
```ts
|
|
78
|
-
export type HArgs1 = Record<
|
|
78
|
+
export type HArgs1 = Partial<Record<PropertyKey, any>> | null | undefined | Node | string | number | [string | Node, ...HArgs1[]];
|
|
79
79
|
```
|
|
80
80
|
|
|
81
81
|
The type of arguments of the `h` and `s` helpers.
|
|
@@ -93,7 +93,7 @@ The type of arguments of the `jcss` helper.
|
|
|
93
93
|
### JcssRoot
|
|
94
94
|
|
|
95
95
|
```ts
|
|
96
|
-
export type JcssRoot = Partial<Record<
|
|
96
|
+
export type JcssRoot = Partial<Record<PropertyKey, JcssNode>>;
|
|
97
97
|
```
|
|
98
98
|
|
|
99
99
|
The type of arguments of the `jcss` helper.
|
|
@@ -254,7 +254,7 @@ A lightweight [HyperScript](https://github.com/hyperhype/hyperscript)-style help
|
|
|
254
254
|
|
|
255
255
|
- The first argument of type `string` specifies the tag of the element to be created.
|
|
256
256
|
- The first argument of type `Node` specifies the element to be modified.
|
|
257
|
-
- All other arguments of type `Record<
|
|
257
|
+
- All other arguments of type `Partial<Record<PropertyKey, any>>` are mappings of attributes and properties.
|
|
258
258
|
Keys starting with `$` specify *properties* (without the leading `$`) to be set on the element being created or modified.
|
|
259
259
|
(Note that `$` is not a valid attribute name character.)
|
|
260
260
|
All other keys specify *attributes* to be set by `setAttribute`.
|
|
@@ -646,7 +646,7 @@ console.assert(actual === expected)
|
|
|
646
646
|
### jsOnParse
|
|
647
647
|
|
|
648
648
|
```ts
|
|
649
|
-
export function jsOnParse(handlers: Partial<Record<
|
|
649
|
+
export function jsOnParse(handlers: Partial<Record<PropertyKey, Function>>, text: string): any;
|
|
650
650
|
```
|
|
651
651
|
|
|
652
652
|
`JSON.parse` with “JavaScript turned on”.
|
|
@@ -711,7 +711,7 @@ console.assert(eq(actual, expected))
|
|
|
711
711
|
### locale
|
|
712
712
|
|
|
713
713
|
```ts
|
|
714
|
-
export function locale(map: Partial<Record<
|
|
714
|
+
export function locale(map: Partial<Record<PropertyKey, Partial<Record<PropertyKey, string>>>>, defaultVersion: string): (text: string, version?: string) => string;
|
|
715
715
|
```
|
|
716
716
|
|
|
717
717
|
Language translations helper.
|
|
@@ -882,7 +882,7 @@ A lightweight [HyperScript](https://github.com/hyperhype/hyperscript)-style help
|
|
|
882
882
|
|
|
883
883
|
- The first argument of type `string` specifies the tag of the element to be created.
|
|
884
884
|
- The first argument of type `Node` specifies the element to be modified.
|
|
885
|
-
- All other arguments of type `Record<
|
|
885
|
+
- All other arguments of type `Partial<Record<PropertyKey, any>>` are mappings of attributes and properties.
|
|
886
886
|
Keys starting with `$` specify *properties* (without the leading `$`) to be set on the element being created or modified.
|
|
887
887
|
(Note that `$` is not a valid attribute name character.)
|
|
888
888
|
All other keys specify *attributes* to be set by `setAttributeNS`.
|