New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

notion-utils

Package Overview
Dependencies
Maintainers
1
Versions
116
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

notion-utils - npm Package Compare versions

Comparing version 3.0.0 to 3.0.1

license

23

build/cjs/get-block-parent-page.js

@@ -11,11 +11,20 @@ "use strict";

var getBlockParentPage = function (block, recordMap) {
var _a;
do {
if (!block)
return null;
block = (_a = recordMap.block[block.parent_id]) === null || _a === void 0 ? void 0 : _a.value;
} while ((block === null || block === void 0 ? void 0 : block.type) !== 'page');
return block;
var _a, _b, _c;
var currentRecord = block;
while (currentRecord != null) {
var parentId = currentRecord.parent_id;
var parentTable = currentRecord.parent_table;
if (parentTable === 'collection') {
currentRecord = (_a = recordMap.collection[parentId]) === null || _a === void 0 ? void 0 : _a.value;
}
else {
currentRecord = (_b = recordMap.block[parentId]) === null || _b === void 0 ? void 0 : _b.value;
if (((_c = currentRecord) === null || _c === void 0 ? void 0 : _c.type) === 'page') {
return currentRecord;
}
}
}
return null;
};
exports.getBlockParentPage = getBlockParentPage;
//# sourceMappingURL=get-block-parent-page.js.map

@@ -8,10 +8,19 @@ /**

export var getBlockParentPage = function (block, recordMap) {
var _a;
do {
if (!block)
return null;
block = (_a = recordMap.block[block.parent_id]) === null || _a === void 0 ? void 0 : _a.value;
} while ((block === null || block === void 0 ? void 0 : block.type) !== 'page');
return block;
var _a, _b, _c;
var currentRecord = block;
while (currentRecord != null) {
var parentId = currentRecord.parent_id;
var parentTable = currentRecord.parent_table;
if (parentTable === 'collection') {
currentRecord = (_a = recordMap.collection[parentId]) === null || _a === void 0 ? void 0 : _a.value;
}
else {
currentRecord = (_b = recordMap.block[parentId]) === null || _b === void 0 ? void 0 : _b.value;
if (((_c = currentRecord) === null || _c === void 0 ? void 0 : _c.type) === 'page') {
return currentRecord;
}
}
}
return null;
};
//# sourceMappingURL=get-block-parent-page.js.map
{
"name": "notion-utils",
"version": "3.0.0",
"version": "3.0.1",
"description": "Useful utilities for working with Notion data. Isomorphic.",

@@ -23,3 +23,4 @@ "repository": "NotionX/react-notion-x",

"ava": "^3.13.0"
}
},
"gitHead": "f9d03e2025df65fcb95ccd2e74da47cb7dcf8293"
}

@@ -13,8 +13,20 @@ import * as types from 'notion-types'

): types.PageBlock | null => {
do {
if (!block) return null
block = recordMap.block[block.parent_id]?.value
} while (block?.type !== 'page')
let currentRecord: types.Block | types.Collection = block
return block
while (currentRecord != null) {
const parentId: string = currentRecord.parent_id
const parentTable = currentRecord.parent_table
if (parentTable === 'collection') {
currentRecord = recordMap.collection[parentId]?.value
} else {
currentRecord = recordMap.block[parentId]?.value
if ((currentRecord as types.Block)?.type === 'page') {
return currentRecord as types.PageBlock
}
}
}
return null
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc