@thi.ng/soa 0.4.56 → 0.4.58

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**: 2023-06-14T07:58:51Z
3
+ - **Last updated**: 2023-08-04T10:58:19Z
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
+ ### [0.4.58](https://github.com/thi-ng/umbrella/tree/@thi.ng/soa@0.4.58) (2023-08-04)
13
+
14
+ #### ♻️ Refactoring
15
+
16
+ - update `identity` usage in various pkgs ([b6db053](https://github.com/thi-ng/umbrella/commit/b6db053))
17
+ - minor type updates ([5a5a813](https://github.com/thi-ng/umbrella/commit/5a5a813))
18
+
12
19
  ## [0.4.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/soa@0.4.0) (2021-11-17)
13
20
 
14
21
  #### 🚀 Features
package/README.md CHANGED
@@ -80,7 +80,7 @@ For Node.js REPL:
80
80
  const soa = await import("@thi.ng/soa");
81
81
  ```
82
82
 
83
- Package sizes (brotli'd, pre-treeshake): ESM: 1.34 KB
83
+ Package sizes (brotli'd, pre-treeshake): ESM: 1.35 KB
84
84
 
85
85
  ## Dependencies
86
86
 
package/api.d.ts CHANGED
@@ -49,8 +49,8 @@ export type SOASpecs<K extends string> = Record<K, Partial<SOAAttribSpec>>;
49
49
  */
50
50
  export type SOATuple<K extends string, V> = Record<K, V>;
51
51
  export interface SerializerPair<T> {
52
- decode: (v: ReadonlyVec) => T;
53
- encode: (x: T) => ReadonlyVec;
52
+ decode: Fn<ReadonlyVec, T>;
53
+ encode: Fn<T, ReadonlyVec>;
54
54
  }
55
55
  export type SerializerSpecs = Record<string, SerializerPair<any>>;
56
56
  export type SerializedType<T extends SerializerSpecs, K extends keyof T> = ReturnType<T[K]["decode"]>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thi.ng/soa",
3
- "version": "0.4.56",
3
+ "version": "0.4.58",
4
4
  "description": "SOA & AOS memory mapped structured views with optional & extensible serialization",
5
5
  "type": "module",
6
6
  "module": "./index.js",
@@ -34,20 +34,20 @@
34
34
  "test": "testament test"
35
35
  },
36
36
  "dependencies": {
37
- "@thi.ng/api": "^8.8.2",
38
- "@thi.ng/binary": "^3.3.26",
39
- "@thi.ng/errors": "^2.2.17",
40
- "@thi.ng/transducers-binary": "^2.1.50",
41
- "@thi.ng/vectors": "^7.7.0"
37
+ "@thi.ng/api": "^8.9.0",
38
+ "@thi.ng/binary": "^3.3.28",
39
+ "@thi.ng/errors": "^2.3.0",
40
+ "@thi.ng/transducers-binary": "^2.1.52",
41
+ "@thi.ng/vectors": "^7.7.2"
42
42
  },
43
43
  "devDependencies": {
44
- "@microsoft/api-extractor": "^7.35.3",
45
- "@thi.ng/equiv": "^2.1.24",
46
- "@thi.ng/testament": "^0.3.17",
44
+ "@microsoft/api-extractor": "^7.36.3",
45
+ "@thi.ng/equiv": "^2.1.25",
46
+ "@thi.ng/testament": "^0.3.18",
47
47
  "rimraf": "^5.0.1",
48
48
  "tools": "^0.0.1",
49
49
  "typedoc": "^0.24.8",
50
- "typescript": "^5.1.3"
50
+ "typescript": "^5.1.6"
51
51
  },
52
52
  "keywords": [
53
53
  "acceleration",
@@ -105,5 +105,5 @@
105
105
  "status": "alpha",
106
106
  "year": 2019
107
107
  },
108
- "gitHead": "a6a6217de89c2875aa78c516d3b5de11ee444834\n"
108
+ "gitHead": "9fa3f7f8169efa30e3c71b43c82f77393581c3b5\n"
109
109
  }
package/serialize.js CHANGED
@@ -1,11 +1,12 @@
1
+ import { identity } from "@thi.ng/api/fn";
1
2
  import { assert } from "@thi.ng/errors/assert";
2
3
  import { utf8Decode, utf8Encode } from "@thi.ng/transducers-binary/utf8";
3
4
  /**
4
5
  * Identity serializer pair (no op).
5
6
  */
6
7
  export const ident = {
7
- decode: (x) => x,
8
- encode: (x) => x,
8
+ decode: identity,
9
+ encode: identity,
9
10
  };
10
11
  /**
11
12
  * Serializer pair for scalars.