@staff0rd/assist 0.310.4 → 0.310.5
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/dist/index.js +15 -5
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -6,7 +6,7 @@ import { Command } from "commander";
|
|
|
6
6
|
// package.json
|
|
7
7
|
var package_default = {
|
|
8
8
|
name: "@staff0rd/assist",
|
|
9
|
-
version: "0.310.
|
|
9
|
+
version: "0.310.5",
|
|
10
10
|
type: "module",
|
|
11
11
|
main: "dist/index.js",
|
|
12
12
|
bin: {
|
|
@@ -11881,16 +11881,26 @@ function hashtagsFrom(details) {
|
|
|
11881
11881
|
}
|
|
11882
11882
|
return [...new Set(tags)];
|
|
11883
11883
|
}
|
|
11884
|
-
function
|
|
11885
|
-
|
|
11886
|
-
|
|
11884
|
+
function textLinksFrom(details) {
|
|
11885
|
+
return details.map((detail) => asObject(detail.textLink)?.url).filter((url) => typeof url === "string");
|
|
11886
|
+
}
|
|
11887
|
+
function articleCardLinksFrom(update3) {
|
|
11888
|
+
const article = asObject(asObject(update3.content)?.articleComponent);
|
|
11889
|
+
const url = asObject(article?.navigationContext)?.actionTarget;
|
|
11890
|
+
return typeof url === "string" ? [url] : [];
|
|
11891
|
+
}
|
|
11892
|
+
function linksFrom(update3, details) {
|
|
11893
|
+
return dedupeLinks([
|
|
11894
|
+
...textLinksFrom(details),
|
|
11895
|
+
...articleCardLinksFrom(update3)
|
|
11896
|
+
]);
|
|
11887
11897
|
}
|
|
11888
11898
|
function collectVoyagerAttributes(update3, profiles, authorSlug) {
|
|
11889
11899
|
const details = attributeDetails(update3);
|
|
11890
11900
|
return {
|
|
11891
11901
|
mentions: mentionsFrom(details, profiles, authorSlug),
|
|
11892
11902
|
hashtags: hashtagsFrom(details),
|
|
11893
|
-
links: linksFrom(details)
|
|
11903
|
+
links: linksFrom(update3, details)
|
|
11894
11904
|
};
|
|
11895
11905
|
}
|
|
11896
11906
|
|