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

node-json-database

Package Overview
Dependencies
Maintainers
1
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-json-database - npm Package Compare versions

Comparing version 0.0.14 to 0.0.15

20

index.ts

@@ -617,3 +617,3 @@ import * as fs from 'fs'

drop(colNames: string[]) {
if (!thisTable.exists) {
if (!thTable.exists) {
throw new Error(`Table ${ chalk.magenta(tableName) } does not exist in database ${ chalk.cyan(filePath) }.`)

@@ -719,6 +719,20 @@ }

const prevNumber = (rowNum == undefined)
? (table.rows.length > 0)
? table.rows[table.rows.length - 1][col.name]
: 0
: (rowNum > 0)
? table.rows[rowNum - 1][col.name]
: 0
const currentNumber = (rowNum == undefined) ? table.rows.length + 1 : rowNum + 1 // autoIncrement starts at 1
if (el != undefined && el != currentNumber) {
throw new Error(`Could not insert ${ chalk.red(el) } into column ${ chalk.yellow(col.name) } of table ${ chalk.magenta(tableName) } of database ${ chalk.cyan(filePath) }, because this column has the ${ chalk.grey('autoIncrement') } constraint. Leave this column empty.`)
const nextNumber = (rowNum == undefined)
? Infinity
: (rowNum < table.rows.length)
? table.rows[rowNum + 1][col.name]
: Infinity
if (el != undefined && (el <= prevNumber || el >= nextNumber)) {
throw new Error(`Could not insert ${ chalk.red(el) } into column ${ chalk.yellow(col.name) } of table ${ chalk.magenta(tableName) } of database ${ chalk.cyan(filePath) }, because this column has the ${ chalk.grey('autoIncrement') } constraint. Leave this column empty or insert a value bigger than ${ prevNumber } and smaller than ${ nextNumber }`)
}

@@ -725,0 +739,0 @@

2

package.json
{
"name": "node-json-database",
"version": "0.0.14",
"version": "0.0.15",
"description": "JS Database Management System using JSON files",

@@ -5,0 +5,0 @@ "main": "index.js",

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