@thi.ng/lsys 2.3.4 → 2.3.6

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**: 2025-04-01T21:42:04Z
3
+ - **Last updated**: 2025-04-16T11:11:14Z
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.
@@ -11,6 +11,12 @@ See [Conventional Commits](https://conventionalcommits.org/) for commit guidelin
11
11
  **Note:** Unlisted _patch_ versions only involve non-code or otherwise excluded changes
12
12
  and/or version bumps of transitive dependencies.
13
13
 
14
+ ### [2.3.5](https://github.com/thi-ng/umbrella/tree/@thi.ng/lsys@2.3.5) (2025-04-16)
15
+
16
+ #### ♻️ Refactoring
17
+
18
+ - minor internal optimizations (vector ops), update `RuleImplementations` generics ([c6bc7dc](https://github.com/thi-ng/umbrella/commit/c6bc7dc))
19
+
14
20
  ## [2.3.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/lsys@2.3.0) (2025-03-16)
15
21
 
16
22
  #### 🚀 Features
package/README.md CHANGED
@@ -81,7 +81,7 @@ For Node.js REPL:
81
81
  const lsys = await import("@thi.ng/lsys");
82
82
  ```
83
83
 
84
- Package sizes (brotli'd, pre-treeshake): ESM: 737 bytes
84
+ Package sizes (brotli'd, pre-treeshake): ESM: 728 bytes
85
85
 
86
86
  ## Dependencies
87
87
 
package/index.d.ts CHANGED
@@ -16,7 +16,7 @@ export type ProductionRules = IObjectOf<ProductionResult | Fn<LSysSymbol, Produc
16
16
  * The {@link DEFAULT} symbol can be used as fallback impl, used for any
17
17
  * unmatched symbols.
18
18
  */
19
- export type RuleImplementations<T> = IObjectOf<Fn2<T, LSysSymbol, void>>;
19
+ export type RuleImplementations<T extends object> = IObjectOf<Fn2<T, LSysSymbol, void>>;
20
20
  export interface Turtle2D {
21
21
  /**
22
22
  * Current position.
@@ -146,5 +146,5 @@ export declare const expand: (rules: ProductionRules, initial: LSysSymbol, limit
146
146
  * @param impls
147
147
  * @param syms
148
148
  */
149
- export declare const interpret: <T>(ctx: T, impls: RuleImplementations<T>, syms: Iterable<LSysSymbol>) => T;
149
+ export declare const interpret: <T extends object>(ctx: T, impls: RuleImplementations<T>, syms: Iterable<LSysSymbol>) => T;
150
150
  //# sourceMappingURL=index.d.ts.map
package/index.js CHANGED
@@ -9,20 +9,20 @@ import { iterate } from "@thi.ng/transducers/iterate";
9
9
  import { last } from "@thi.ng/transducers/last";
10
10
  import { mapcat } from "@thi.ng/transducers/mapcat";
11
11
  import { take } from "@thi.ng/transducers/take";
12
- import { add } from "@thi.ng/vectors/add";
12
+ import { add2 } from "@thi.ng/vectors/add";
13
13
  const DEFAULT = Symbol();
14
14
  const TURTLE_IMPL_2D = {
15
15
  // move forward
16
16
  f: (ctx) => {
17
17
  if (ctx.alive) {
18
- ctx.pos = add([], ctx.pos, cossin(ctx.theta, ctx.step));
18
+ ctx.pos = add2([], ctx.pos, cossin(ctx.theta, ctx.step));
19
19
  ctx.curr.push(ctx.pos);
20
20
  }
21
21
  },
22
22
  g: (ctx) => {
23
23
  if (ctx.alive) {
24
24
  ctx.curr.length > 1 && ctx.paths.push(ctx.curr);
25
- ctx.pos = add([], ctx.pos, cossin(ctx.theta, ctx.step));
25
+ ctx.pos = add2([], ctx.pos, cossin(ctx.theta, ctx.step));
26
26
  ctx.curr = [ctx.pos];
27
27
  }
28
28
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thi.ng/lsys",
3
- "version": "2.3.4",
3
+ "version": "2.3.6",
4
4
  "description": "Functional, extensible L-System architecture w/ support for probabilistic rules",
5
5
  "type": "module",
6
6
  "module": "./index.js",
@@ -39,19 +39,19 @@
39
39
  "tool:tangle": "../../node_modules/.bin/tangle src/**/*.ts"
40
40
  },
41
41
  "dependencies": {
42
- "@thi.ng/api": "^8.11.25",
43
- "@thi.ng/checks": "^3.7.5",
44
- "@thi.ng/compose": "^3.0.28",
45
- "@thi.ng/errors": "^2.5.31",
46
- "@thi.ng/math": "^5.11.25",
47
- "@thi.ng/random": "^4.1.16",
48
- "@thi.ng/transducers": "^9.2.25",
49
- "@thi.ng/vectors": "^7.13.1"
42
+ "@thi.ng/api": "^8.11.26",
43
+ "@thi.ng/checks": "^3.7.6",
44
+ "@thi.ng/compose": "^3.0.29",
45
+ "@thi.ng/errors": "^2.5.32",
46
+ "@thi.ng/math": "^5.11.26",
47
+ "@thi.ng/random": "^4.1.17",
48
+ "@thi.ng/transducers": "^9.2.26",
49
+ "@thi.ng/vectors": "^8.0.1"
50
50
  },
51
51
  "devDependencies": {
52
52
  "esbuild": "^0.25.2",
53
- "typedoc": "^0.28.1",
54
- "typescript": "^5.8.2"
53
+ "typedoc": "^0.28.2",
54
+ "typescript": "^5.8.3"
55
55
  },
56
56
  "keywords": [
57
57
  "1d",
@@ -91,5 +91,5 @@
91
91
  ],
92
92
  "year": 2019
93
93
  },
94
- "gitHead": "c88a589f33207b02a43172313b38ea09571265f1\n"
94
+ "gitHead": "69080248c98f9555642384aed76a0431e9f44835\n"
95
95
  }