@pie-lib/math-evaluator 2.1.23 → 2.1.24-next.1848

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.json CHANGED
@@ -1,457 +1 @@
1
- [
2
- {
3
- "type": "fix",
4
- "scope": null,
5
- "subject": "rm child prepack in favour of root prepack",
6
- "merge": null,
7
- "header": "fix: rm child prepack in favour of root prepack",
8
- "body": null,
9
- "footer": null,
10
- "notes": [],
11
- "hash": "381d8d6485269b641d8d4655148966d2e70803be",
12
- "gitTags": "",
13
- "committerDate": "2019-03-15 09:51:11 +0000",
14
- "isTagged": true,
15
- "tag": "@pie-lib/math-evaluator@0.3.9"
16
- },
17
- {
18
- "type": "chore",
19
- "scope": null,
20
- "subject": "get packages to call changelog function on prepack",
21
- "merge": null,
22
- "header": "chore: get packages to call changelog function on prepack",
23
- "body": null,
24
- "footer": null,
25
- "notes": [],
26
- "hash": "8828f01f2d16d29404ba837c1de40d09e7230ec5",
27
- "gitTags": "",
28
- "committerDate": "2019-03-14 12:40:05 +0000",
29
- "isTagged": true,
30
- "tag": "@pie-lib/math-evaluator@0.3.5"
31
- },
32
- {
33
- "type": "chore",
34
- "scope": null,
35
- "subject": "call changelog on prepack",
36
- "merge": null,
37
- "header": "chore: call changelog on prepack",
38
- "body": null,
39
- "footer": null,
40
- "notes": [],
41
- "hash": "b672c012de096c55b765a765f758da3fc5df2f90",
42
- "gitTags": "",
43
- "committerDate": "2019-03-13 23:00:44 +0000",
44
- "isTagged": true,
45
- "tag": "@pie-lib/math-evaluator@0.3.4"
46
- },
47
- {
48
- "type": "chore",
49
- "scope": null,
50
- "subject": "generate changelog.json instead of markdown",
51
- "merge": null,
52
- "header": "chore: generate changelog.json instead of markdown",
53
- "body": null,
54
- "footer": null,
55
- "notes": [],
56
- "hash": "eaa5019a11f70c53425d55856bd3b940237f8c7d",
57
- "gitTags": "",
58
- "committerDate": "2019-03-13 17:24:09 +0000",
59
- "isTagged": true,
60
- "tag": "@pie-lib/math-evaluator@0.3.2"
61
- },
62
- {
63
- "type": "feat",
64
- "scope": null,
65
- "subject": "libs version bump",
66
- "merge": null,
67
- "header": "feat: libs version bump",
68
- "body": null,
69
- "footer": null,
70
- "notes": [],
71
- "hash": "4edc4bebdd7694efe5b18230c0dd5215591d4a28",
72
- "gitTags": "",
73
- "committerDate": "2019-01-30 22:14:28 +0000",
74
- "isTagged": true,
75
- "tag": "@pie-lib/math-evaluator@0.3.0"
76
- },
77
- {
78
- "type": "fix",
79
- "scope": null,
80
- "subject": "math-expressions import",
81
- "merge": null,
82
- "header": "fix: math-expressions import",
83
- "body": null,
84
- "footer": null,
85
- "notes": [],
86
- "hash": "10d25b98d80d0295e5386320d885107a10f9b7d1",
87
- "gitTags": "",
88
- "committerDate": "2019-01-30 22:14:28 +0000",
89
- "isTagged": true,
90
- "tag": "@pie-lib/math-evaluator@0.3.0"
91
- },
92
- {
93
- "type": "fix",
94
- "scope": null,
95
- "subject": "use plain module from math-expressions",
96
- "merge": null,
97
- "header": "fix: use plain module from math-expressions",
98
- "body": null,
99
- "footer": null,
100
- "notes": [],
101
- "hash": "a8f0647adb9cf9419c12f742914a34b570f3f661",
102
- "gitTags": "",
103
- "committerDate": "2019-01-16 21:44:10 +0000",
104
- "isTagged": true,
105
- "tag": "@pie-lib/math-evaluator@0.3.0"
106
- },
107
- {
108
- "type": "chore",
109
- "scope": "math-evaluator",
110
- "subject": "unit test adjustments and fixes",
111
- "merge": null,
112
- "header": "chore(math-evaluator): unit test adjustments and fixes",
113
- "body": null,
114
- "footer": null,
115
- "notes": [],
116
- "hash": "38fc44c3f06549efe72b5d1608aad0ca9f0b98fe",
117
- "gitTags": "",
118
- "committerDate": "2018-11-09 13:48:04 +0200",
119
- "isTagged": true,
120
- "tag": "@pie-lib/math-evaluator@0.2.0"
121
- },
122
- {
123
- "type": "feat",
124
- "scope": "math-evaluator",
125
- "subject": "finalized for first release",
126
- "merge": null,
127
- "header": "feat(math-evaluator): finalized for first release",
128
- "body": null,
129
- "footer": null,
130
- "notes": [],
131
- "hash": "e696925b36d047b689174fabf25950c17e53abdf",
132
- "gitTags": "",
133
- "committerDate": "2018-11-08 08:57:08 +0200",
134
- "isTagged": true,
135
- "tag": "@pie-lib/math-evaluator@0.2.0"
136
- },
137
- {
138
- "type": "feat",
139
- "scope": "math-evaluator",
140
- "subject": "finalized feature for first release",
141
- "merge": null,
142
- "header": "feat(math-evaluator): finalized feature for first release",
143
- "body": null,
144
- "footer": null,
145
- "notes": [],
146
- "hash": "f02d7b36a7c3e8ae1d9e5950cd8a173250ec2905",
147
- "gitTags": "",
148
- "committerDate": "2018-11-07 12:17:28 +0200",
149
- "isTagged": true,
150
- "tag": "@pie-lib/math-evaluator@0.2.0"
151
- },
152
- {
153
- "type": "fix",
154
- "scope": "math-evaluator",
155
- "subject": "small unit test adjustments",
156
- "merge": null,
157
- "header": "fix(math-evaluator): small unit test adjustments",
158
- "body": null,
159
- "footer": null,
160
- "notes": [],
161
- "hash": "92a2eab125b023374c6d69dcf191a49b7f78b122",
162
- "gitTags": "",
163
- "committerDate": "2018-10-23 14:00:09 +0300",
164
- "isTagged": true,
165
- "tag": "@pie-lib/math-evaluator@0.1.0"
166
- },
167
- {
168
- "type": "feat",
169
- "scope": "math-evaluator",
170
- "subject": "feature added",
171
- "merge": null,
172
- "header": "feat(math-evaluator): feature added",
173
- "body": null,
174
- "footer": null,
175
- "notes": [],
176
- "hash": "0703e9e94b4126c943d6af5e2b1cc45ec2454115",
177
- "gitTags": "",
178
- "committerDate": "2018-10-22 09:48:19 +0300",
179
- "isTagged": true,
180
- "tag": "@pie-lib/math-evaluator@0.1.0"
181
- },
182
- {
183
- "type": "chore",
184
- "scope": null,
185
- "subject": "prettify it",
186
- "merge": null,
187
- "header": "chore: prettify it",
188
- "body": null,
189
- "footer": null,
190
- "notes": [],
191
- "hash": "32b365bcd81976fbe8ecb6c7c0574d6a9226a4aa",
192
- "gitTags": "",
193
- "committerDate": "2019-04-10 10:27:22 +0300",
194
- "isTagged": true,
195
- "tag": "@pie-lib/math-evaluator@0.4.0"
196
- },
197
- {
198
- "type": "feat",
199
- "scope": "math-evaluator",
200
- "subject": "introduce partial rationalization, polynomial equation fixes and allowDecimals option",
201
- "merge": null,
202
- "header": "feat(math-evaluator): introduce partial rationalization, polynomial equation fixes and allowDecimals option",
203
- "body": null,
204
- "footer": null,
205
- "notes": [],
206
- "hash": "78fe0a11eaaf23db7134e08d2b2ed2a2cd1b427b",
207
- "gitTags": "",
208
- "committerDate": "2019-04-10 10:22:39 +0300",
209
- "isTagged": true,
210
- "tag": "@pie-lib/math-evaluator@0.4.0"
211
- },
212
- {
213
- "type": "chore",
214
- "scope": null,
215
- "subject": "update unit tests for math-evaluator",
216
- "merge": null,
217
- "header": "chore: update unit tests for math-evaluator",
218
- "body": null,
219
- "footer": null,
220
- "notes": [],
221
- "hash": "b478b0fb87da0d321fe1af40a5cdef1b7bb0d1d3",
222
- "gitTags": "",
223
- "committerDate": "2019-05-13 15:02:24 +0300",
224
- "isTagged": true,
225
- "tag": "@pie-lib/math-evaluator@0.5.0"
226
- },
227
- {
228
- "type": "feat",
229
- "scope": "math-evaluator",
230
- "subject": "re-define what allowDecimals means - thousand separator support with decimal dot support",
231
- "merge": null,
232
- "header": "feat(math-evaluator): re-define what allowDecimals means - thousand separator support with decimal dot support",
233
- "body": null,
234
- "footer": null,
235
- "notes": [],
236
- "hash": "f79ff3b9b239716076fc9b1fd79868ab74680894",
237
- "gitTags": "",
238
- "committerDate": "2019-05-13 14:59:36 +0300",
239
- "isTagged": true,
240
- "tag": "@pie-lib/math-evaluator@0.5.0"
241
- },
242
- {
243
- "type": "chore",
244
- "scope": "merge",
245
- "subject": "merged with develop",
246
- "merge": null,
247
- "header": "chore(merge): merged with develop",
248
- "body": null,
249
- "footer": null,
250
- "notes": [],
251
- "hash": "e68506cf63b2a17973821bb0cfef40828faccd1f",
252
- "gitTags": "",
253
- "committerDate": "2019-05-21 06:26:54 +0300",
254
- "isTagged": true,
255
- "tag": "@pie-lib/math-evaluator@0.5.1"
256
- },
257
- {
258
- "type": "fix",
259
- "scope": "math-evaluator",
260
- "subject": "fix equals sign treatment in expressions",
261
- "merge": null,
262
- "header": "fix(math-evaluator): fix equals sign treatment in expressions",
263
- "body": null,
264
- "footer": null,
265
- "notes": [],
266
- "hash": "f81e9245ad3fefd0895c510cd3e2b2f3d4d11843",
267
- "gitTags": " (origin/fix/math-evaluator-expression-fixes)",
268
- "committerDate": "2019-06-25 15:43:58 +0300",
269
- "isTagged": true,
270
- "tag": "@pie-lib/math-evaluator@0.5.4"
271
- },
272
- {
273
- "type": "chore",
274
- "scope": null,
275
- "subject": "added two failing tests for math-evaluator",
276
- "merge": null,
277
- "header": "chore: added two failing tests for math-evaluator",
278
- "body": null,
279
- "footer": null,
280
- "notes": [],
281
- "hash": "326a94b419dc16c3a23b80d155e0b0a3e32a7b28",
282
- "gitTags": "",
283
- "committerDate": "2019-06-24 18:26:25 +0300",
284
- "isTagged": true,
285
- "tag": "@pie-lib/math-evaluator@0.5.4"
286
- },
287
- {
288
- "type": "feat",
289
- "scope": "math-evaluator",
290
- "subject": "change math-expressions to pie fork",
291
- "merge": null,
292
- "header": "feat(math-evaluator): change math-expressions to pie fork",
293
- "body": null,
294
- "footer": null,
295
- "notes": [],
296
- "hash": "06e8b617fd8f3d54057850d3964616165bdf7ad7",
297
- "gitTags": "",
298
- "committerDate": "2019-11-22 16:17:54 +0200",
299
- "isTagged": true,
300
- "tag": "@pie-lib/math-evaluator@0.6.0"
301
- },
302
- {
303
- "type": "fix",
304
- "scope": "math-evaluator",
305
- "subject": "finalize fix for PIE-188, custom and unrecognized latex commands",
306
- "merge": null,
307
- "header": "fix(math-evaluator): finalize fix for PIE-188, custom and unrecognized latex commands",
308
- "body": null,
309
- "footer": null,
310
- "notes": [],
311
- "hash": "b37184d6a1a7676fe25372b2388dd60fad94638d",
312
- "gitTags": "",
313
- "committerDate": "2019-11-22 12:32:30 +0200",
314
- "isTagged": true,
315
- "tag": "@pie-lib/math-evaluator@0.6.0"
316
- },
317
- {
318
- "type": "fix",
319
- "scope": "math-evaluator",
320
- "subject": "finalize fix for PIE-188",
321
- "merge": null,
322
- "header": "fix(math-evaluator): finalize fix for PIE-188",
323
- "body": null,
324
- "footer": null,
325
- "notes": [],
326
- "hash": "d7bd4a1d0576d1c6e2fbf6b46ad5c6a12ad70133",
327
- "gitTags": "",
328
- "committerDate": "2019-11-22 12:14:12 +0200",
329
- "isTagged": true,
330
- "tag": "@pie-lib/math-evaluator@0.6.0"
331
- },
332
- {
333
- "type": "fix",
334
- "scope": "math-evaluator",
335
- "subject": "PIE-188 related fixes and tests",
336
- "merge": null,
337
- "header": "fix(math-evaluator): PIE-188 related fixes and tests",
338
- "body": null,
339
- "footer": null,
340
- "notes": [],
341
- "hash": "76424c677a8d0147e7654ca27098d682da9a42bb",
342
- "gitTags": "",
343
- "committerDate": "2019-11-19 13:16:36 +0200",
344
- "isTagged": true,
345
- "tag": "@pie-lib/math-evaluator@0.6.0"
346
- },
347
- {
348
- "type": "fix",
349
- "scope": null,
350
- "subject": "bump @pie-framework/math-expressions@^2.1.0 ch6456",
351
- "merge": null,
352
- "header": "fix: bump @pie-framework/math-expressions@^2.1.0 ch6456",
353
- "body": null,
354
- "footer": null,
355
- "notes": [],
356
- "hash": "d57971f1f1dd2943ced3ffa3dec0a324ba04e487",
357
- "gitTags": " (origin/fix/ch6456-percent)",
358
- "committerDate": "2019-12-20 11:14:25 +0000",
359
- "isTagged": true,
360
- "tag": "@pie-lib/math-evaluator@0.6.5"
361
- },
362
- {
363
- "type": "fix",
364
- "scope": null,
365
- "subject": "bump @pie-framework/math-expressions@2.2.0 [ch7119]",
366
- "merge": null,
367
- "header": "fix: bump @pie-framework/math-expressions@2.2.0 [ch7119]",
368
- "body": null,
369
- "footer": null,
370
- "notes": [],
371
- "hash": "b7fa81033d2980228e5f07f44904c63e0aea84c1",
372
- "gitTags": "",
373
- "committerDate": "2020-01-27 11:07:32 +0000",
374
- "isTagged": true,
375
- "tag": "@pie-lib/math-evaluator@0.6.6"
376
- },
377
- {
378
- "type": "fix",
379
- "scope": null,
380
- "subject": "throw error if number missing factor",
381
- "merge": null,
382
- "header": "fix: throw error if number missing factor",
383
- "body": null,
384
- "footer": null,
385
- "notes": [],
386
- "hash": "3b23b28e851d07c49c414b05d747141d415e960e",
387
- "gitTags": " (origin/develop, origin/HEAD, develop)",
388
- "committerDate": "2020-01-28 11:27:09 +0000",
389
- "isTagged": true,
390
- "tag": "@pie-lib/math-evaluator@0.6.7"
391
- },
392
- {
393
- "type": "fix",
394
- "scope": null,
395
- "subject": "add module prop to package.json",
396
- "merge": null,
397
- "header": "fix: add module prop to package.json",
398
- "body": null,
399
- "footer": null,
400
- "notes": [],
401
- "hash": "f0d7718fe0c7ec5a3f0bbab23e8a981cac112488",
402
- "gitTags": "",
403
- "committerDate": "2020-03-30 13:02:17 +0100",
404
- "isTagged": true,
405
- "tag": "@pie-lib/math-evaluator@0.6.9"
406
- },
407
- {
408
- "type": "fix",
409
- "scope": "math-evaluator",
410
- "subject": "support `x^(1/y) == sqrt(x,y)` PD-3",
411
- "merge": null,
412
- "header": "fix(math-evaluator): support `x^(1/y) == sqrt(x,y)` PD-3",
413
- "body": "* add a mathjs simplify rule to extend the default ruleset",
414
- "footer": null,
415
- "notes": [],
416
- "hash": "fa148ff4db1703f572beefa2d6c929fdc445261a",
417
- "gitTags": "",
418
- "committerDate": "2020-04-15 13:13:15 +0100",
419
- "isTagged": true,
420
- "tag": "@pie-lib/math-evaluator@0.6.21"
421
- },
422
- {
423
- "type": "feat",
424
- "scope": null,
425
- "subject": "major version bump",
426
- "merge": null,
427
- "header": "feat: major version bump",
428
- "body": null,
429
- "footer": "BREAKING CHANGE: The last release should have been breaking - this\nshould trigger a major bump now",
430
- "notes": [
431
- {
432
- "title": "BREAKING CHANGE",
433
- "text": "The last release should have been breaking - this\nshould trigger a major bump now"
434
- }
435
- ],
436
- "hash": "78da9d590c5fe67dab54f3b2668995762634ba79",
437
- "gitTags": " (develop)",
438
- "committerDate": "2020-04-27 12:30:42 +0100",
439
- "isTagged": true,
440
- "tag": "@pie-lib/math-evaluator@2.0.0"
441
- },
442
- {
443
- "type": "feat",
444
- "scope": null,
445
- "subject": "bump mathjs@^7.0.1",
446
- "merge": null,
447
- "header": "feat: bump mathjs@^7.0.1",
448
- "body": null,
449
- "footer": null,
450
- "notes": [],
451
- "hash": "865de4b8be0829cbbd083dfee9afeea0b1559eb2",
452
- "gitTags": " (develop)",
453
- "committerDate": "2020-06-05 12:56:06 +0100",
454
- "isTagged": true,
455
- "tag": "@pie-lib/math-evaluator@2.1.0"
456
- }
457
- ]
1
+ []
package/CHANGELOG.md CHANGED
@@ -3,7 +3,7 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
- ## [2.1.23](https://github.com/pie-framework/pie-lib/compare/@pie-lib/math-evaluator@2.1.22...@pie-lib/math-evaluator@2.1.23) (2023-06-24)
6
+ # [2.16.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/math-evaluator@2.15.0...@pie-lib/math-evaluator@2.16.0) (2025-09-18)
7
7
 
