Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

notabase

Package Overview
Dependencies
Maintainers
1
Versions
48
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

notabase - npm Package Compare versions

Comparing version 0.6.2 to 0.6.3

2

package.json
{
"name": "notabase",
"version": "0.6.2",
"version": "0.6.3",
"description": "API Wrapper For Notion's Database",

@@ -5,0 +5,0 @@ "main": "src/notabase.js",

@@ -126,10 +126,10 @@ import { isPageId } from './utils'

case 'number':
newV = [value]
newV = [[value]]
break
case 'checkbox':
newV = value ? ['Yes'] : ['No']
newV = value ? [['Yes']] : [['No']]
break
case 'multi_select':
if (value instanceof Array) {
newV = [value.join(',')]
newV = [[value.join(',')]]
}

@@ -139,12 +139,26 @@ break

// check value type , should be Row
if (value instanceof Row) {
if (schema[key].collection_id === value.parent_id && value.parent_table === "collection") {
newV = ["‣", [["p", value.id]]]
if (value instanceof Array) {
if (value.length === 1 && value[0] instanceof Row) {
newV = [["‣", [["p", value[0].id]]]]
} else if (value.length === 0) {
newV = []
} else {
throw Error()
newV = value.filter(v => v instanceof Row).reduce((a, b, index) => {
if (index === 1) {
return [["‣", [["p", a.id]]]].concat([
[","],
["‣", [["p", b.id]]]
])
} else {
return a.concat([
[","],
["‣", [["p", b.id]]]
])
}
})
}
} else if (isPageId(value)) {
// fixme need check
newV = ["‣", [["p", value]]]
}else{
// fixme check (schema[key].collection_id === value.parent_id && value.parent_table === "collection")
// throw Error()
}
else {
throw Error()

@@ -154,3 +168,3 @@ }

default:
newV = [value]
newV = [[value]]
}

@@ -160,3 +174,3 @@

"operations": [
{ "id": target.id, "table": "block", "path": ["properties", key], "command": "set", "args": [newV] },
{ "id": target.id, "table": "block", "path": ["properties", key], "command": "set", "args": newV },
{ "id": target.id, "table": "block", "path": [], "command": "update", "args": { "last_edited_time": (new Date()).getTime() } }

@@ -163,0 +177,0 @@ ]

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