@thi.ng/cellular 0.2.64 → 0.2.66

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/1d.js CHANGED
@@ -1,3 +1,4 @@
1
+ import { rotateTyped } from "@thi.ng/arrays/rotate";
1
2
  import { isBigInt } from "@thi.ng/checks/is-bigint";
2
3
  import { assert } from "@thi.ng/errors/assert";
3
4
  import { SYSTEM } from "@thi.ng/random/system";
@@ -318,12 +319,12 @@ export class MultiCA1D {
318
319
  }
319
320
  rotate(target, dir) {
320
321
  if (target === "all") {
321
- __rotate(this.current, dir);
322
- __rotate(this.mask, dir);
323
- __rotate(this.prob, dir);
322
+ rotateTyped(this.current, dir);
323
+ rotateTyped(this.mask, dir);
324
+ rotateTyped(this.prob, dir);
324
325
  }
325
326
  else {
326
- __rotate(this._getTarget(target)[0], dir);
327
+ rotateTyped(this._getTarget(target)[0], dir);
327
328
  }
328
329
  }
329
330
  _getTarget(target) {
@@ -348,18 +349,6 @@ const __compileSpec = ({ rule, kernel, positional, states, reset, }) => {
348
349
  : (y) => (++y >= max ? max : y),
349
350
  };
350
351
  };
351
- const __rotate = (buf, dir) => {
352
- if (dir < 0) {
353
- const tmp = buf.slice(0, -dir);
354
- buf.copyWithin(0, -dir);
355
- buf.set(tmp, buf.length + dir);
356
- }
357
- else if (dir > 0) {
358
- const tmp = buf.slice(buf.length - dir);
359
- buf.copyWithin(dir, 0);
360
- buf.set(tmp, 0);
361
- }
362
- };
363
352
  /**
364
353
  * Creates a random rule ID for given `kernelSize` and using optionally provided
365
354
  * `rnd`
package/CHANGELOG.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Change Log
2
2
 
3
- - **Last updated**: 2023-10-23T07:37:37Z
3
+ - **Last updated**: 2023-10-27T16:56:24Z
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,14 @@ 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.2.65](https://github.com/thi-ng/umbrella/tree/@thi.ng/cellular@0.2.65) (2023-10-27)
13
+
14
+ #### ♻️ Refactoring
15
+
16
+ - update MultiCA1D.rotate() ([f8fbac6](https://github.com/thi-ng/umbrella/commit/f8fbac6))
17
+ - re-use impl from [@thi.ng/arrays](https://github.com/thi-ng/umbrella/tree/main/packages/arrays)
18
+ - update deps, readme
19
+
12
20
  ### [0.2.47](https://github.com/thi-ng/umbrella/tree/@thi.ng/cellular@0.2.47) (2023-08-12)
13
21
 
14
22
  #### ♻️ Refactoring
package/README.md CHANGED
@@ -161,11 +161,12 @@ For Node.js REPL:
161
161
  const cellular = await import("@thi.ng/cellular");
162
162
  ```
163
163
 
164
- Package sizes (brotli'd, pre-treeshake): ESM: 1.40 KB
164
+ Package sizes (brotli'd, pre-treeshake): ESM: 1.36 KB
165
165
 
166
166
  ## Dependencies
167
167
 
168
168
  - [@thi.ng/api](https://github.com/thi-ng/umbrella/tree/develop/packages/api)
169
+ - [@thi.ng/arrays](https://github.com/thi-ng/umbrella/tree/develop/packages/arrays)
169
170
  - [@thi.ng/checks](https://github.com/thi-ng/umbrella/tree/develop/packages/checks)
170
171
  - [@thi.ng/errors](https://github.com/thi-ng/umbrella/tree/develop/packages/errors)
171
172
  - [@thi.ng/random](https://github.com/thi-ng/umbrella/tree/develop/packages/random)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thi.ng/cellular",
3
- "version": "0.2.64",
3
+ "version": "0.2.66",
4
4
  "description": "Highly customizable 1D cellular automata, shared env, multiple rules, arbitrary sized/shaped neighborhoods, short term memory, cell states etc.",
5
5
  "type": "module",
6
6
  "module": "./index.js",
@@ -35,10 +35,11 @@
35
35
  },
36
36
  "dependencies": {
37
37
  "@thi.ng/api": "^8.9.6",
38
+ "@thi.ng/arrays": "^2.7.1",
38
39
  "@thi.ng/checks": "^3.4.6",
39
40
  "@thi.ng/errors": "^2.4.0",
40
- "@thi.ng/random": "^3.6.10",
41
- "@thi.ng/transducers": "^8.8.5"
41
+ "@thi.ng/random": "^3.6.11",
42
+ "@thi.ng/transducers": "^8.8.7"
42
43
  },
43
44
  "devDependencies": {
44
45
  "@microsoft/api-extractor": "^7.38.0",
@@ -92,5 +93,5 @@
92
93
  ],
93
94
  "year": 2022
94
95
  },
95
- "gitHead": "fc6e14052ed24bf9196896980ceb9f398b6ea6c1\n"
96
+ "gitHead": "bfa16829786146bd24df3cdbd44649a45a603e44\n"
96
97
  }