@longlast/function-provenance 0.0.2 → 0.1.0

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
@@ -3,13 +3,15 @@
3
3
  * @hidden
4
4
  */
5
5
  import { $getBoundArguments, $unapplied } from "@longlast/symbols";
6
+ import type { AnyFunction } from "@longlast/any-function";
6
7
  declare const $nonUserConstructible: unique symbol;
7
8
  export interface FunctionProvenance {
8
9
  [$getBoundArguments](): unknown[];
9
- [$unapplied]: AnyFunction;
10
+ [$unapplied]: UnknownFunction;
10
11
  displayName: string;
11
12
  [$nonUserConstructible]: true;
12
13
  }
13
- type AnyFunction = (...args: any[]) => any;
14
14
  export declare function getBoundArguments(f: AnyFunction): unknown[];
15
+ export declare function getUnapplied(f: AnyFunction): UnknownFunction;
16
+ type UnknownFunction = (...args: never) => unknown;
15
17
  export {};
package/dist/index.js CHANGED
@@ -6,3 +6,6 @@ import { $getBoundArguments, $unapplied } from "@longlast/symbols";
6
6
  export function getBoundArguments(f) {
7
7
  return f[$getBoundArguments]?.() ?? [];
8
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.2",
3
+ "version": "0.1.0",
4
4
  "description": "Imbues partially-applied functions with knowledge of their origins",
5
5
  "homepage": "https://longlast.js.org/",
6
6
  "license": "MIT",
@@ -17,6 +17,7 @@
17
17
  "#@longlast/function-provenance": "./src/index.ts"
18
18
  },
19
19
  "dependencies": {
20
+ "@longlast/any-function": "^0.0.1",
20
21
  "@longlast/symbols": "^1.1.0"
21
22
  }
22
23
  }