8
8
  **Note:** Version bump only for package @pie-lib/math-evaluator
9
9
 
@@ -11,7 +11,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
11
11
 
12
12
 
13
13
 
14
- ## [2.1.22](https://github.com/pie-framework/pie-lib/compare/@pie-lib/math-evaluator@2.1.20...@pie-lib/math-evaluator@2.1.22) (2023-01-31)
14
+ # [2.15.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/math-evaluator@2.14.0...@pie-lib/math-evaluator@2.15.0) (2025-09-18)
15
15
 
16
16
  **Note:** Version bump only for package @pie-lib/math-evaluator
17
17
 
@@ -19,7 +19,23 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
19
19
 
20
20
 
21
21
 
22
- ## [2.1.20](https://github.com/pie-framework/pie-lib/compare/@pie-lib/math-evaluator@2.1.19...@pie-lib/math-evaluator@2.1.20) (2023-01-31)
22
+ # [2.14.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/math-evaluator@2.1.23...@pie-lib/math-evaluator@2.14.0) (2025-09-18)
23
+
24
+
25
+ ### Bug Fixes
26
+
27
+ * fixed pie-lib/icons import [PD-5126] ([dcb506c](https://github.com/pie-framework/pie-lib/commit/dcb506c914a177f6d88bf73247a023bfe71dac1f))
28
+
29
+
30
+ ### Features
31
+
32
+ * split pie-toolbox into multiple packages [PD-5126] ([7d55a25](https://github.com/pie-framework/pie-lib/commit/7d55a2552d084cd3d0d5c00dc77411b2ced2f5e2))
33
+
34
+
35
+
36
+
37
+
38
+ # [2.13.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/math-evaluator@2.12.0...@pie-lib/math-evaluator@2.13.0) (2025-09-17)
23
39
 
24
40
  **Note:** Version bump only for package @pie-lib/math-evaluator
25
41
 
@@ -27,7 +43,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
27
43
 
28
44
 
29
45
 
30
- ## [2.1.19](https://github.com/pie-framework/pie-lib/compare/@pie-lib/math-evaluator@2.1.18...@pie-lib/math-evaluator@2.1.19) (2023-01-31)
46
+ # [2.12.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/math-evaluator@2.11.0...@pie-lib/math-evaluator@2.12.0) (2025-09-17)
31
47
 
32
48
  **Note:** Version bump only for package @pie-lib/math-evaluator
33
49
 
@@ -35,7 +51,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
35
51
 
36
52
 
37
53
 
38
- ## [2.1.18](https://github.com/pie-framework/pie-lib/compare/@pie-lib/math-evaluator@2.1.17...@pie-lib/math-evaluator@2.1.18) (2023-01-31)
54
+ # [2.11.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/math-evaluator@2.10.1...@pie-lib/math-evaluator@2.11.0) (2025-09-17)
39
55
 
40
56
  **Note:** Version bump only for package @pie-lib/math-evaluator
41
57
 
@@ -43,37 +59,203 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
43
59
 
44
60
 
45
61
 
46
- ## [2.1.17](https://github.com/pie-framework/pie-lib/compare/@pie-lib/math-evaluator@2.1.11...@pie-lib/math-evaluator@2.1.17) (2023-01-31)
62
+ ## [2.10.1](https://github.com/pie-framework/pie-lib/compare/@pie-lib/math-evaluator@2.1.23...@pie-lib/math-evaluator@2.10.1) (2025-08-11)
63
+
64
+
65
+ ### Bug Fixes
66
+
67
+ * fixed pie-lib/icons import [PD-5126] ([dcb506c](https://github.com/pie-framework/pie-lib/commit/dcb506c914a177f6d88bf73247a023bfe71dac1f))
68
+
69
+
70
+ ### Features
71
+
72
+ * split pie-toolbox into multiple packages [PD-5126] ([7d55a25](https://github.com/pie-framework/pie-lib/commit/7d55a2552d084cd3d0d5c00dc77411b2ced2f5e2))
73
+
74
+
75
+
76
+
77
+
78
+ # [2.10.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/math-evaluator@2.1.23...@pie-lib/math-evaluator@2.10.0) (2025-08-07)
79
+
80
+ ### Features
81
+
82
+ - split pie-toolbox into multiple packages [PD-5126](<[7d55a25](https://github.com/pie-framework/pie-lib/commit/7d55a2552d084cd3d0d5c00dc77411b2ced2f5e2)>)
83
+
84
+ # [2.9.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/math-evaluator@2.1.23...@pie-lib/math-evaluator@2.9.0) (2025-07-31)
85
+
86
+ **Note:** Version bump only for package @pie-lib/math-evaluator
87
+
88
+ # [2.8.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/math-evaluator@2.1.23...@pie-lib/math-evaluator@2.8.0) (2025-07-31)
47
89
 
48
90
  **Note:** Version bump only for package @pie-lib/math-evaluator
49
91
 
92
+ # [2.7.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/math-evaluator@2.1.23...@pie-lib/math-evaluator@2.7.0) (2025-07-31)
50
93
 
94
+ **Note:** Version bump only for package @pie-lib/math-evaluator
51
95
 
96
+ # [2.6.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/math-evaluator@2.1.23...@pie-lib/math-evaluator@2.6.0) (2025-07-31)
52
97
 
98
+ **Note:** Version bump only for package @pie-lib/math-evaluator
53
99
 
54
- ## [2.1.11](https://github.com/pie-framework/pie-lib/compare/@pie-lib/math-evaluator@2.1.9...@pie-lib/math-evaluator@2.1.11) (2023-01-31)
100
+ # [2.5.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/math-evaluator@2.1.23...@pie-lib/math-evaluator@2.5.0) (2025-07-31)
55
101
 
56
102
  **Note:** Version bump only for package @pie-lib/math-evaluator
57
103
 
104
+ # [2.4.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/math-evaluator@2.1.23...@pie-lib/math-evaluator@2.4.0) (2025-07-31)
58
105
 
106
+ **Note:** Version bump only for package @pie-lib/math-evaluator
59
107
 
108
+ # [2.6.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/math-evaluator@2.1.23...@pie-lib/math-evaluator@2.6.0) (2025-07-31)
60
109
 
110
+ **Note:** Version bump only for package @pie-lib/math-evaluator
61
111
 
62
- ## [2.1.9](https://github.com/pie-framework/pie-lib/compare/@pie-lib/math-evaluator@2.1.7...@pie-lib/math-evaluator@2.1.9) (2023-01-31)
112
+ # [2.5.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/math-evaluator@2.1.23...@pie-lib/math-evaluator@2.5.0) (2025-07-31)
63
113
 
64
114
  **Note:** Version bump only for package @pie-lib/math-evaluator
65
115
 
116
+ # [2.4.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/math-evaluator@2.1.23...@pie-lib/math-evaluator@2.4.0) (2025-07-31)
66
117
 
118
+ **Note:** Version bump only for package @pie-lib/math-evaluator
67
119
 
120
+ # [2.5.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/math-evaluator@2.1.23...@pie-lib/math-evaluator@2.5.0) (2025-07-31)
68
121
 
122
+ **Note:** Version bump only for package @pie-lib/math-evaluator
69
123
 
70
- ## [2.1.7](https://github.com/pie-framework/pie-lib/compare/@pie-lib/math-evaluator@2.1.6...@pie-lib/math-evaluator@2.1.7) (2022-11-23)
124
+ # [2.4.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/math-evaluator@2.1.23...@pie-lib/math-evaluator@2.4.0) (2025-07-31)
125
+
126
+ **Note:** Version bump only for package @pie-lib/math-evaluator
127
+
128
+ # [2.3.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/math-evaluator@2.1.23...@pie-lib/math-evaluator@2.3.0) (2025-07-31)
129
+
130
+ **Note:** Version bump only for package @pie-lib/math-evaluator
131
+
132
+ # [2.3.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/math-evaluator@2.1.23...@pie-lib/math-evaluator@2.3.0) (2025-07-31)
133
+
134
+ **Note:** Version bump only for package @pie-lib/math-evaluator
135
+
136
+ # [2.4.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/math-evaluator@2.1.23...@pie-lib/math-evaluator@2.4.0) (2025-07-31)
137
+
138
+ **Note:** Version bump only for package @pie-lib/math-evaluator
139
+
140
+ # [2.3.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/math-evaluator@2.1.23...@pie-lib/math-evaluator@2.3.0) (2025-07-31)
141
+
142
+ **Note:** Version bump only for package @pie-lib/math-evaluator
143
+
144
+ # [2.2.0-beta.8](https://github.com/pie-framework/pie-lib/compare/@pie-lib/math-evaluator@2.1.23...@pie-lib/math-evaluator@2.2.0-beta.8) (2025-07-25)
145
+
146
+ **Note:** Version bump only for package @pie-lib/math-evaluator
147
+
148
+ # [2.2.0-beta.7](https://github.com/pie-framework/pie-lib/compare/@pie-lib/math-evaluator@2.1.23...@pie-lib/math-evaluator@2.2.0-beta.7) (2025-07-25)
149
+
150
+ **Note:** Version bump only for package @pie-lib/math-evaluator
151
+
152
+ # [2.2.0-beta.7](https://github.com/pie-framework/pie-lib/compare/@pie-lib/math-evaluator@2.1.23...@pie-lib/math-evaluator@2.2.0-beta.7) (2025-07-25)
153
+
154
+ **Note:** Version bump only for package @pie-lib/math-evaluator
155
+
156
+ # [2.2.0-beta.6](https://github.com/pie-framework/pie-lib/compare/@pie-lib/math-evaluator@2.1.23...@pie-lib/math-evaluator@2.2.0-beta.6) (2025-07-25)
157
+
158
+ **Note:** Version bump only for package @pie-lib/math-evaluator
159
+
160
+ # [2.2.0-beta.6](https://github.com/pie-framework/pie-lib/compare/@pie-lib/math-evaluator@2.1.23...@pie-lib/math-evaluator@2.2.0-beta.6) (2025-07-25)
161
+
162
+ **Note:** Version bump only for package @pie-lib/math-evaluator
163
+
164
+ # [2.2.0-beta.5](https://github.com/pie-framework/pie-lib/compare/@pie-lib/math-evaluator@2.1.23...@pie-lib/math-evaluator@2.2.0-beta.5) (2025-07-25)
165
+
166
+ **Note:** Version bump only for package @pie-lib/math-evaluator
167
+
168
+ # [2.2.0-beta.5](https://github.com/pie-framework/pie-lib/compare/@pie-lib/math-evaluator@2.1.23...@pie-lib/math-evaluator@2.2.0-beta.5) (2025-07-25)
169
+
170
+ **Note:** Version bump only for package @pie-lib/math-evaluator
171
+
172
+ # [2.2.0-beta.4](https://github.com/pie-framework/pie-lib/compare/@pie-lib/math-evaluator@2.1.23...@pie-lib/math-evaluator@2.2.0-beta.4) (2025-07-25)
173
+
174
+ **Note:** Version bump only for package @pie-lib/math-evaluator
175
+
176
+ # [2.2.0-beta.3](https://github.com/pie-framework/pie-lib/compare/@pie-lib/math-evaluator@2.1.23...@pie-lib/math-evaluator@2.2.0-beta.3) (2025-07-25)
177
+
178
+ **Note:** Version bump only for package @pie-lib/math-evaluator
179
+
180
+ # [2.2.0-beta.4](https://github.com/pie-framework/pie-lib/compare/@pie-lib/math-evaluator@2.1.23...@pie-lib/math-evaluator@2.2.0-beta.4) (2025-07-23)
181
+
182
+ **Note:** Version bump only for package @pie-lib/math-evaluator
183
+
184
+ # [2.2.0-beta.3](https://github.com/pie-framework/pie-lib/compare/@pie-lib/math-evaluator@2.1.23...@pie-lib/math-evaluator@2.2.0-beta.3) (2025-07-23)
185
+
186
+ **Note:** Version bump only for package @pie-lib/math-evaluator
187
+
188
+ # [2.2.0-beta.3](https://github.com/pie-framework/pie-lib/compare/@pie-lib/math-evaluator@2.1.23...@pie-lib/math-evaluator@2.2.0-beta.3) (2025-07-20)
189
+
190
+ **Note:** Version bump only for package @pie-lib/math-evaluator
191
+
192
+ # [2.2.0-beta.2](https://github.com/pie-framework/pie-lib/compare/@pie-lib/math-evaluator@2.1.23...@pie-lib/math-evaluator@2.2.0-beta.2) (2025-07-20)
193
+
194
+ **Note:** Version bump only for package @pie-lib/math-evaluator
195
+
196
+ # [2.2.0-beta.1](https://github.com/pie-framework/pie-lib/compare/@pie-lib/math-evaluator@2.1.23...@pie-lib/math-evaluator@2.2.0-beta.1) (2025-07-20)
197
+
198
+ **Note:** Version bump only for package @pie-lib/math-evaluator
199
+
200
+ # [2.2.0-beta.2](https://github.com/pie-framework/pie-lib/compare/@pie-lib/math-evaluator@2.1.23...@pie-lib/math-evaluator@2.2.0-beta.2) (2025-07-20)
201
+
202
+ **Note:** Version bump only for package @pie-lib/math-evaluator
203
+
204
+ # [2.2.0-beta.1](https://github.com/pie-framework/pie-lib/compare/@pie-lib/math-evaluator@2.1.23...@pie-lib/math-evaluator@2.2.0-beta.1) (2025-07-20)
205
+
206
+ **Note:** Version bump only for package @pie-lib/math-evaluator
207
+
208
+ # [2.2.0-beta.1](https://github.com/pie-framework/pie-lib/compare/@pie-lib/math-evaluator@2.1.23...@pie-lib/math-evaluator@2.2.0-beta.1) (2025-07-20)
209
+
210
+ **Note:** Version bump only for package @pie-lib/math-evaluator
211
+
212
+ # [2.2.0-beta.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/math-evaluator@2.1.23...@pie-lib/math-evaluator@2.2.0-beta.0) (2025-07-20)
71
213
 
72
214
  **Note:** Version bump only for package @pie-lib/math-evaluator
73
215
 
216
+ # [2.3.0-beta.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/math-evaluator@2.1.23...@pie-lib/math-evaluator@2.3.0-beta.0) (2025-07-15)
74
217
 
218
+ **Note:** Version bump only for package @pie-lib/math-evaluator
219
+
220
+ # [2.2.0-beta.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/math-evaluator@2.1.23...@pie-lib/math-evaluator@2.2.0-beta.0) (2025-07-15)
221
+
222
+ **Note:** Version bump only for package @pie-lib/math-evaluator
223
+
224
+ ## [2.1.23](https://github.com/pie-framework/pie-lib/compare/@pie-lib/math-evaluator@2.1.22...@pie-lib/math-evaluator@2.1.23) (2023-06-24)
225
+
226
+ **Note:** Version bump only for package @pie-lib/math-evaluator
227
+
228
+ ## [2.1.22](https://github.com/pie-framework/pie-lib/compare/@pie-lib/math-evaluator@2.1.20...@pie-lib/math-evaluator@2.1.22) (2023-01-31)
229
+
230
+ **Note:** Version bump only for package @pie-lib/math-evaluator
231
+
232
+ ## [2.1.20](https://github.com/pie-framework/pie-lib/compare/@pie-lib/math-evaluator@2.1.19...@pie-lib/math-evaluator@2.1.20) (2023-01-31)
233
+
234
+ **Note:** Version bump only for package @pie-lib/math-evaluator
235
+
236
+ ## [2.1.19](https://github.com/pie-framework/pie-lib/compare/@pie-lib/math-evaluator@2.1.18...@pie-lib/math-evaluator@2.1.19) (2023-01-31)
237
+
238
+ **Note:** Version bump only for package @pie-lib/math-evaluator
239
+
240
+ ## [2.1.18](https://github.com/pie-framework/pie-lib/compare/@pie-lib/math-evaluator@2.1.17...@pie-lib/math-evaluator@2.1.18) (2023-01-31)
241
+
242
+ **Note:** Version bump only for package @pie-lib/math-evaluator
75
243
 
244
+ ## [2.1.17](https://github.com/pie-framework/pie-lib/compare/@pie-lib/math-evaluator@2.1.11...@pie-lib/math-evaluator@2.1.17) (2023-01-31)
245
+
246
+ **Note:** Version bump only for package @pie-lib/math-evaluator
247
+
248
+ ## [2.1.11](https://github.com/pie-framework/pie-lib/compare/@pie-lib/math-evaluator@2.1.9...@pie-lib/math-evaluator@2.1.11) (2023-01-31)
76
249
 
250
+ **Note:** Version bump only for package @pie-lib/math-evaluator
251
+
252
+ ## [2.1.9](https://github.com/pie-framework/pie-lib/compare/@pie-lib/math-evaluator@2.1.7...@pie-lib/math-evaluator@2.1.9) (2023-01-31)
253
+
254
+ **Note:** Version bump only for package @pie-lib/math-evaluator
255
+
256
+ ## [2.1.7](https://github.com/pie-framework/pie-lib/compare/@pie-lib/math-evaluator@2.1.6...@pie-lib/math-evaluator@2.1.7) (2022-11-23)
257
+
258
+ **Note:** Version bump only for package @pie-lib/math-evaluator
77
259
 
78
260
  ## [2.1.6](https://github.com/pie-framework/pie-lib/compare/@pie-lib/math-evaluator@2.1.4...@pie-lib/math-evaluator@2.1.6) (2021-06-25)
79
261
 
@@ -0,0 +1 @@
1
+ []
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "2.1.23",
6
+ "version": "2.1.24-next.1848+4ac095ca",
7
7
  "description": "Math evaluator tool for comparing expressions for equality",
8
8
  "keywords": [
9
9
  "math",
@@ -19,11 +19,12 @@
19
19
  "dependencies": {
20
20
  "@pie-framework/math-expressions": "^3.0.0",
21
21
  "jsesc": "^2.5.2",
22
+ "lodash": "^4.17.11",
22
23
  "mathjs": "^7.0.1"
23
24
  },
24
25
  "devDependencies": {
25
- "@pie-lib/test-utils": "^0.2.33"
26
+ "@pie-lib/test-utils": "^0.2.34-next.1848+4ac095ca"
26
27
  },
27
28
  "scripts": {},
28
- "gitHead": "4043c98430c000ce3a25357d92845175b076ea21"
29
+ "gitHead": "4ac095ca931e5fe8f131f28f41dd61093bd55d98"
29
30
  }
@@ -0,0 +1,413 @@
1
+ import areValuesEqual, { ave, latexToText } from '../index';
2
+ import _ from 'lodash';
3
+
4
+ describe('math-evaluator', () => {
5
+ describe('latexToText', () => {
6
+ const assertLatexToText = (input, expected) => {
7
+ it(`${input} => ${expected}`, () => {
8
+ const result = latexToText(input);
9
+ expect(result).toEqual(expected);
10
+ });
11
+ };
12
+ assertLatexToText('\\frac{ \\frac{1}{3}}{3}', '(1/3)/3');
13
+ assertLatexToText('\\neq', '0 != 0');
14
+ assertLatexToText('10 \\neq 20', '10 != 20');
15
+ assertLatexToText('10 \\neq', '10 != 0');
16
+ assertLatexToText('\\neq 10', '0 != 10');
17
+ assertLatexToText('40%', 'percent(40)');
18
+ assertLatexToText('%', 'percent(0)');
19
+ assertLatexToText('12%', 'percent(12)');
20
+ assertLatexToText('12\\%', 'percent(12)');
21
+ assertLatexToText('-12.5%', '- percent(12.5)');
22
+ assertLatexToText('-12.5\\%', '- percent(12.5)');
23
+ });
24
+
25
+ const assert = (isEqual, opts) => (label) =>
26
+ function() {
27
+ const args = Array.from(arguments);
28
+ const pairs = _.chunk(args, 2);
29
+
30
+ describe(label, () => {
31
+ pairs.forEach(([a, b]) => {
32
+ it(`${a} === ${b} ? ${isEqual}`, () => {
33
+ expect(areValuesEqual(a, b, opts)).toBe(isEqual);
34
+ });
35
+ });
36
+ });
37
+ };
38
+
39
+ const assertEqual = assert(true);
40
+ const assertNotEqual = assert(false);
41
+
42
+ const assertLatexEqual = assert(true, { isLatex: true });
43
+ const assertLatexNotEqual = assert(false, { isLatex: true });
44
+
45
+ const _amjs = (only) => (a, b, equal) => {
46
+ const fn = only ? it.only : it;
47
+ fn(`${a} === ${b} => ${equal}`, () => {
48
+ const as = latexToText(a);
49
+ const bs = latexToText(b);
50
+ expect(ave(as, bs)).toEqual(equal);
51
+ });
52
+ };
53
+
54
+ const assertThroughMathJs = _amjs(false);
55
+ assertThroughMathJs.only = _amjs(true);
56
+
57
+ const _als = (only) => (input, expected) => {
58
+ const fn = only ? it.only : it;
59
+ fn(`${input} => ${expected}`, () => {
60
+ expect(latexToText(input)).toEqual(expected);
61
+ });
62
+ };
63
+
64
+ const assertLatexFromString = _als(false);
65
+ assertLatexFromString.only = _als(true);
66
+
67
+ describe('ch6456', () => {
68
+ assertEqual('percent')('-12.5%', '-12.5%');
69
+ assertEqual('percent')('-12.5\\%', '-12.5%');
70
+ assertNotEqual('percent')('-11.5%', '-12.5%');
71
+ });
72
+
73
+ describe('ch6456 - latex', () => {
74
+ assertLatexEqual('percent')('\\frac{1}{2} -12.5%', '\\frac{2}{4} -12.5%');
75
+ assertLatexEqual('percent')('\\frac{1}{2} -12.5%', '\\frac{2}{4} -12.5\\%');
76
+ assertLatexNotEqual('percent')('\\frac{4}{2} -12.5%', '\\frac{2}{4} -12.5\\%');
77
+ assertLatexNotEqual('percent')('\\frac{2}{2} -12.5%', '\\frac{2}{4} -12.5\\%');
78
+ });
79
+
80
+ describe('PIE-188-math-expressions', () => {
81
+ // it('parses expressions correctly', async () => {
82
+
83
+ // geometry
84
+
85
+ // MULTIPLY WITH VARIABLE BASED
86
+ assertThroughMathJs('\\parallel x', '\\parallel x', true);
87
+ assertThroughMathJs('\\parallel x', '\\parallel x', true);
88
+ assertThroughMathJs('\\parallel x', '\\parallel 0', false);
89
+ assertThroughMathJs('\\overrightarrow{x + 4}', '\\overrightarrow {4 + x}', true);
90
+ assertThroughMathJs('\\overrightarrow{4x^2 + 4}', '\\overrightarrow {4x^2 + 8 - 4}', true);
91
+ assertThroughMathJs('\\overrightarrow{21*2*x}', '\\overrightarrow {42x}', true);
92
+ assertLatexFromString('\\nparallel x', 'nparallel x');
93
+ assertLatexFromString('\\overrightarrow{x}', 'overrightarrow x');
94
+ assertLatexFromString('\\overleftrightarrow{x}', 'overleftrightarrow x');
95
+ assertLatexFromString('\\perp x', 'perp x');
96
+ assertLatexFromString('\\angle x', 'angle x');
97
+ assertLatexFromString('\\overarc x', 'overarc x');
98
+ assertLatexFromString('\\measuredangle x', 'measuredangle x');
99
+ assertLatexFromString('\\triangle x', 'triangle x');
100
+ assertLatexFromString('\\parallelogram x', 'parallelogram x');
101
+ assertLatexFromString('\\odot x', 'odot x');
102
+ assertLatexFromString('\\degree x', 'degree x');
103
+ assertLatexFromString('\\sim x', 'sim x');
104
+ assertLatexFromString('\\cong x', 'cong x');
105
+ assertLatexFromString('\\ncong x', 'ncong x');
106
+ assertLatexFromString('\\napprox x', 'napprox x'); // UNRECOGNIZED BY LEARNOSITY
107
+ assertLatexFromString('\\nim x', 'nim x'); // UNRECOGNIZED BY LEARNOSITY
108
+ assertLatexFromString('\\sim x', 'sim x');
109
+ expect(() => latexToText('\\sim 4', { unknownCommandBehavior: 'error' })).toThrow();
110
+
111
+ // comparisons
112
+
113
+ assertLatexFromString('1 \\lt 2', '1 < 2');
114
+
115
+ assertLatexFromString('1 \\gt 2', '1 > 2');
116
+
117
+ assertLatexFromString('1 \\le 2', '1 ≤ 2');
118
+
119
+ assertLatexFromString('1 \\ge 2', '1 ≥ 2');
120
+
121
+ // exponents
122
+
123
+ assertLatexFromString('2^2', '2^2');
124
+
125
+ assertLatexFromString('2^{3}', '2^3');
126
+
127
+ // roots
128
+
129
+ assertLatexFromString('\\sqrt{2}', 'sqrt(2)');
130
+
131
+ assertLatexFromString('\\sqrt[{3}]{3}', '3^(1/3)');
132
+
133
+ // fractions
134
+
135
+ assertLatexFromString('\\frac{3}{3}', '3/3');
136
+
137
+ assertLatexFromString('\\frac{x}{3}', 'x/3');
138
+
139
+ assertLatexFromString('x\\frac{5}{3}', 'x (5/3)');
140
+
141
+ // ACTUAL OPERATOR BASED
142
+ assertLatexFromString('\\overline{x}', 'overline x');
143
+ assertLatexFromString('\\pm', 'pm');
144
+ assertLatexFromString('\\approx x', 'approx x');
145
+
146
+ // logarithms
147
+
148
+ assertLatexFromString("4'", "4'");
149
+ assertLatexFromString('\\log 4', 'log(4)');
150
+ assertLatexFromString('\\log(4x)', 'log(4 x)');
151
+ assertLatexFromString('\\ln 4', 'ln(4)');
152
+
153
+ assertLatexFromString('|4|', '|4|');
154
+ assertLatexFromString('(4)', '4');
155
+ assertLatexFromString('(4 + x) * 5', '(4 + x) * 5');
156
+ assertLatexFromString('[4]', '4');
157
+ assertLatexFromString('\\mu', 'μ');
158
+ assertLatexFromString('\\Sigma', 'Σ');
159
+ assertLatexFromString('x^{15}', 'x^15');
160
+ assertLatexFromString('x_{15}', 'x_15');
161
+
162
+ // Trigo
163
+
164
+ assertLatexFromString('\\sin(x)', 'sin(x)');
165
+ assertLatexFromString('\\cos(x)', 'cos(x)');
166
+ assertLatexFromString('\\tan(x)', 'tan(x)');
167
+ assertLatexFromString('\\sec(x)', 'sec(x)');
168
+ assertLatexFromString('\\csc(x)', 'csc(x)');
169
+ assertLatexFromString('\\cot(x)', 'cot(x)');
170
+ });
171
+
172
+ // assertNotEqual('custom latex')('1530', `\\odot`);
173
+ assertNotEqual('evaluates simple expressions correctly')('0', 'x', '3x', '4x');
174
+
175
+ assertEqual('evaluates simple expressions correctly')('x', 'x', '2x', '2x');
176
+
177
+ describe('bad frac throws error', () => {
178
+ it('throws an error', () => {
179
+ expect(() => areValuesEqual('\\frac12', '\\frac34', { isLatex: true })).toThrow('Expecting {');
180
+ });
181
+ });
182
+ describe('7119', () => {
183
+ it.each`
184
+ v | isEqual
185
+ ${'4.5'} | ${true}
186
+ ${'3.2 + 1.3'} | ${true}
187
+ ${'(4 - \\frac{4}{5}) + 1.3'} | ${true}
188
+ ${'\\frac{9}{2}'} | ${true}
189
+ ${'4 \\frac{1}{2}'} | ${true}
190
+ ${'\\frac{10}{2} - 0.5'} | ${true}
191
+ ${'4.55'} | ${false}
192
+ `('$a == $isEqual', ({ v, isEqual }) => {
193
+ const result = areValuesEqual('4 \\frac{1}{2}', v, { isLatex: true });
194
+ expect(result).toEqual(isEqual);
195
+ });
196
+
197
+ it('?', () => {
198
+ expect(latexToText('4\\frac{1}{2}')).toEqual('4 + 1/2');
199
+ });
200
+ });
201
+
202
+ assertEqual('evaluates simple expressions correctly 2')(
203
+ '100',
204
+ '100',
205
+ '50 + 50',
206
+ '25 * 4',
207
+ '200 / 2',
208
+ '20 * 5',
209
+ '2.5 * 40',
210
+ '10 * 10',
211
+ );
212
+
213
+ assertNotEqual('evaluates simple expressions correctly 2')(
214
+ '100',
215
+ '0',
216
+ '0',
217
+ '50 * 2',
218
+ '44 + 57',
219
+ '100',
220
+ '44 + 57',
221
+ '50 * 3',
222
+ );
223
+
224
+ assertEqual('evaluates simple expressions correctly 3')(
225
+ '50 + 50',
226
+ '100',
227
+ '100 / 2 + 50',
228
+ '100',
229
+ '2 + 2',
230
+ '4',
231
+ '1/2 + .5',
232
+ '1',
233
+ );
234
+
235
+ assertNotEqual('evaluates simple expressions correctly 3')(
236
+ '50 + 51',
237
+ '100',
238
+ '25 * 2 + 51',
239
+ '100',
240
+ '1/2 + .5',
241
+ '1.9',
242
+ '1/2 + .5',
243
+ '1.1',
244
+ );
245
+
246
+ assertEqual('evaluates simple expressions correctly 4')(
247
+ '50 + 50',
248
+ '100',
249
+ '100 / 2 + 50',
250
+ '100',
251
+ '2 + 2',
252
+ '4',
253
+ '1/2 + .5',
254
+ '1',
255
+ '13/2',
256
+ '13/2',
257
+ '26/4',
258
+ '13/2',
259
+ '6 + 1/2',
260
+ '13/2',
261
+ '6.5',
262
+ '13/2',
263
+ );
264
+
265
+ assertNotEqual('evaluates simple expressions correctly 4')(
266
+ '50 + 51',
267
+ '100',
268
+ '25 * 2 + 51',
269
+ '100',
270
+ '1/2 + .5',
271
+ '1.9',
272
+ '1/2 + .5',
273
+ '1.1',
274
+ '14/2',
275
+ '13/2',
276
+ '6.6',
277
+ '13/2',
278
+ );
279
+
280
+ it.each`
281
+ a | b
282
+ ${'((x^2 + x) / x) - 1'} | ${'x'}
283
+ `('$a == $b', ({ a, b }) => {
284
+ expect(areValuesEqual(a, b)).toBe(true);
285
+ });
286
+
287
+ assertEqual('evaluates simple variable expressions correctly')(
288
+ 'x',
289
+ 'x',
290
+ 'x + 0',
291
+ 'x',
292
+ '(x-2) + 2',
293
+ 'x',
294
+ '((x^2 + x) / x) - 1',
295
+ 'x',
296
+ '2x/2',
297
+ 'x',
298
+ '(x + 2)^2',
299
+ '(x + 2)^2',
300
+ 'x^2 + 4x + 4',
301
+ '(x + 2)^2',
302
+ 'x^2 + 4(x+1)',
303
+ '(x + 2)^2',
304
+ 'x^2 + 8 ((x+1) / 2)',
305
+ '(x + 2)^2',
306
+ );
307
+
308
+ assertNotEqual('evaluates simple variable expressions correctly')(
309
+ 'y',
310
+ 'x',
311
+ 'x + 1',
312
+ 'x',
313
+ 'x^3 + 4x + 4',
314
+ '(x + 2)^2',
315
+ 'x^2 + 4(x+2)',
316
+ '(x + 2)^2',
317
+ );
318
+
319
+ assertEqual('evaluates simple variable expressions correctly 2')(
320
+ '(2 + x)^2',
321
+ '(x + 2)^2',
322
+ 'x^2 + 4x + 4',
323
+ '(x + 2)^2',
324
+ 'x^2 + 4(x+1)',
325
+ '(x + 2)^2',
326
+ 'x^2 + 8 ((x+1) / 2)',
327
+ '(x + 2)^2',
328
+ );
329
+
330
+ assertEqual('evaluates expressions correctly with variable exponents')(
331
+ '(2 + x)^2x',
332
+ '(x + 2)^2x',
333
+ 'y^(2 x)',
334
+ 'y^(x+x)',
335
+ );
336
+
337
+ assertEqual('evaluates function expressions correctly with variable parameters')(
338
+ 'sqrt(4x)',
339
+ 'sqrt(2x+2x)',
340
+ 'sqrt(x^2)',
341
+ 'sqrt(((x+1)^2) - ((x+1)^2) + x^2)',
342
+ );
343
+
344
+ assertNotEqual('evaluates simple variable expressions correctly 2')(
345
+ 'x^3 + 4x + 4',
346
+ '(x + 2)^2',
347
+ 'x^2 + 4(x+2)',
348
+ '(x + 2)^2',
349
+ );
350
+
351
+ it('correctly consumes allowDecimals option', () => {
352
+ expect(areValuesEqual('123', '123', { allowDecimals: true })).toEqual(true);
353
+ expect(areValuesEqual('123', '123.0', { allowDecimals: true })).toEqual(true);
354
+ expect(areValuesEqual('123,0', '123.0', { allowDecimals: true })).toEqual(true);
355
+ expect(areValuesEqual('123,0', '123.0', { allowDecimals: false })).toEqual(false);
356
+ expect(areValuesEqual('123', '123.0', { allowDecimals: false })).toEqual(false);
357
+ expect(areValuesEqual('123', '123,0', { allowDecimals: false })).toEqual(false);
358
+ });
359
+
360
+ it('correctly consumes allowDecimals option for complex examples too', () => {
361
+ expect(areValuesEqual('1500000', '1500000', { allowDecimals: true })).toEqual(true);
362
+ expect(areValuesEqual('1,500,000', '1,500,000', { allowDecimals: true })).toEqual(true);
363
+ expect(areValuesEqual('1500000', '1,500,000', { allowDecimals: true })).toEqual(true);
364
+ expect(areValuesEqual('1500000', '1,500,000.00', { allowDecimals: true })).toEqual(true);
365
+ expect(areValuesEqual('1500000', '1,500,000.0', { allowDecimals: true })).toEqual(true);
366
+ expect(areValuesEqual('1,500,000.0', '1,500,000.00', { allowDecimals: true })).toEqual(true);
367
+ expect(areValuesEqual('1500000', '1,500000', { allowDecimals: true })).toEqual(false);
368
+ expect(areValuesEqual('1500000', '1500,000', { allowDecimals: true })).toEqual(false);
369
+ expect(areValuesEqual('1500000', '1,500,000.01', { allowDecimals: true })).toEqual(false);
370
+ expect(areValuesEqual('1500000', '1,500,00,0', { allowDecimals: true })).toEqual(false);
371
+ expect(areValuesEqual('1500000', '1500,000', { allowDecimals: true })).toEqual(false);
372
+ expect(areValuesEqual('1500000', ',1500,000', { allowDecimals: true })).toEqual(false);
373
+ });
374
+
375
+ it('evaluates simple trigo expressions correctly', () => {
376
+ expect(areValuesEqual('sin(x)', 'sin(x)')).toEqual(true);
377
+ expect(areValuesEqual('tan(x)', 'tan(x)')).toEqual(true);
378
+ });
379
+
380
+ it('correctly creates math expressions 1', () => {
381
+ expect(
382
+ areValuesEqual('f^{-1}\\left(x\\right)=\\sqrt{x-1}+3', 'f^{-1}\\left(x\\right)=\\sqrt{x-1}+3', {
383
+ allowDecimals: true,
384
+ isLatex: true,
385
+ }),
386
+ ).toEqual(true);
387
+ });
388
+
389
+ it('correctly creates math expressions 2', () => {
390
+ expect(
391
+ areValuesEqual('72\\div12=6\\text{eggs}', '72\\div12=6\\text{eggs}', {
392
+ allowDecimals: true,
393
+ isLatex: true,
394
+ }),
395
+ ).toEqual(true);
396
+ });
397
+
398
+ describe('PD-3', () => {
399
+ it.each`
400
+ a | b
401
+ ${'\\left(x\\right)^{ \\frac{1}{\\left(y + 3\\right)}}'} | ${'\\sqrt[\\left(y + 3\\right)]{x}'}
402
+ ${'\\left(x\\right)^{\\frac{1}{3}}'} | ${'\\sqrt[3]{x}'}
403
+ ${'\\left(x\\right)^{\\frac{1}{n}}'} | ${'\\sqrt[n]{x}'}
404
+ ${'\\left(x\\right)^{\\frac{1}{2}}'} | ${'\\sqrt{x}'}
405
+ ${'\\left(x-1\\right)^{\\frac{1}{2}}+3'} | ${'\\sqrt{x-1}+3'}
406
+ ${'f^{-1}\\left(x\\right)=\\left(x-1\\right)^{\\frac{1}{2}}+3'}
407
+ ${'f^{-1}\\left(x\\right)=\\sqrt{x-1}+3'}
408
+ `('$a == $b', ({ a, b }) => {
409
+ const opts = { allowDecimals: true, isLatex: true };
410
+ expect(areValuesEqual(a, b, opts)).toBeTruthy();
411
+ });
412
+ });
413
+ });