Skip to content

Commit e136540

Browse files
committed
Publish v0.11.0
1 parent 9d8dc09 commit e136540

File tree

3 files changed

+66
-6
lines changed

3 files changed

+66
-6
lines changed

CHANGELOG.adoc

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,65 @@
11
= Changelog
22
:perfective-common: https://github.com/perfective/ts.common/tree/main
3+
:github-issues: https://github.com/perfective/ts.common/issues
4+
5+
== v0.11.0
6+
7+
* *Fixed ES modules imports*.
8+
+
9+
`@perfective/common` can now be imported from regular `.js`/`.mjs` ESM files.
10+
+
11+
* *Added wrappers for most of the `Math` functions* (link:{github-issues}/20[#20])
12+
+
13+
Unlike the standard `Math` functions,
14+
the following functions throw an `Exception` for invalid inputs:
15+
+
16+
** `absolute()`;
17+
** `arccos()`, `arccosh()`;
18+
** `arcsin()`, `arcsinh()`;
19+
** `arctan()`, `arctan2()`, `arctanh()`;
20+
** `cos()`, `cosh()`;
21+
** `sin()`, `sinh()`;
22+
** `tan()`, `tanh()`;
23+
** `rounded()`, `roundedUp()`, `roundedDown()`, `roundedToFloat32()`, `truncated()`;
24+
** `power()`, `powerOf()`;
25+
** `squareRoot()`, `cubeRoot()`, `l2norm()`;
26+
** `exp()`, `expm1()`;
27+
** `log()`, `log10()`, `log1p()`, `log2()`;
28+
** `sign()` with `Sign` nominal type.
29+
+
30+
Replacing `NaN` with `null` is a redundant idea,
31+
because it’s trivial to do use library functions with `Maybe` instead:
32+
+
33+
[source,typescript]
34+
----
35+
maybe(x).to(Math.acos).that(isNumber)
36+
----
37+
+
38+
Meanwhile, throwing an exception gives library users an option to track invalid inputs.
39+
In this case, the `Result` monad can be used instead:
40+
+
41+
[source,typescript]
42+
----
43+
result(x).onto(resultFrom(arccos))
44+
----
45+
+
46+
* *Added more nominal types for numbers*:
47+
+
48+
** Added `Infinity`, `PositiveInfinity`, and `NegativeInfinity` nominal types
49+
with the `isInfinity()` type guard.
50+
+
51+
** Added `FiniteNumber` nominal type
52+
with the `isFinite() type guard (link:{github-issues}/18[#18])
53+
and `assertIsFinite()` assertion.
54+
+
55+
** Added the `PositiveNumber`, `NonPositiveNumber`, `NegativeNumber`, `NonNegativeNumber` nominal types.
56+
** Added `assertIsNonNegativeNumber()` type guard.
57+
+
58+
* *Introduced assertion function* (link:{github-issues}/53[#53]):
59+
+
60+
** Added the `assertIsNotNaN()` and `assertIsNonNegativeNumber()` functions.
61+
** Added the `typeException()` function.
62+
363

464
== v0.10.0
565

package-lock.json

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@perfective/common",
3-
"version": "0.10.0",
3+
"version": "0.11.0",
44
"description": "Common types and functions for perfective development in TypeScript",
55
"keywords": [
66
"es6",

0 commit comments

Comments
 (0)