@longlast/function-provenance 0.0.1 → 0.0.3
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/README.md +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +7 -1
- package/package.json +1 -1
package/README.md
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @module function-provenance
|
|
3
3
|
* @hidden
|
|
4
4
|
*/
|
|
5
|
-
import
|
|
5
|
+
import { $getBoundArguments, $unapplied } from "@longlast/symbols";
|
|
6
6
|
declare const $nonUserConstructible: unique symbol;
|
|
7
7
|
export interface FunctionProvenance {
|
|
8
8
|
[$getBoundArguments](): unknown[];
|
|
@@ -11,4 +11,6 @@ export interface FunctionProvenance {
|
|
|
11
11
|
[$nonUserConstructible]: true;
|
|
12
12
|
}
|
|
13
13
|
type AnyFunction = (...args: any[]) => any;
|
|
14
|
+
export declare function getBoundArguments(f: AnyFunction): unknown[];
|
|
15
|
+
export declare function getUnapplied(f: AnyFunction): AnyFunction;
|
|
14
16
|
export {};
|
package/dist/index.js
CHANGED
|
@@ -2,4 +2,10 @@
|
|
|
2
2
|
* @module function-provenance
|
|
3
3
|
* @hidden
|
|
4
4
|
*/
|
|
5
|
-
|
|
5
|
+
import { $getBoundArguments, $unapplied } from "@longlast/symbols";
|
|
6
|
+
export function getBoundArguments(f) {
|
|
7
|
+
return f[$getBoundArguments]?.() ?? [];
|
|
8
|
+
}
|
|
9
|
+
export function getUnapplied(f) {
|
|
10
|
+
return f[$unapplied] ?? f;
|
|
11
|
+
}
|