@thi.ng/api 8.11.2 → 8.11.4
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/CHANGELOG.md +8 -1
- package/README.md +1 -1
- package/fn.d.ts +12 -12
- package/hiccup.d.ts +2 -2
- package/mixins/igrid.js +3 -3
- package/package.json +6 -6
- package/typedarray.js +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
-
- **Last updated**: 2024-
|
|
3
|
+
- **Last updated**: 2024-06-29T09:28:35Z
|
|
4
4
|
- **Generator**: [thi.ng/monopub](https://thi.ng/monopub)
|
|
5
5
|
|
|
6
6
|
All notable changes to this project will be documented in this file.
|
|
@@ -9,6 +9,13 @@ See [Conventional Commits](https://conventionalcommits.org/) for commit guidelin
|
|
|
9
9
|
**Note:** Unlisted _patch_ versions only involve non-code or otherwise excluded changes
|
|
10
10
|
and/or version bumps of transitive dependencies.
|
|
11
11
|
|
|
12
|
+
### [8.11.3](https://github.com/thi-ng/umbrella/tree/@thi.ng/api@8.11.3) (2024-06-21)
|
|
13
|
+
|
|
14
|
+
#### ♻️ Refactoring
|
|
15
|
+
|
|
16
|
+
- rename various rest args to be more semantically meaningful ([8088a56](https://github.com/thi-ng/umbrella/commit/8088a56))
|
|
17
|
+
- enforce uniform naming convention of internal functions ([56992b2](https://github.com/thi-ng/umbrella/commit/56992b2))
|
|
18
|
+
|
|
12
19
|
## [8.11.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/api@8.11.0) (2024-04-20)
|
|
13
20
|
|
|
14
21
|
#### 🚀 Features
|
package/README.md
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
[](https://mastodon.thi.ng/@toxi)
|
|
8
8
|
|
|
9
9
|
> [!NOTE]
|
|
10
|
-
> This is one of
|
|
10
|
+
> This is one of 189 standalone projects, maintained as part
|
|
11
11
|
> of the [@thi.ng/umbrella](https://github.com/thi-ng/umbrella/) monorepo
|
|
12
12
|
> and anti-framework.
|
|
13
13
|
>
|
package/fn.d.ts
CHANGED
|
@@ -42,24 +42,24 @@ export type Fn9<A, B, C, D, E, F, G, H, I, J> = (a: A, b: B, c: C, d: D, e: E, f
|
|
|
42
42
|
* A 10-arg function from A,B,C,D,E,F,G,H,I,J to K.
|
|
43
43
|
*/
|
|
44
44
|
export type Fn10<A, B, C, D, E, F, G, H, I, J, K> = (a: A, b: B, c: C, d: D, e: E, f: F, g: G, h: H, i: I, j: J) => K;
|
|
45
|
-
export type FnO<A, B> = (a: A, ...
|
|
46
|
-
export type FnO2<A, B, C> = (a: A, b: B, ...
|
|
47
|
-
export type FnO3<A, B, C, D> = (a: A, b: B, c: C, ...
|
|
48
|
-
export type FnO4<A, B, C, D, E> = (a: A, b: B, c: C, d: D, ...
|
|
49
|
-
export type FnO5<A, B, C, D, E, F> = (a: A, b: B, c: C, d: D, e: E, ...
|
|
50
|
-
export type FnO6<A, B, C, D, E, F, G> = (a: A, b: B, c: C, d: D, e: E, f: F, ...
|
|
51
|
-
export type FnO7<A, B, C, D, E, F, G, H> = (a: A, b: B, c: C, d: D, e: E, f: F, g: G, ...
|
|
52
|
-
export type FnO8<A, B, C, D, E, F, G, H, I> = (a: A, b: B, c: C, d: D, e: E, f: F, g: G, h: H, ...
|
|
53
|
-
export type FnO9<A, B, C, D, E, F, G, H, I, J> = (a: A, b: B, c: C, d: D, e: E, f: F, g: G, h: H, i: I, ...
|
|
54
|
-
export type FnO10<A, B, C, D, E, F, G, H, I, J, K> = (a: A, b: B, c: C, d: D, e: E, f: F, g: G, h: H, i: I, j: J, ...
|
|
45
|
+
export type FnO<A, B> = (a: A, ...args: any[]) => B;
|
|
46
|
+
export type FnO2<A, B, C> = (a: A, b: B, ...args: any[]) => C;
|
|
47
|
+
export type FnO3<A, B, C, D> = (a: A, b: B, c: C, ...args: any[]) => D;
|
|
48
|
+
export type FnO4<A, B, C, D, E> = (a: A, b: B, c: C, d: D, ...args: any[]) => E;
|
|
49
|
+
export type FnO5<A, B, C, D, E, F> = (a: A, b: B, c: C, d: D, e: E, ...args: any[]) => F;
|
|
50
|
+
export type FnO6<A, B, C, D, E, F, G> = (a: A, b: B, c: C, d: D, e: E, f: F, ...args: any[]) => G;
|
|
51
|
+
export type FnO7<A, B, C, D, E, F, G, H> = (a: A, b: B, c: C, d: D, e: E, f: F, g: G, ...args: any[]) => H;
|
|
52
|
+
export type FnO8<A, B, C, D, E, F, G, H, I> = (a: A, b: B, c: C, d: D, e: E, f: F, g: G, h: H, ...args: any[]) => I;
|
|
53
|
+
export type FnO9<A, B, C, D, E, F, G, H, I, J> = (a: A, b: B, c: C, d: D, e: E, f: F, g: G, h: H, i: I, ...args: any[]) => J;
|
|
54
|
+
export type FnO10<A, B, C, D, E, F, G, H, I, J, K> = (a: A, b: B, c: C, d: D, e: E, f: F, g: G, h: H, i: I, j: J, ...args: any[]) => K;
|
|
55
55
|
/**
|
|
56
56
|
* An untyped vararg arg function to type T.
|
|
57
57
|
*/
|
|
58
|
-
export type FnAny<T> = (...
|
|
58
|
+
export type FnAny<T> = (...args: any[]) => T;
|
|
59
59
|
/**
|
|
60
60
|
* A typed vararg arg function from A to B.
|
|
61
61
|
*/
|
|
62
|
-
export type FnAnyT<A, B> = (...
|
|
62
|
+
export type FnAnyT<A, B> = (...args: A[]) => B;
|
|
63
63
|
/**
|
|
64
64
|
* 1-arg function with arg of type A and return type B (defaults
|
|
65
65
|
* to A)
|
package/hiccup.d.ts
CHANGED
|
@@ -7,8 +7,8 @@ export interface IToHiccup {
|
|
|
7
7
|
*
|
|
8
8
|
* @param ctx - user context object
|
|
9
9
|
* @param attribs - user attribs
|
|
10
|
-
* @param
|
|
10
|
+
* @param args - additional args
|
|
11
11
|
*/
|
|
12
|
-
toHiccup(ctx?: any, attribs?: any, ...
|
|
12
|
+
toHiccup(ctx?: any, attribs?: any, ...args: any[]): any;
|
|
13
13
|
}
|
|
14
14
|
//# sourceMappingURL=hiccup.d.ts.map
|
package/mixins/igrid.js
CHANGED
|
@@ -56,7 +56,7 @@ const IGrid2DMixin = mixin({
|
|
|
56
56
|
});
|
|
57
57
|
const IGrid3DMixin = mixin({
|
|
58
58
|
order() {
|
|
59
|
-
return
|
|
59
|
+
return __strideOrder(this.stride);
|
|
60
60
|
},
|
|
61
61
|
includes(x, y, z) {
|
|
62
62
|
const size = this.size;
|
|
@@ -85,7 +85,7 @@ const IGrid3DMixin = mixin({
|
|
|
85
85
|
});
|
|
86
86
|
const IGrid4DMixin = mixin({
|
|
87
87
|
order() {
|
|
88
|
-
return
|
|
88
|
+
return __strideOrder(this.stride);
|
|
89
89
|
},
|
|
90
90
|
includes(x, y, z, w) {
|
|
91
91
|
const size = this.size;
|
|
@@ -112,7 +112,7 @@ const IGrid4DMixin = mixin({
|
|
|
112
112
|
return true;
|
|
113
113
|
}
|
|
114
114
|
});
|
|
115
|
-
const
|
|
115
|
+
const __strideOrder = (strides) => [...strides].map((x, i) => [x, i]).sort((a, b) => Math.abs(b[0]) - Math.abs(a[0])).map((x) => x[1]);
|
|
116
116
|
export {
|
|
117
117
|
IGrid1DMixin,
|
|
118
118
|
IGrid2DMixin,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thi.ng/api",
|
|
3
|
-
"version": "8.11.
|
|
3
|
+
"version": "8.11.4",
|
|
4
4
|
"description": "Common, generic types, interfaces & mixins",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"type": "git",
|
|
11
11
|
"url": "https://github.com/thi-ng/umbrella.git"
|
|
12
12
|
},
|
|
13
|
-
"homepage": "https://
|
|
13
|
+
"homepage": "https://thi.ng/api",
|
|
14
14
|
"funding": [
|
|
15
15
|
{
|
|
16
16
|
"type": "github",
|
|
@@ -39,10 +39,10 @@
|
|
|
39
39
|
"tool:tangle": "../../node_modules/.bin/tangle src/**/*.ts"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
|
-
"@microsoft/api-extractor": "^7.
|
|
43
|
-
"esbuild": "^0.21.
|
|
42
|
+
"@microsoft/api-extractor": "^7.47.0",
|
|
43
|
+
"esbuild": "^0.21.5",
|
|
44
44
|
"typedoc": "^0.25.13",
|
|
45
|
-
"typescript": "^5.
|
|
45
|
+
"typescript": "^5.5.2"
|
|
46
46
|
},
|
|
47
47
|
"keywords": [
|
|
48
48
|
"assert",
|
|
@@ -228,5 +228,5 @@
|
|
|
228
228
|
"default": "./watch.js"
|
|
229
229
|
}
|
|
230
230
|
},
|
|
231
|
-
"gitHead": "
|
|
231
|
+
"gitHead": "7b950c112fba0b2e7c450765b15624c3382f1354\n"
|
|
232
232
|
}
|
package/typedarray.js
CHANGED
|
@@ -88,9 +88,9 @@ const asGLType = (type) => {
|
|
|
88
88
|
};
|
|
89
89
|
const asInt = (...args) => args.map((x) => x | 0);
|
|
90
90
|
const sizeOf = (type) => SIZEOF[type] || SIZEOF[asNativeType(type)];
|
|
91
|
-
function typedArray(type, ...
|
|
91
|
+
function typedArray(type, ...args) {
|
|
92
92
|
const ctor = BIGINT_ARRAY_CTORS[type];
|
|
93
|
-
return new (ctor || TYPEDARRAY_CTORS[asNativeType(type)])(...
|
|
93
|
+
return new (ctor || TYPEDARRAY_CTORS[asNativeType(type)])(...args);
|
|
94
94
|
}
|
|
95
95
|
function typedArrayOfVec(type, data, stride) {
|
|
96
96
|
const $data = Array.isArray(data) ? data : [...data];
|