@thi.ng/api 8.11.1 → 8.11.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.
package/CHANGELOG.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Change Log
2
2
 
3
- - **Last updated**: 2024-04-23T07:02:17Z
3
+ - **Last updated**: 2024-05-08T18:24:31Z
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.
package/mixins/inotify.js CHANGED
@@ -1,8 +1,7 @@
1
1
  import { EVENT_ALL } from "../api.js";
2
2
  import { mixin } from "../mixin.js";
3
3
  const inotify_dispatch = (listeners, e) => {
4
- if (!listeners)
5
- return false;
4
+ if (!listeners) return false;
6
5
  for (let i = 0, n = listeners.length, l; i < n; i++) {
7
6
  l = listeners[i];
8
7
  l[0].call(l[1], e);
@@ -24,8 +23,7 @@ const INotifyMixin = mixin({
24
23
  },
25
24
  removeListener(id, fn, scope) {
26
25
  let listeners;
27
- if (!(listeners = this._listeners))
28
- return false;
26
+ if (!(listeners = this._listeners)) return false;
29
27
  const l = listeners[id];
30
28
  if (l) {
31
29
  const idx = this.__listener(l, fn, scope);
@@ -39,8 +37,7 @@ const INotifyMixin = mixin({
39
37
  },
40
38
  notify(e) {
41
39
  let listeners;
42
- if (!(listeners = this._listeners))
43
- return false;
40
+ if (!(listeners = this._listeners)) return false;
44
41
  e.target === void 0 && (e.target = this);
45
42
  const res = inotify_dispatch(listeners[e.id], e);
46
43
  return inotify_dispatch(listeners[EVENT_ALL], e) || res;
package/mixins/iwatch.js CHANGED
@@ -9,8 +9,7 @@ const IWatchMixin = mixin({
9
9
  return true;
10
10
  },
11
11
  removeWatch(id) {
12
- if (!this._watches)
13
- return;
12
+ if (!this._watches) return;
14
13
  if (this._watches[id]) {
15
14
  delete this._watches[id];
16
15
  return true;
@@ -18,8 +17,7 @@ const IWatchMixin = mixin({
18
17
  return false;
19
18
  },
20
19
  notifyWatches(oldState, newState) {
21
- if (!this._watches)
22
- return;
20
+ if (!this._watches) return;
23
21
  const w = this._watches;
24
22
  for (let id in w) {
25
23
  w[id](id, oldState, newState);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thi.ng/api",
3
- "version": "8.11.1",
3
+ "version": "8.11.2",
4
4
  "description": "Common, generic types, interfaces & mixins",
5
5
  "type": "module",
6
6
  "module": "./index.js",
@@ -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.0",
43
- "esbuild": "^0.20.2",
44
- "typedoc": "^0.25.12",
45
- "typescript": "^5.4.3"
42
+ "@microsoft/api-extractor": "^7.43.2",
43
+ "esbuild": "^0.21.1",
44
+ "typedoc": "^0.25.13",
45
+ "typescript": "^5.4.5"
46
46
  },
47
47
  "keywords": [
48
48
  "assert",
@@ -228,5 +228,5 @@
228
228
  "default": "./watch.js"
229
229
  }
230
230
  },
231
- "gitHead": "5dd66c18a3862a3af69a5b2f49563f7cbdd960c2\n"
231
+ "gitHead": "df34b4a9e650cc7323575356de207d78933bdcf3\n"
232
232
  }
package/typedarray.js CHANGED
@@ -94,8 +94,7 @@ function typedArray(type, ...xs) {
94
94
  }
95
95
  function typedArrayOfVec(type, data, stride) {
96
96
  const $data = Array.isArray(data) ? data : [...data];
97
- if (stride === void 0)
98
- stride = $data[0].length;
97
+ if (stride === void 0) stride = $data[0].length;
99
98
  const num = $data.length;
100
99
  const res = typedArray(type, num * stride);
101
100
  for (let i = 0, j = 0; i < num; i++, j += stride) {
@@ -104,11 +103,9 @@ function typedArrayOfVec(type, data, stride) {
104
103
  return res;
105
104
  }
106
105
  const typedArrayType = (x) => {
107
- if (Array.isArray(x))
108
- return "f64";
106
+ if (Array.isArray(x)) return "f64";
109
107
  for (let id in TYPEDARRAY_CTORS) {
110
- if (x instanceof TYPEDARRAY_CTORS[id])
111
- return id;
108
+ if (x instanceof TYPEDARRAY_CTORS[id]) return id;
112
109
  }
113
110
  return "f64";
114
111
  };