1
0
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:
2016-01-05 12:28:04 -06:00
parent 4bb8cae81e
commit 6ab45fe935
13249 changed files with 317868 additions and 2101398 deletions

42
node_modules/mquery/lib/collection/collection.js generated vendored Normal file
View File

@@ -0,0 +1,42 @@
'use strict';
/**
* methods a collection must implement
*/
var methods = [
'find'
, 'findOne'
, 'update'
, 'remove'
, 'count'
, 'distinct'
, 'findAndModify'
, 'aggregate'
, 'findStream'
];
/**
* Collection base class from which implementations inherit
*/
function Collection () {}
for (var i = 0, len = methods.length; i < len; ++i) {
var method = methods[i];
Collection.prototype[method] = notImplemented(method);
}
module.exports = exports = Collection;
Collection.methods = methods;
/**
* creates a function which throws an implementation error
*/
function notImplemented (method) {
return function () {
throw new Error('collection.' + method + ' not implemented');
}
}

13
node_modules/mquery/lib/collection/index.js generated vendored Normal file
View File

@@ -0,0 +1,13 @@
'use strict';
var env = require('../env')
if ('unknown' == env.type) {
throw new Error('Unknown environment')
}
module.exports =
env.isNode ? require('./node') :
env.isMongo ? require('./collection') :
require('./collection');

100
node_modules/mquery/lib/collection/node.js generated vendored Normal file
View File

@@ -0,0 +1,100 @@
'use strict';
/**
* Module dependencies
*/
var Collection = require('./collection');
var utils = require('../utils');
function NodeCollection (col) {
this.collection = col;
this.collectionName = col.collectionName;
}
/**
* inherit from collection base class
*/
utils.inherits(NodeCollection, Collection);
/**
* find(match, options, function(err, docs))
*/
NodeCollection.prototype.find = function (match, options, cb) {
this.collection.find(match, options, function (err, cursor) {
if (err) return cb(err);
cursor.toArray(cb);
});
}
/**
* findOne(match, options, function(err, doc))
*/
NodeCollection.prototype.findOne = function (match, options, cb) {
this.collection.findOne(match, options, cb);
}
/**
* count(match, options, function(err, count))
*/
NodeCollection.prototype.count = function (match, options, cb) {
this.collection.count(match, options, cb);
}
/**
* distinct(prop, match, options, function(err, count))
*/
NodeCollection.prototype.distinct = function (prop, match, options, cb) {
this.collection.distinct(prop, match, options, cb);
}
/**
* update(match, update, options, function(err[, result]))
*/
NodeCollection.prototype.update = function (match, update, options, cb) {
this.collection.update(match, update, options, cb);
}
/**
* remove(match, options, function(err[, result])
*/
NodeCollection.prototype.remove = function (match, options, cb) {
this.collection.remove(match, options, cb);
}
/**
* findAndModify(match, update, options, function(err, doc))
*/
NodeCollection.prototype.findAndModify = function (match, update, options, cb) {
var sort = Array.isArray(options.sort) ? options.sort : [];
this.collection.findAndModify(match, sort, update, options, cb);
}
/**
* var stream = findStream(match, findOptions, streamOptions)
*/
NodeCollection.prototype.findStream = function(match, findOptions, streamOptions) {
return this.collection.find(match, findOptions).stream(streamOptions);
}
/**
* aggregation(operators..., function(err, doc))
* TODO
*/
/**
* Expose
*/
module.exports = exports = NodeCollection;

22
node_modules/mquery/lib/env.js generated vendored Normal file
View File

@@ -0,0 +1,22 @@
'use strict';
exports.isNode = 'undefined' != typeof process
&& 'object' == typeof module
&& 'object' == typeof global
&& 'function' == typeof Buffer
&& process.argv
exports.isMongo = !exports.isNode
&& 'function' == typeof printjson
&& 'function' == typeof ObjectId
&& 'function' == typeof rs
&& 'function' == typeof sh;
exports.isBrowser = !exports.isNode
&& !exports.isMongo
&& 'undefined' != typeof window;
exports.type = exports.isNode ? 'node'
: exports.isMongo ? 'mongo'
: exports.isBrowser ? 'browser'
: 'unknown'

2612
node_modules/mquery/lib/mquery.js generated vendored Normal file

File diff suppressed because it is too large Load Diff

90
node_modules/mquery/lib/permissions.js generated vendored Normal file
View File

