@bodil/core 0.3.0 → 0.3.1
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/dist/fun.d.ts +6 -0
- package/dist/fun.js +5 -0
- package/dist/fun.js.map +1 -1
- package/package.json +1 -1
- package/src/fun.ts +14 -0
package/dist/fun.d.ts
CHANGED
|
@@ -14,3 +14,9 @@ export declare function id<A>(value: A): A;
|
|
|
14
14
|
* A function which does nothing and returns `void`.
|
|
15
15
|
*/
|
|
16
16
|
export declare function nop(): void;
|
|
17
|
+
/**
|
|
18
|
+
* A function which applies the `+` operator to its arguments.
|
|
19
|
+
*/
|
|
20
|
+
export declare function sum(a: number, b: number): number;
|
|
21
|
+
export declare function sum(a: bigint, b: bigint): bigint;
|
|
22
|
+
export declare function sum(a: string, b: string): string;
|
package/dist/fun.js
CHANGED
package/dist/fun.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fun.js","sourceRoot":"","sources":["../src/fun.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"fun.js","sourceRoot":"","sources":["../src/fun.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH;;GAEG;AACH,MAAM,UAAU,MAAM,CAAI,KAAQ;IAC9B,OAAO,GAAG,EAAE,CAAC,KAAK,CAAC;AACvB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,EAAE,CAAI,KAAQ;IAC1B,OAAO,KAAK,CAAC;AACjB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,GAAG;IACf,MAAM;AACV,CAAC;AAQD,MAAM,UAAU,GAAG,CAAqC,CAAI,EAAE,CAAI;IAC9D,aAAa;IACb,qEAAqE;IACrE,OAAO,CAAC,GAAG,CAAC,CAAC;AACjB,CAAC"}
|
package/package.json
CHANGED
package/src/fun.ts
CHANGED
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
* @module
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
+
import { OperatorComparable } from "./order";
|
|
7
|
+
|
|
6
8
|
/**
|
|
7
9
|
* Create a function that always returns `value`.
|
|
8
10
|
*/
|
|
@@ -23,3 +25,15 @@ export function id<A>(value: A): A {
|
|
|
23
25
|
export function nop(): void {
|
|
24
26
|
// nop
|
|
25
27
|
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* A function which applies the `+` operator to its arguments.
|
|
31
|
+
*/
|
|
32
|
+
export function sum(a: number, b: number): number;
|
|
33
|
+
export function sum(a: bigint, b: bigint): bigint;
|
|
34
|
+
export function sum(a: string, b: string): string;
|
|
35
|
+
export function sum<A extends number | bigint | string>(a: A, b: A): A {
|
|
36
|
+
// @ts-ignore
|
|
37
|
+
// eslint-disable-next-line @typescript-eslint/restrict-plus-operands
|
|
38
|
+
return a + b;
|
|
39
|
+
}
|