@rss3/js-sdk
Advanced tools
Comparing version 0.6.54 to 0.6.55
@@ -5,3 +5,3 @@ export { client as dataClient, Activity, Profile, Cursor, TotalPage } from './data/client.js'; | ||
export { handleMetadata } from './metadata/index.js'; | ||
export { formatPlain, format, tokenizeAction, tokenizeActivity, tokenizeToActions, hasMultiPrimaryActions, flatActivity, } from './readable/activity/index.js'; | ||
export { formatPlain, format, tokenizeAction, tokenizeActivity, tokenizeToActions, tokenizeToSummaryActions, hasMultiPrimaryActions, flatActivity, } from './readable/activity/index.js'; | ||
export { formatContent, Content, extractContent, formatTitle, checkTargetExist } from './readable/content/index.js'; | ||
@@ -8,0 +8,0 @@ export { Theme, themePlain, themeHTML, summaryOfHTML } from './readable/activity/theme.js'; |
@@ -5,3 +5,3 @@ export { client as dataClient } from './data/client.js'; | ||
export { handleMetadata } from './metadata/index.js'; | ||
export { formatPlain, format, tokenizeAction, tokenizeActivity, tokenizeToActions, hasMultiPrimaryActions, flatActivity, } from './readable/activity/index.js'; | ||
export { formatPlain, format, tokenizeAction, tokenizeActivity, tokenizeToActions, tokenizeToSummaryActions, hasMultiPrimaryActions, flatActivity, } from './readable/activity/index.js'; | ||
export { formatContent, extractContent, formatTitle, checkTargetExist } from './readable/content/index.js'; | ||
@@ -8,0 +8,0 @@ export { themePlain, themeHTML, summaryOfHTML } from './readable/activity/theme.js'; |
@@ -16,2 +16,3 @@ import { components } from '../../types/data.js'; | ||
export declare function tokenizeToActions(activity: Activity): Token[][]; | ||
export declare function tokenizeToSummaryActions(activity: Activity): Token[][]; | ||
/** | ||
@@ -18,0 +19,0 @@ * Returns a list of tokens that can be used to custom render the output of an action, such as CLI output |
@@ -1,2 +0,2 @@ | ||
import { getSummaryActions } from '../../utils.js'; | ||
import { getActions, getSummaryActions } from '../../utils.js'; | ||
import { handleMetadata } from '../../metadata/index.js'; | ||
@@ -51,2 +51,18 @@ import { themePlain } from './theme.js'; | ||
export function tokenizeToActions(activity) { | ||
const actions = getActions(activity); | ||
const ts = []; | ||
// used for social actions, remove the duplicate action | ||
if (activity.tag === 'social' && actions.length > 1) { | ||
return [tokenizeAction(activity, actions[0])]; | ||
} | ||
// handle unknown activity | ||
if (activity.tag === 'unknown' || activity.type === 'unknown') { | ||
return [[token('unknown', 'Carried out an activity')]]; | ||
} | ||
actions.map((action) => { | ||
ts.push(tokenizeAction(activity, action)); | ||
}); | ||
return ts; | ||
} | ||
export function tokenizeToSummaryActions(activity) { | ||
const actions = getSummaryActions(activity); | ||
@@ -53,0 +69,0 @@ const ts = []; |
{ | ||
"name": "@rss3/js-sdk", | ||
"description": "RSS3 JavaScript SDK, the Turbocharger🌪️ for Your Next Open Web Development.", | ||
"version": "0.6.54", | ||
"version": "0.6.55", | ||
"author": "Natural Selection Labs and RSS3 Contributors", | ||
@@ -6,0 +6,0 @@ "license": "MIT", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
350261
9279