@@ -0,0 +1,90 @@
'use strict';
var denied = exports;
denied.distinct = function (self) {
if (self._fields && Object.keys(self._fields).length > 0) {
return 'field selection and slice'
}
var keys = Object.keys(denied.distinct);
var err;
keys.every(function (option) {
if (self.options[option]) {
err = option;
return false;
}
return true;
});
return err;
};
denied.distinct.select =
denied.distinct.slice =
denied.distinct.sort =
denied.distinct.limit =
denied.distinct.skip =
denied.distinct.batchSize =
denied.distinct.comment =
denied.distinct.maxScan =
denied.distinct.snapshot =
denied.distinct.hint =
denied.distinct.tailable = true;
// aggregation integration
denied.findOneAndUpdate =
denied.findOneAndRemove = function (self) {
var keys = Object.keys(denied.findOneAndUpdate);
var err;
keys.every(function (option) {
if (self.options[option]) {
err = option;
return false;
}
return true;
});
return err;
}
denied.findOneAndUpdate.limit =
denied.findOneAndUpdate.skip =
denied.findOneAndUpdate.batchSize =
denied.findOneAndUpdate.maxScan =
denied.findOneAndUpdate.snapshot =
denied.findOneAndUpdate.hint =
denied.findOneAndUpdate.tailable =
denied.findOneAndUpdate.comment = true;
denied.count = function (self) {
if (self._fields && Object.keys(self._fields).length > 0) {
return 'field selection and slice'
}
var keys = Object.keys(denied.count);
var err;
keys.every(function (option) {
if (self.options[option]) {
err = option;
return false;
}
return true;
});
return err;
}
denied.count.select =
denied.count.slice =
denied.count.sort =
denied.count.batchSize =
denied.count.comment =
denied.count.maxScan =
denied.count.snapshot =
denied.count.tailable = true;

331
node_modules/mquery/lib/utils.js generated vendored Normal file
View File

