@thi.ng/lsys 2.3.3 → 2.3.5
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 +7 -1
- package/README.md +1 -1
- package/index.d.ts +2 -2
- package/index.js +3 -3
- package/package.json +12 -12
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
-
- **Last updated**: 2025-04-
|
|
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
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 {
|
|
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 =
|
|
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 =
|
|
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.
|
|
3
|
+
"version": "2.3.5",
|
|
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.
|
|
43
|
-
"@thi.ng/checks": "^3.7.
|
|
44
|
-
"@thi.ng/compose": "^3.0.
|
|
45
|
-
"@thi.ng/errors": "^2.5.
|
|
46
|
-
"@thi.ng/math": "^5.11.
|
|
47
|
-
"@thi.ng/random": "^4.1.
|
|
48
|
-
"@thi.ng/transducers": "^9.2.
|
|
49
|
-
"@thi.ng/vectors": "^
|
|
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.0"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
52
|
"esbuild": "^0.25.2",
|
|
53
|
-
"typedoc": "^0.28.
|
|
54
|
-
"typescript": "^5.8.
|
|
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": "
|
|
94
|
+
"gitHead": "c464b6948f92cba90c2ea75b59203dad894fb450\n"
|
|
95
95
|
}
|