Comparing version 0.3.1 to 0.3.2
{ | ||
"name": "criterion", | ||
"version": "0.3.1", | ||
"version": "0.3.2", | ||
"description": "criterion describes sql-where-conditions as objects which can be combined and manipulated", | ||
@@ -5,0 +5,0 @@ "keywords": ["sql", "condition", "where"], |
// Generated by CoffeeScript 1.6.3 | ||
var beget, comparisonConstructorByOperator, constructors, isNotCriterion, prototypes; | ||
var beget, comparisonConstructorByOperator, constructors, isNotCriterion, isRaw, prototypes, _ref; | ||
beget = require('./util').beget; | ||
_ref = require('./util'), beget = _ref.beget, isRaw = _ref.isRaw; | ||
@@ -40,3 +40,3 @@ prototypes = {}; | ||
sql: function() { | ||
if ('function' === typeof this._v.sql) { | ||
if (isRaw(this._v)) { | ||
return "" + this._k + " " + this._op + " " + (this._v.sql()); | ||
@@ -48,3 +48,3 @@ } else { | ||
params: function() { | ||
if ('function' === typeof this._v.sql) { | ||
if (isRaw(this._v)) { | ||
if ('function' === typeof this._v.params) { | ||
@@ -51,0 +51,0 @@ return this._v.params(); |
@@ -34,2 +34,5 @@ // Generated by CoffeeScript 1.6.3 | ||
value = first[key]; | ||
if (value == null) { | ||
throw new Error("value undefined or null for key " + key); | ||
} | ||
if (key === '$or') { | ||
@@ -50,5 +53,2 @@ return constructors.or(arrayify(value).map(factory)); | ||
} | ||
if (value == null) { | ||
throw new Error("value undefined or null for key " + key); | ||
} | ||
keys = Object.keys(value); | ||
@@ -55,0 +55,0 @@ modifier = keys[0]; |
@@ -35,1 +35,5 @@ // Generated by CoffeeScript 1.6.3 | ||
}; | ||
module.exports.isRaw = function(value) { | ||
return (value != null) && 'function' === typeof value.sql; | ||
}; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
27473
272