Socket
Socket
Sign inDemoInstall

zol

Package Overview
Dependencies
Maintainers
1
Versions
35
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

zol - npm Package Compare versions

Comparing version 0.2.0 to 0.2.1

2

package.json
{
"name": "zol",
"version": "0.2.0",
"version": "0.2.1",
"description": "Type safe composable SQL abstraction layer",

@@ -5,0 +5,0 @@ "keywords": [

@@ -34,2 +34,6 @@ import { Exp } from "./Exp";

function nullParser(val: string): never {
throw new Error(`Tried to parse a nullCol. This is likely a bug in zol, please report. Column value: "${val}"`);
}
export function nullCol<s>(): Col<s, null> {

@@ -41,3 +45,3 @@ return colWrap({

},
parser: val => val
parser: nullParser
});

@@ -85,2 +89,14 @@ }

export function ifThenElse<s, a>(if_: Col<s, boolean>, then: Col<s, a>, else_: Col<s, a>): Col<s, a> {
// the "then" and "else_" columns are of the same type, so they
// (supposedly) have the same parser, so we can arbitrarily pick
// either one.
//
// However: we must watch out if "then" or "else_" was set to "nullCol()",
// and in that case choose the other one's parser.
//
// (If both "then" and "else_" were set to "nullCol()" then the
// the column will always have a NULL value and the parser we set
// here wlil never be called)
const parser = (<any>then).parser !== nullParser ? (<any>then).parser : (<any>else_).parser;
return colWrap({

@@ -91,7 +107,3 @@ type: "EIfThenElse",

expElse: colUnwrap(else_),
// the "then" and "else_" columns are of the same type, so they
// (supposedly) have the same parser, so we can arbitrarily pick
// either one:
parser: (<any>colUnwrap(then)).parser
parser: parser
});

@@ -98,0 +110,0 @@ }

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

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