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

cafe-query

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cafe-query - npm Package Compare versions

Comparing version 1.3.0 to 1.3.1

19

index.js

@@ -7,2 +7,11 @@ function CafeQueryError(message) {

const assertSingle = rows => {
if (!rows) {
throw new CafeQueryError('Expected single result, got falsy value')
}
if (rows.length !== 1) {
throw new CafeQueryError('Expected single result, got length: ' + rows.length)
}
}
function CafeQuery(dataSource) {

@@ -21,8 +30,3 @@ return {

const [rows] = await dataSource.query(query, values)
if (!rows) {
throw new CafeQueryError('Expected single result, got falsy value')
}
if (rows.length !== 1) {
throw new CafeQueryError('Expected single result, got length: ' + rows.length)
}
assertSingle(rows)
return rows[0]

@@ -43,3 +47,4 @@ },

const [rows] = await dataSource.query(query, values)
return rows.length
assertSingle(rows)
return rows[0]['COUNT(*)']
},

@@ -46,0 +51,0 @@ query: async (query, ...values) => {

{
"name": "cafe-query",
"version": "1.3.0",
"version": "1.3.1",
"description": "",

@@ -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