@thi.ng/geom-subdiv-curve 2.0.8 → 2.1.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,59 +1,95 @@
1
1
  # Change Log
2
2
 
3
- All notable changes to this project will be documented in this file.
4
- See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
-
6
- ## [2.0.8](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-subdiv-curve@2.0.7...@thi.ng/geom-subdiv-curve@2.0.8) (2021-11-04)
3
+ - **Last updated**: 2021-11-21T17:09:28Z
4
+ - **Generator**: [thi.ng/monopub](https://thi.ng/monopub)
7
5
 
8
- **Note:** Version bump only for package @thi.ng/geom-subdiv-curve
6
+ All notable changes to this project will be documented in this file.
7
+ See [Conventional Commits](https://conventionalcommits.org/) for commit guidelines.
9
8
 
9
+ **Note:** Unlisted _patch_ versions only involve non-code or otherwise excluded changes
10
+ and/or version bumps of transitive dependencies.
10
11
 
12
+ ## [2.1.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/geom-subdiv-curve@2.1.0) (2021-11-17)
11
13
 
14
+ #### 🚀 Features
12
15
 
16
+ - Using workspaces for local tools ([bf7a404](https://github.com/thi-ng/umbrella/commit/bf7a404))
17
+ Improving the overall build ergonomics
18
+ - introduced a tools workspaces
19
+ - imported it in all needed packages/examples
20
+ - inclusive project root
13
21
 
14
- ## [2.0.7](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-subdiv-curve@2.0.6...@thi.ng/geom-subdiv-curve@2.0.7) (2021-11-03)
22
+ #### ♻️ Refactoring
15
23
 
16
- **Note:** Version bump only for package @thi.ng/geom-subdiv-curve
24
+ - testrunner to binary ([4ebbbb2](https://github.com/thi-ng/umbrella/commit/4ebbbb2))
25
+ this commit reverts (partly) changes made in:
26
+ ef346d7a8753590dc9094108a3d861a8dbd5dd2c
27
+ overall purpose is better testament ergonomics:
28
+ instead of having to pass NODE_OPTIONS with every invocation
29
+ having a binary to handle this for us.
17
30
 
31
+ ### [2.0.9](https://github.com/thi-ng/umbrella/tree/@thi.ng/geom-subdiv-curve@2.0.9) (2021-11-10)
18
32
 
33
+ #### ♻️ Refactoring
19
34
 
35
+ - update all countdown loops ([a5f374b](https://github.com/thi-ng/umbrella/commit/a5f374b))
20
36
 
37
+ ### [2.0.1](https://github.com/thi-ng/umbrella/tree/@thi.ng/geom-subdiv-curve@2.0.1) (2021-10-13)
21
38
 
22
- # [2.0.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-subdiv-curve@1.0.5...@thi.ng/geom-subdiv-curve@2.0.0) (2021-10-12)
39
+ #### ♻️ Refactoring
23
40
 
41
+ - update imports in all tests/pkgs ([effd591](https://github.com/thi-ng/umbrella/commit/effd591))
42
+ - update imports in all pkgs ([5fa2b6f](https://github.com/thi-ng/umbrella/commit/5fa2b6f))
43
+ - add .js suffix for all relative imports
24
44
 
25
- ### Build System
45
+ # [2.0.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/geom-subdiv-curve@2.0.0) (2021-10-12)
26
46
 
27
- * major update of ALL pkgs (export maps, ESM only) ([0d1d6ea](https://github.com/thi-ng/umbrella/commit/0d1d6ea9fab2a645d6c5f2bf2591459b939c09b6))
47
+ #### 🛑 Breaking changes
28
48
 
49
+ - major update of ALL pkgs (export maps, ESM only) ([0d1d6ea](https://github.com/thi-ng/umbrella/commit/0d1d6ea))
50
+ - BREAKING CHANGE: discontinue CommonJS & UMD versions
51
+ - only ESM modules will be published from now on
52
+ - CJS obsolete due to ESM support in recent versions of node:
53
+ - i.e. launch NodeJS via:
54
+ - `node --experimental-specifier-resolution=node --experimental-repl-await`
55
+ - in the node REPL use `await import(...)` instead of `require()`
56
+ - UMD obsolete due to widespread browser support for ESM
57
+ Also:
58
+ - normalize/restructure/reorg all package.json files
59
+ - cleanup all build scripts, remove obsolete
60
+ - switch from mocha to [@thi.ng/testament](https://github.com/thi-ng/umbrella/tree/main/packages/testament) for all tests
29
61
 
30
- ### BREAKING CHANGES
62
+ #### ♻️ Refactoring
31
63
 
32
- * discontinue CommonJS & UMD versions
64
+ - update imports (transducers) ([25b674f](https://github.com/thi-ng/umbrella/commit/25b674f))
65
+ - update imports ([a647d4d](https://github.com/thi-ng/umbrella/commit/a647d4d))
66
+ - update all test stubs ([f2d6d53](https://github.com/thi-ng/umbrella/commit/f2d6d53))
67
+ - update all tests in _all_ pkgs ([8b582bc](https://github.com/thi-ng/umbrella/commit/8b582bc))
68
+ - update all to use [@thi.ng/testament](https://github.com/thi-ng/umbrella/tree/main/packages/testament)
33
69
 
34
- - only ESM modules will be published from now on
35
- - CJS obsolete due to ESM support in recent versions of node:
36
- - i.e. launch NodeJS via:
37
- - `node --experimental-specifier-resolution=node --experimental-repl-await`
38
- - in the node REPL use `await import(...)` instead of `require()`
39
- - UMD obsolete due to widespread browser support for ESM
70
+ ### [0.1.67](https://github.com/thi-ng/umbrella/tree/@thi.ng/geom-subdiv-curve@0.1.67) (2020-12-07)
40
71
 
41
- Also:
42
- - normalize/restructure/reorg all package.json files
43
- - cleanup all build scripts, remove obsolete
44
- - switch from mocha to @thi.ng/testament for all tests
72
+ #### ♻️ Refactoring
45
73
 
74
+ - update type-only imports in remaining pkgs ([b22aa30](https://github.com/thi-ng/umbrella/commit/b22aa30))
75
+ - update type-only imports in various tests/pkgs ([3fd9c24](https://github.com/thi-ng/umbrella/commit/3fd9c24))
46
76
 
77
+ ### [0.1.63](https://github.com/thi-ng/umbrella/tree/@thi.ng/geom-subdiv-curve@0.1.63) (2020-09-22)
47
78
 
79
+ #### ♻️ Refactoring
48
80
 
81
+ - update subdivide() ([be79f2e](https://github.com/thi-ng/umbrella/commit/be79f2e))
82
+ - use mapcatIndexed() to simplify composed xform
83
+ - update MID_OPEN, THIRDS_OPEN ([933920d](https://github.com/thi-ng/umbrella/commit/933920d))
49
84
 
85
+ ### [0.1.30](https://github.com/thi-ng/umbrella/tree/@thi.ng/geom-subdiv-curve@0.1.30) (2020-02-25)
50
86
 
51
- ## [1.0.5](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-subdiv-curve@1.0.4...@thi.ng/geom-subdiv-curve@1.0.5) (2021-09-03)
87
+ #### ♻️ Refactoring
52
88
 
53
- **Note:** Version bump only for package @thi.ng/geom-subdiv-curve
89
+ - update imports ([ccc39e1](https://github.com/thi-ng/umbrella/commit/ccc39e1))
54
90
 
55
- # 0.1.0 (2019-02-05)
91
+ ### [0.1.26](https://github.com/thi-ng/umbrella/tree/@thi.ng/geom-subdiv-curve@0.1.26) (2019-11-09)
56
92
 
57
- ### Features
93
+ #### ♻️ Refactoring
58
94
 
59
- - **geom-subdiv-curve:** extract from geom as new package ([324a516](https://github.com/thi-ng/umbrella/commit/324a516))
95
+ - update wrapSides/tween call sites in various pkgs ([ee8200c](https://github.com/thi-ng/umbrella/commit/ee8200c))
package/README.md CHANGED
@@ -72,7 +72,7 @@ node --experimental-repl-await
72
72
  > const geomSubdivCurve = await import("@thi.ng/geom-subdiv-curve");
73
73
  ```
74
74
 
75
- Package sizes (gzipped, pre-treeshake): ESM: 704 bytes
75
+ Package sizes (gzipped, pre-treeshake): ESM: 697 bytes
76
76
 
77
77
  ## Dependencies
78
78
 
package/package.json CHANGED
@@ -1,90 +1,95 @@
1
1
  {
2
- "name": "@thi.ng/geom-subdiv-curve",
3
- "version": "2.0.8",
4
- "description": "Freely customizable, iterative nD subdivision curves for open / closed geometries",
5
- "type": "module",
6
- "module": "./index.js",
7
- "typings": "./index.d.ts",
8
- "sideEffects": false,
9
- "repository": {
10
- "type": "git",
11
- "url": "https://github.com/thi-ng/umbrella.git"
2
+ "name": "@thi.ng/geom-subdiv-curve",
3
+ "version": "2.1.2",
4
+ "description": "Freely customizable, iterative nD subdivision curves for open / closed geometries",
5
+ "type": "module",
6
+ "module": "./index.js",
7
+ "typings": "./index.d.ts",
8
+ "sideEffects": false,
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "https://github.com/thi-ng/umbrella.git"
12
+ },
13
+ "homepage": "https://github.com/thi-ng/umbrella/tree/develop/packages/geom-subdiv-curve#readme",
14
+ "funding": [
15
+ {
16
+ "type": "github",
17
+ "url": "https://github.com/sponsors/postspectacular"
12
18
  },
13
- "homepage": "https://github.com/thi-ng/umbrella/tree/develop/packages/geom-subdiv-curve#readme",
14
- "funding": [
15
- {
16
- "type": "github",
17
- "url": "https://github.com/sponsors/postspectacular"
18
- },
19
- {
20
- "type": "patreon",
21
- "url": "https://patreon.com/thing_umbrella"
22
- }
23
- ],
24
- "author": "Karsten Schmidt <k+npm@thi.ng>",
25
- "license": "Apache-2.0",
26
- "scripts": {
27
- "build": "yarn clean && tsc --declaration",
28
- "clean": "rimraf *.js *.d.ts *.map doc",
29
- "doc": "typedoc --excludePrivate --excludeInternal --out doc src/index.ts",
30
- "doc:ae": "mkdir -p .ae/doc .ae/temp && node_modules/.bin/api-extractor run --local --verbose",
31
- "doc:readme": "yarn doc:stats && ../../scripts/node-esm ../../tools/src/readme.ts",
32
- "doc:stats": "../../scripts/node-esm ../../tools/src/module-stats.ts",
33
- "pub": "yarn build && yarn publish --access public",
34
- "test": "testament test"
19
+ {
20
+ "type": "patreon",
21
+ "url": "https://patreon.com/thing_umbrella"
22
+ }
23
+ ],
24
+ "author": "Karsten Schmidt <k+npm@thi.ng>",
25
+ "license": "Apache-2.0",
26
+ "scripts": {
27
+ "build": "yarn clean && tsc --declaration",
28
+ "clean": "rimraf '*.js' '*.d.ts' '*.map' doc",
29
+ "doc": "typedoc --excludePrivate --excludeInternal --out doc src/index.ts",
30
+ "doc:ae": "mkdir -p .ae/doc .ae/temp && api-extractor run --local --verbose",
31
+ "doc:readme": "yarn doc:stats && tools:readme",
32
+ "doc:stats": "tools:module-stats",
33
+ "pub": "yarn npm publish --access public",
34
+ "test": "testament test"
35
+ },
36
+ "dependencies": {
37
+ "@thi.ng/api": "^8.3.2",
38
+ "@thi.ng/geom-api": "^3.1.2",
39
+ "@thi.ng/transducers": "^8.1.2",
40
+ "@thi.ng/vectors": "^7.2.2"
41
+ },
42
+ "devDependencies": {
43
+ "@microsoft/api-extractor": "^7.18.19",
44
+ "@thi.ng/testament": "^0.2.2",
45
+ "rimraf": "^3.0.2",
46
+ "tools": "^0.0.1",
47
+ "typedoc": "^0.22.9",
48
+ "typescript": "^4.5.2"
49
+ },
50
+ "keywords": [
51
+ "2d",
52
+ "3d",
53
+ "bezier",
54
+ "chaikin",
55
+ "cubic",
56
+ "curve",
57
+ "iterative",
58
+ "polyline",
59
+ "recursive",
60
+ "spline",
61
+ "subdivision",
62
+ "typescript"
63
+ ],
64
+ "publishConfig": {
65
+ "access": "public"
66
+ },
67
+ "engines": {
68
+ "node": ">=12.7"
69
+ },
70
+ "files": [
71
+ "*.js",
72
+ "*.d.ts"
73
+ ],
74
+ "exports": {
75
+ ".": {
76
+ "import": "./index.js"
35
77
  },
36
- "dependencies": {
37
- "@thi.ng/api": "^8.1.0",
38
- "@thi.ng/geom-api": "^3.0.8",
39
- "@thi.ng/transducers": "^8.0.7",
40
- "@thi.ng/vectors": "^7.1.0"
78
+ "./api": {
79
+ "import": "./api.js"
41
80
  },
42
- "devDependencies": {
43
- "@thi.ng/testament": "^0.1.6"
81
+ "./kernels": {
82
+ "import": "./kernels.js"
44
83
  },
45
- "keywords": [
46
- "2d",
47
- "3d",
48
- "bezier",
49
- "chaikin",
50
- "cubic",
51
- "curve",
52
- "iterative",
53
- "polyline",
54
- "recursive",
55
- "spline",
56
- "subdivision",
57
- "typescript"
58
- ],
59
- "publishConfig": {
60
- "access": "public"
61
- },
62
- "engines": {
63
- "node": ">=12.7"
64
- },
65
- "files": [
66
- "*.js",
67
- "*.d.ts"
68
- ],
69
- "exports": {
70
- ".": {
71
- "import": "./index.js"
72
- },
73
- "./api": {
74
- "import": "./api.js"
75
- },
76
- "./kernels": {
77
- "import": "./kernels.js"
78
- },
79
- "./subdivide": {
80
- "import": "./subdivide.js"
81
- }
82
- },
83
- "thi.ng": {
84
- "parent": "@thi.ng/geom",
85
- "related": [
86
- "geom-splines"
87
- ]
88
- },
89
- "gitHead": "d6aca4b4edb697613ed6635b1c0b12f0bf27b1f0"
90
- }
84
+ "./subdivide": {
85
+ "import": "./subdivide.js"
86
+ }
87
+ },
88
+ "thi.ng": {
89
+ "parent": "@thi.ng/geom",
90
+ "related": [
91
+ "geom-splines"
92
+ ]
93
+ },
94
+ "gitHead": "e8a7c2a40191b391cef182c2978e5a6c85987a87\n"
95
+ }
package/subdivide.js CHANGED
@@ -11,7 +11,7 @@ import { transduce } from "@thi.ng/transducers/transduce";
11
11
  * @param iter - number of iterations
12
12
  */
13
13
  export const subdivide = (pts, { fn, pre, size }, iter = 1) => {
14
- while (--iter >= 0) {
14
+ while (iter-- > 0) {
15
15
  const nump = pts.length;
16
16
  pts = transduce(comp(partition(size, 1), mapcatIndexed((i, pts) => fn(pts, i, nump))), push(), pre ? pre(pts) : pts);
17
17
  }