@thi.ng/fuzzy 2.1.68 → 2.1.70

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**: 2024-02-22T11:59:16Z
3
+ - **Last updated**: 2024-03-01T15:22:50Z
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.
package/README.md CHANGED
@@ -1,16 +1,5 @@
1
1
  <!-- This file is generated - DO NOT EDIT! -->
2
2
  <!-- Please see: https://github.com/thi-ng/umbrella/blob/develop/CONTRIBUTING.md#changes-to-readme-files -->
3
- > [!IMPORTANT]
4
- > ‼️ Announcing the thi.ng user survey 2024 📋
5
- >
6
- > [Please participate in the survey here!](https://forms.gle/XacbSDEmQMPZg8197)\
7
- > (open until end of February)
8
- >
9
- > **To achieve a better sample size, I'd highly appreciate if you could
10
- > circulate the link to this survey in your own networks.**
11
- >
12
- > [Discussion](https://github.com/thi-ng/umbrella/discussions/447)
13
-
14
3
  # ![@thi.ng/fuzzy](https://media.thi.ng/umbrella/banners-20230807/thing-fuzzy.svg?4fb57c92)
15
4
 
16
5
  [![npm version](https://img.shields.io/npm/v/@thi.ng/fuzzy.svg)](https://www.npmjs.com/package/@thi.ng/fuzzy)
@@ -22,7 +11,7 @@
22
11
  > of the [@thi.ng/umbrella](https://github.com/thi-ng/umbrella/) monorepo
23
12
  > and anti-framework.
24
13
  >
25
- > 🚀 Help me to work full-time on these projects by [sponsoring me on
14
+ > 🚀 Please help me to work full-time on these projects by [sponsoring me on
26
15
  > GitHub](https://github.com/sponsors/postspectacular). Thank you! ❤️
27
16
 
28
17
  - [About](#about)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thi.ng/fuzzy",
3
- "version": "2.1.68",
3
+ "version": "2.1.70",
4
4
  "description": "Fuzzy logic operators & configurable rule inferencing engine",
5
5
  "type": "module",
6
6
  "module": "./index.js",
@@ -35,8 +35,8 @@
35
35
  "test": "bun test"
36
36
  },
37
37
  "dependencies": {
38
- "@thi.ng/api": "^8.9.25",
39
- "@thi.ng/math": "^5.10.2"
38
+ "@thi.ng/api": "^8.9.27",
39
+ "@thi.ng/math": "^5.10.4"
40
40
  },
41
41
  "devDependencies": {
42
42
  "@microsoft/api-extractor": "^7.40.1",
@@ -105,5 +105,5 @@
105
105
  "thi.ng": {
106
106
  "year": 2020
107
107
  },
108
- "gitHead": "4513a1c703bdbf0f0867f03e547e47692e415fac\n"
108
+ "gitHead": "d660ae8fd1bf64d919b4334f19509f1f539d70f6\n"
109
109
  }
package/rules.d.ts CHANGED
@@ -16,6 +16,8 @@ import type { LVarKeySet, LVarSet, Rule } from "./api.js";
16
16
  *
17
17
  * @example
18
18
  * ```ts
19
+ * import { rule } from "@thi.ng/fuzzy";
20
+ *
19
21
  * // given 3 LVars from a classic fuzzy logic example:
20
22
  * // food, service, tip
21
23
  *
package/shapes.d.ts CHANGED
@@ -125,6 +125,8 @@ export declare const invAlphaCut: (fn: FuzzyFn, alpha?: number) => FuzzyFn;
125
125
  *
126
126
  * @example
127
127
  * ```ts
128
+ * import { compose, tnormMin, triangle } from "@thi.ng/fuzzy";
129
+ *
128
130
  * const f = compose(tnormMin, 1, triangle(0,2,4), triangle(1,3,5));
129
131
  * f(1); // 0
130
132
  * f(2); // 0.5
@@ -134,6 +136,8 @@ export declare const invAlphaCut: (fn: FuzzyFn, alpha?: number) => FuzzyFn;
134
136
  *
135
137
  * @example
136
138
  * ```ts
139
+ * import { compose, triangle } from "@thi.ng/fuzzy";
140
+ *
137
141
  * // M-like shape w/ peaks at 3 & 5
138
142
  * const M = compose(
139
143
  * Math.max,
@@ -13,6 +13,8 @@ import type { DefuzzStrategy, DefuzzStrategyOpts } from "../api.js";
13
13
  *
14
14
  * @example
15
15
  * ```ts
16
+ * import { bisectorStrategy, trapezoid } from "@thi.ng/fuzzy";
17
+ *
16
18
  * bisectorStrategy()(trapezoid(0,1,5,6), [0,6])
17
19
  * // 2.97
18
20
  *
@@ -13,6 +13,8 @@ import type { DefuzzStrategy, DefuzzStrategyOpts } from "../api.js";
13
13
  *
14
14
  * @example
15
15
  * ```ts
16
+ * import { centroidStrategy, trapezoid } from "@thi.ng/fuzzy";
17
+ *
16
18
  * centroidStrategy()(trapezoid(0,1,5,6), [0,6])
17
19
  * // 3.0000000000000004
18
20
  *
@@ -10,6 +10,8 @@ import type { DefuzzStrategy, DefuzzStrategyOpts } from "../api.js";
10
10
  *
11
11
  * @example
12
12
  * ```ts
13
+ * import { meanOfMaximaStrategy, trapezoid } from "@thi.ng/fuzzy";
14
+ *
13
15
  * meanOfMaximaStrategy()(trapezoid(0,1,5,6), [0,6])
14
16
  * // 3
15
17
  *
@@ -39,6 +41,8 @@ export declare const meanOfMaximaStrategy: (opts?: Partial<DefuzzStrategyOpts>)
39
41
  *
40
42
  * @example
41
43
  * ```ts
44
+ * import { firstOfMaximaStrategy, trapezoid } from "@thi.ng/fuzzy";
45
+ *
42
46
  * firstOfMaximaStrategy()(trapezoid(0,1,5,6), [0,6])
43
47
  * // 1.02
44
48
  *
@@ -68,6 +72,8 @@ export declare const firstOfMaximaStrategy: (opts?: Partial<DefuzzStrategyOpts>)
68
72
  *
69
73
  * @example
70
74
  * ```ts
75
+ * import { lastOfMaximaStrategy, trapezoid } from "@thi.ng/fuzzy";
76
+ *
71
77
  * lastOfMaximaStrategy()(trapezoid(0,1,5,6), [0,6])
72
78
  * // 4.98
73
79
  *
package/var.d.ts CHANGED
@@ -6,6 +6,8 @@ import type { LVar } from "./api.js";
6
6
  *
7
7
  * @example
8
8
  * ```ts
9
+ * import { variable, invSigmoid, sigmoid, trapezoid } from "@thi.ng/fuzzy";
10
+ *
9
11
  * // temperature sets (in celsius)
10
12
  * const temp = variable([-20, 40], {
11
13
  * freezing: invSigmoid(0, 2),
@@ -27,6 +29,8 @@ export declare const variable: <K extends string>(domain: import("@thi.ng/api").
27
29
  *
28
30
  * @example
29
31
  * ```ts
32
+ * import { classify, variable, invSigmoid, sigmoid, trapezoid } from "@thi.ng/fuzzy";
33
+ *
30
34
  * // temperature sets (in celsius)
31
35
  * const temp = variable([-20, 40], {
32
36
  * freezing: invSigmoid(0, 2),
@@ -50,6 +54,8 @@ export declare const classify: <K extends string>({ terms }: LVar<K>, x: number,
50
54
  *
51
55
  * @example
52
56
  * ```ts
57
+ * import { evaluate, variable, invSigmoid, sigmoid, trapezoid } from "@thi.ng/fuzzy";
58
+ *
53
59
  * // temperature sets (in celsius)
54
60
  * const temp = variable([-20, 40], {
55
61
  * freezing: invSigmoid(0, 2),