@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 +0 -4
- package/dist/index.js +2 -5
- package/package.json +2 -1
package/README.md
CHANGED
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 =
|
|
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.
|
|
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
|
}
|