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

pg-promise

Package Overview
Dependencies
Maintainers
1
Versions
629
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pg-promise - npm Package Compare versions

Comparing version 0.2.2 to 0.2.3

.npmignore

71

index.js

@@ -49,2 +49,5 @@ // Cannot declare 'use strict' here, because queryResult

// Namespace for type conversion helpers;
lib.as = $wrap;
// Exposing PG library instance, just for flexibility.

@@ -58,28 +61,2 @@ lib.pg = npm.pg;

// Namespace for type conversion helpers;
lib.as = {
bool: function (val) {
if ($isNull(val)) {
return 'null';
}
return val ? 'TRUE' : 'FALSE';
},
text: function (val) {
if ($isNull(val)) {
return 'null';
}
return $wrapText($fixQuotes(val));
},
date: function (val) {
if ($isNull(val)) {
return 'null';
}
if (val instanceof Date) {
return $wrapText(val.toUTCString());
} else {
throw new Error($wrapText(val) + " doesn't represent a valid Date object or value");
}
}
};
return lib;

@@ -348,8 +325,8 @@ };

case 'string':
return dbInst.as.text(val);
return $wrap.text(val);
case 'boolean':
return dbInst.as.bool(val);
return $wrap.bool(val);
default:
if (val instanceof Date) {
return dbInst.as.date(val);
return $wrap.date(val);
} else {

@@ -376,2 +353,38 @@ return val;

// Value wrapper to be exposed through 'pgp.as' namespace;
var $wrap = {
text: function (txt) {
if ($isNull(txt)) {
return 'null';
}
return $wrapText($fixQuotes(txt));
},
bool: function (val) {
if ($isNull(val)) {
return 'null';
}
return val ? 'TRUE' : 'FALSE';
},
date: function (d) {
if ($isNull(d)) {
return 'null';
}
if (d instanceof Date) {
return $wrapText(d.toUTCString());
} else {
throw new Error($wrapText(d) + " doesn't represent a valid Date object or value");
}
},
csv: function (arr) {
if ($isNull(arr)) {
return 'null';
}
if (Array.isArray(arr)) {
return $formatValues(arr);
} else {
throw new Error($wrapText(arr) + " doesn't represent a valid Array object or value");
}
}
};
// Formats a proper function call from the parameters.

@@ -378,0 +391,0 @@ function $createFuncQuery(funcName, params) {

{
"name": "pg-promise",
"version": "0.2.2",
"version": "0.2.3",
"description": "PG + Promise made easy, with transactions support.",

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