collectionize
Advanced tools
Comparing version 0.3.1 to 0.3.2
{ | ||
"name": "collectionize", | ||
"version": "0.3.1", | ||
"main": "collectionize.js", | ||
@@ -5,0 +4,0 @@ "license": "MIT", |
(function () { | ||
var LODASH_METHODS = [ | ||
'at', 'every', 'filter', 'find', 'findIndex', | ||
'findLastIndex', 'first', 'last', 'map', 'max', 'min', | ||
'pluck', 'reduce', 'reduceRight', 'reject', 'sample', | ||
'size', 'shuffle', 'some', 'sortBy', 'where' | ||
]; | ||
var isBrowser = typeof window !== 'undefined'; | ||
@@ -82,14 +89,10 @@ var isNode = typeof module !== 'undefined' && module.exports; | ||
function Collectionize(name) { | ||
var self = { | ||
db: [], | ||
listeners: [], | ||
name: name // used for localStorage property naming | ||
}; | ||
function Collectionize(name, self) { | ||
self = self || {}; | ||
var lodashMethods = ['at', 'every', 'filter', 'find', 'findIndex', | ||
'findLastIndex', 'first', 'last', 'map', 'max', 'min', 'pluck', 'reduce', | ||
'reduceRight', 'reject', 'sample', 'size', 'shuffle', 'some', 'sortBy', 'where']; | ||
self.db = []; | ||
self.listeners = []; | ||
self.name = name; // Used for localStorage property naming. | ||
nativeEach(lodashMethods, function (methodName) { | ||
nativeEach(LODASH_METHODS, function (methodName) { | ||
self[methodName] = function () { | ||
@@ -96,0 +99,0 @@ var args = _.toArray(arguments); |
{ | ||
"name": "collectionize", | ||
"description": "A lightweight JS model/collection library.", | ||
"version": "0.3.1", | ||
"version": "0.3.2", | ||
"repository": "https://github.com/andrewchilds/collectionize.git", | ||
@@ -6,0 +6,0 @@ "author": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
19983
264