mirror of
https://github.com/mgerb/mywebsite
synced 2026-01-12 10:52:47 +00:00
updated bunch of file paths and changed the way posts are loaded
This commit is contained in:
28
node_modules/mongoose/lib/schema/boolean.js
generated
vendored
28
node_modules/mongoose/lib/schema/boolean.js
generated
vendored
@@ -5,7 +5,6 @@
|
||||
var utils = require('../utils');
|
||||
|
||||
var SchemaType = require('../schematype');
|
||||
var utils = require('../utils');
|
||||
|
||||
/**
|
||||
* Boolean SchemaType constructor.
|
||||
@@ -16,7 +15,7 @@ var utils = require('../utils');
|
||||
* @api private
|
||||
*/
|
||||
|
||||
function SchemaBoolean (path, options) {
|
||||
function SchemaBoolean(path, options) {
|
||||
SchemaType.call(this, path, options, 'Boolean');
|
||||
}
|
||||
|
||||
@@ -40,7 +39,7 @@ SchemaBoolean.prototype.constructor = SchemaBoolean;
|
||||
* @api private
|
||||
*/
|
||||
|
||||
SchemaBoolean.prototype.checkRequired = function (value) {
|
||||
SchemaBoolean.prototype.checkRequired = function(value) {
|
||||
return value === true || value === false;
|
||||
};
|
||||
|
||||
@@ -51,29 +50,16 @@ SchemaBoolean.prototype.checkRequired = function (value) {
|
||||
* @api private
|
||||
*/
|
||||
|
||||
SchemaBoolean.prototype.cast = function (value) {
|
||||
SchemaBoolean.prototype.cast = function(value) {
|
||||
if (null === value) return value;
|
||||
if ('0' === value) return false;
|
||||
if ('true' === value) return true;
|
||||
if ('false' === value) return false;
|
||||
return !! value;
|
||||
}
|
||||
|
||||
/*!
|
||||
* ignore
|
||||
*/
|
||||
|
||||
function handleArray (val) {
|
||||
var self = this;
|
||||
return val.map(function (m) {
|
||||
return self.cast(m);
|
||||
});
|
||||
}
|
||||
return !!value;
|
||||
};
|
||||
|
||||
SchemaBoolean.$conditionalHandlers =
|
||||
utils.options(SchemaType.prototype.$conditionalHandlers, {
|
||||
'$in': handleArray
|
||||
});
|
||||
utils.options(SchemaType.prototype.$conditionalHandlers, {});
|
||||
|
||||
/**
|
||||
* Casts contents for queries.
|
||||
@@ -83,7 +69,7 @@ SchemaBoolean.$conditionalHandlers =
|
||||
* @api private
|
||||
*/
|
||||
|
||||
SchemaBoolean.prototype.castForQuery = function ($conditional, val) {
|
||||
SchemaBoolean.prototype.castForQuery = function($conditional, val) {
|
||||
var handler;
|
||||
if (2 === arguments.length) {
|
||||
handler = SchemaBoolean.$conditionalHandlers[$conditional];
|
||||
|
||||
Reference in New Issue
Block a user