notion-utils
Advanced tools
Comparing version 7.1.1 to 7.1.2
@@ -143,2 +143,7 @@ import * as types from 'notion-types'; | ||
/** | ||
* Gets the IDs of all tweets embedded on a page. | ||
*/ | ||
declare const getPageTweets: (recordMap: types.ExtendedRecordMap) => string[]; | ||
/** | ||
* Gets the raw, unformatted text content of a block's content value. | ||
@@ -174,2 +179,2 @@ * | ||
export { type NotionDateTime, type TableOfContentsEntry, defaultMapImageUrl, defaultMapPageUrl, estimatePageReadTime, estimatePageReadTimeAsHumanizedString, formatDate, formatNotionDateTime, getAllPagesInSpace, getBlockCollectionId, getBlockIcon, getBlockParentPage, getBlockTitle, getCanonicalPageId, getDateValue, getPageBreadcrumbs, getPageContentBlockIds, getPageImageUrls, getPageProperty, getPageTableOfContents, getPageTitle, getTextContent, idToUuid, mergeRecordMaps, normalizeTitle, normalizeUrl, parsePageId, uuidToId }; | ||
export { type NotionDateTime, type TableOfContentsEntry, defaultMapImageUrl, defaultMapPageUrl, estimatePageReadTime, estimatePageReadTimeAsHumanizedString, formatDate, formatNotionDateTime, getAllPagesInSpace, getBlockCollectionId, getBlockIcon, getBlockParentPage, getBlockTitle, getCanonicalPageId, getDateValue, getPageBreadcrumbs, getPageContentBlockIds, getPageImageUrls, getPageProperty, getPageTableOfContents, getPageTitle, getPageTweets, getTextContent, idToUuid, mergeRecordMaps, normalizeTitle, normalizeUrl, parsePageId, uuidToId }; |
@@ -717,2 +717,18 @@ // src/estimate-page-read-time.ts | ||
// src/get-page-tweets.ts | ||
var getPageTweets = (recordMap) => { | ||
const blockIds = Object.keys(recordMap.block); | ||
const tweetIds = blockIds.map((blockId) => { | ||
var _a, _b, _c, _d; | ||
const block = (_a = recordMap.block[blockId]) == null ? void 0 : _a.value; | ||
if ((block == null ? void 0 : block.type) === "tweet") { | ||
const tweetId = (_d = (_c = (_b = block.properties) == null ? void 0 : _b.source) == null ? void 0 : _c[0]) == null ? void 0 : _d[0]; | ||
if (tweetId) { | ||
return tweetId; | ||
} | ||
} | ||
}).filter(Boolean); | ||
return Array.from(new Set(tweetIds)); | ||
}; | ||
// src/map-image-url.ts | ||
@@ -847,2 +863,3 @@ import "notion-types"; | ||
getPageTitle, | ||
getPageTweets, | ||
getTextContent, | ||
@@ -849,0 +866,0 @@ idToUuid, |
{ | ||
"name": "notion-utils", | ||
"version": "7.1.1", | ||
"version": "7.1.2", | ||
"type": "module", | ||
@@ -30,3 +30,3 @@ "description": "Useful utilities for working with Notion data. Isomorphic.", | ||
"p-queue": "^8.0.1", | ||
"notion-types": "7.1.1" | ||
"notion-types": "7.1.2" | ||
}, | ||
@@ -33,0 +33,0 @@ "scripts": { |
Sorry, the diff of this file is not supported yet
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
86433
993
+ Addednotion-types@7.1.2(transitive)
- Removednotion-types@7.1.1(transitive)
Updatednotion-types@7.1.2