@@ -0,0 +1,331 @@
'use strict';
/*!
* Module dependencies.
*/
var RegExpClone = require('regexp-clone')
/**
* Clones objects
*
* @param {Object} obj the object to clone
* @param {Object} options
* @return {Object} the cloned object
* @api private
*/
var clone = exports.clone = function clone (obj, options) {
if (obj === undefined || obj === null)
return obj;
if (Array.isArray(obj))
return exports.cloneArray(obj, options);
if (obj.constructor) {
if (/ObjectI[dD]$/.test(obj.constructor.name)) {
return 'function' == typeof obj.clone
? obj.clone()
: new obj.constructor(obj.id);
}
if ('ReadPreference' === obj._type && obj.isValid && obj.toObject) {
return 'function' == typeof obj.clone
? obj.clone()
: new obj.constructor(obj.mode, clone(obj.tags, options));
}
if ('Binary' == obj._bsontype && obj.buffer && obj.value) {
return 'function' == typeof obj.clone
? obj.clone()
: new obj.constructor(obj.value(true), obj.sub_type);
}
if ('Date' === obj.constructor.name || 'Function' === obj.constructor.name)
return new obj.constructor(+obj);
if ('RegExp' === obj.constructor.name)
return RegExpClone(obj);
if ('Buffer' === obj.constructor.name)
return exports.cloneBuffer(obj);
}
if (isObject(obj))
return exports.cloneObject(obj, options);
if (obj.valueOf)
return obj.valueOf();
};
/*!
* ignore
*/
var cloneObject = exports.cloneObject = function cloneObject (obj, options) {
var retainKeyOrder = options && options.retainKeyOrder
, minimize = options && options.minimize
, ret = {}
, hasKeys
, keys
, val
, k
, i
if (retainKeyOrder) {
for (k in obj) {
val = clone(obj[k], options);
if (!minimize || ('undefined' !== typeof val)) {
hasKeys || (hasKeys = true);
ret[k] = val;
}
}
} else {
// faster
keys = Object.keys(obj);
i = keys.length;
while (i--) {
k = keys[i];
val = clone(obj[k], options);
if (!minimize || ('undefined' !== typeof val)) {
if (!hasKeys) hasKeys = true;
ret[k] = val;
}
}
}
return minimize
? hasKeys && ret
: ret;
};
var cloneArray = exports.cloneArray = function cloneArray (arr, options) {
var ret = [];
for (var i = 0, l = arr.length; i < l; i++)
ret.push(clone(arr[i], options));
return ret;
};
/**
* process.nextTick helper.
*
* Wraps the given `callback` in a try/catch. If an error is
* caught it will be thrown on nextTick.
*
* node-mongodb-native had a habit of state corruption when
* an error was immediately thrown from within a collection
* method (find, update, etc) callback.
*
* @param {Function} [callback]
* @api private
*/
var tick = exports.tick = function tick (callback) {
if ('function' !== typeof callback) return;
return function () {
// callbacks should always be fired on the next
// turn of the event loop. A side benefit is
// errors thrown from executing the callback
// will not cause drivers state to be corrupted
// which has historically been a problem.
var args = arguments;
soon(function(){
callback.apply(this, args);
});
}
}
/**
* Merges `from` into `to` without overwriting existing properties.
*
* @param {Object} to
* @param {Object} from
* @api private
*/
var merge = exports.merge = function merge (to, from) {
var keys = Object.keys(from)
, i = keys.length
, key
while (i--) {
key = keys[i];
if ('undefined' === typeof to[key]) {
to[key] = from[key];
} else {
if (exports.isObject(from[key])) {
merge(to[key], from[key]);
} else {
to[key] = from[key];
}
}
}
}
/**
* Same as merge but clones the assigned values.
*
* @param {Object} to
* @param {Object} from
* @api private
*/
var mergeClone = exports.mergeClone = function mergeClone (to, from) {
var keys = Object.keys(from)
, i = keys.length
, key
while (i--) {
key = keys[i];
if ('undefined' === typeof to[key]) {
// make sure to retain key order here because of a bug handling the $each
// operator in mongodb 2.4.4
to[key] = clone(from[key], { retainKeyOrder : 1});
} else {
if (exports.isObject(from[key])) {
mergeClone(to[key], from[key]);
} else {
// make sure to retain key order here because of a bug handling the
// $each operator in mongodb 2.4.4
to[key] = clone(from[key], { retainKeyOrder : 1});
}
}
}
}
/**
* Read pref helper (mongo 2.2 drivers support this)
*
* Allows using aliases instead of full preference names:
*
* p primary
* pp primaryPreferred
* s secondary
* sp secondaryPreferred
* n nearest
*
* @param {String} pref
*/
exports.readPref = function readPref (pref) {
switch (pref) {
case 'p':
pref = 'primary';
break;
case 'pp':
pref = 'primaryPreferred';
break;
case 's':
pref = 'secondary';
break;
case 'sp':
pref = 'secondaryPreferred';
break;
case 'n':
pref = 'nearest';
break;
}
return pref;
}
/**
* Object.prototype.toString.call helper
*/
var _toString = Object.prototype.toString;
var toString = exports.toString = function (arg) {
return _toString.call(arg);
}
/**
* Determines if `arg` is an object.
*
* @param {Object|Array|String|Function|RegExp|any} arg
* @return {Boolean}
*/
var isObject = exports.isObject = function (arg) {
return '[object Object]' == exports.toString(arg);
}
/**
* Determines if `arg` is an array.
*
* @param {Object}
* @return {Boolean}
* @see nodejs utils
*/
var isArray = exports.isArray = function (arg) {
return Array.isArray(arg) ||
'object' == typeof arg && '[object Array]' == exports.toString(arg);
}
/**
* Object.keys helper
*/
exports.keys = Object.keys || function (obj) {
var keys = [];
for (var k in obj) if (obj.hasOwnProperty(k)) {
keys.push(k);
}
return keys;
}
/**
* Basic Object.create polyfill.
* Only one argument is supported.
*
* Based on https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object/create
*/
exports.create = 'function' == typeof Object.create
? Object.create
: create;
function create (proto) {
if (arguments.length > 1) {
throw new Error("Adding properties is not supported")
}
function F () {}
F.prototype = proto;
return new F;
}
/**
* inheritance
*/
exports.inherits = function (ctor, superCtor) {
ctor.prototype = exports.create(superCtor.prototype);
ctor.prototype.constructor = ctor;
}
/**
* nextTick helper
* compat with node 0.10 which behaves differently than previous versions
*/
var soon = exports.soon = 'function' == typeof setImmediate
? setImmediate
: process.nextTick;
/**
* Clones the contents of a buffer.
*
* @param {Buffer} buff
* @return {Buffer}
*/
exports.cloneBuffer = function (buff) {
var dupe = new Buffer(buff.length);
buff.copy(dupe, 0, 0, buff.length);
return dupe;
};