@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 CHANGED
@@ -23,4 +23,4 @@ TODO
23
23
 
24
24
  [Browse the docs on longlast.js.org][docs].
25
25
 
26
- [docs]: https://longlast.js.org/function-provenance/
26
+ [docs]: https://longlast.js.org/reference/function-provenance/
package/dist/index.d.ts CHANGED
@@ -2,7 +2,7 @@
2
2
  * @module function-provenance
3
3
  * @hidden
4
4
  */
5
- import type { $getBoundArguments, $unapplied } from "@longlast/symbols";
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
- export {};
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
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@longlast/function-provenance",
3
- "version": "0.0.1",
3
+ "version": "0.0.3",
4
4
  "description": "Imbues partially-applied functions with knowledge of their origins",
5
5
  "homepage": "https://longlast.js.org/",
6
6
  "license": "MIT",