@longlast/function-provenance 0.1.1 → 0.1.2

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
@@ -15,10 +15,6 @@ pnpm add @longlast/function-provenance
15
15
  yarn add @longlast/function-provenance
16
16
  ```
17
17
 
18
- ## Use
19
-
20
- TODO
21
-
22
18
  ## Documentation
23
19
 
24
20
  [Browse the docs on longlast.js.org][docs].
package/dist/index.js CHANGED
@@ -3,6 +3,7 @@
3
3
  * @hidden
4
4
  */
5
5
  import { $getBoundArguments, $unapplied } from "@longlast/symbols";
6
+ import { getFunctionName } from "@longlast/function-name";
6
7
  export function getBoundArguments(f) {
7
8
  return f[$getBoundArguments]?.() ?? [];
8
9
  }
@@ -17,7 +18,7 @@ export function getUnapplied(f) {
17
18
  */
18
19
  export function trackProvenance(source, args, dest) {
19
20
  unsafeNarrow(dest);
20
- dest.displayName = getName(source);
21
+ dest.displayName = getFunctionName(source);
21
22
  dest[$getBoundArguments] = () => getBoundArguments(source).concat(args);
22
23
  dest[$unapplied] = getUnapplied(source);
23
24
  return dest;
@@ -26,7 +27,3 @@ export function trackProvenance(source, args, dest) {
26
27
  function unsafeNarrow(value) {
27
28
  value;
28
29
  }
29
- // TODO: getName is duplicated.
30
- function getName(f) {
31
- return f.displayName ?? f.name;
32
- }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@longlast/function-provenance",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "Imbues partially-applied functions with knowledge of their origins",
5
5
  "homepage": "https://longlast.js.org/",
6
6
  "license": "MIT",
@@ -18,6 +18,7 @@
18
18
  },
19
19
  "dependencies": {
20
20
  "@longlast/any-function": "^0.0.1",
21
+ "@longlast/function-name": "^0.0.1",
21
22
  "@longlast/symbols": "^1.1.0"
22
23
  }
23
24
  }