Comparing version 2.3.0 to 3.0.0
17
index.js
@@ -97,19 +97,6 @@ var enabledPrefixes = {}; // Only allow agave to be enabled once per prefix | ||
} | ||
return this; | ||
}; | ||
// array.findItem(testFunction) returns the first item that matches the testFunction | ||
var findItem = function(testFunction){ | ||
var lastIndex; | ||
var found = this.some(function(item, index) { | ||
lastIndex = index; | ||
return testFunction(item); | ||
}); | ||
if ( found ) { | ||
return this[lastIndex]; | ||
} else { | ||
return null; | ||
} | ||
}; | ||
// Run after it hasn't been invoked for 'wait' ms. | ||
@@ -359,5 +346,3 @@ // Useful to stop repeated calls to a function overlapping each other (sometimes called 'bouncing') | ||
'Array':{ | ||
findItem, | ||
'extend':arrayExtend, | ||
'includes': String.prototype.includes, | ||
'clone':arrayClone, | ||
@@ -364,0 +349,0 @@ 'remove':arrayRemove, |
{ | ||
"name": "agave", | ||
"version": "2.3.0", | ||
"version": "3.0.0", | ||
"author": "Mike MacCana <mike.maccana@gmail.com>", | ||
"description": "Cleaner, simpler JavaScript for ES8", | ||
"scripts": { | ||
"test": "mocha -i -g skip" | ||
"test": "mocha -i -g skip --exit" | ||
}, | ||
@@ -21,11 +21,10 @@ "repository": { | ||
], | ||
"dependencies": { | ||
}, | ||
"dependencies": {}, | ||
"devDependencies": { | ||
"mocha": "==3.0.0" | ||
"mocha": "^5.1.0" | ||
}, | ||
"license": "MIT", | ||
"engines": { | ||
"node": ">=6.0" | ||
"node": ">=8.0" | ||
} | ||
} |
[![Build Status](https://secure.travis-ci.org/mikemaccana/agave.png?branch=master)](https://travis-ci.org/mikemaccana/agave) | ||
Agave.js **safely** extends native JavaScript objects with helpful, intuitive methods that **make your code shorter and more readable**. | ||
Agave.js **safely** extends native JavaScript objects with helpful, intuitive methods, using a **prefix of your choice**, that **make your code shorter and more readable**. | ||
It's **designed for ES8**, and doesn't replicate anything already included in the stdlib. | ||
For full documentation, [visit agavejs.org](http://agavejs.org) | ||
For [full documentation, visit agavejs.org](http://agavejs.org) | ||
@@ -33,11 +33,2 @@ // Tests. Mocha/assert style. See | ||
suite('Array.includes', function(){ | ||
test('fetches the item accurately', function(){ | ||
assert(['one','two','three'].avincludes('two') ); | ||
}); | ||
test('handles missing items accurately', function(){ | ||
assert( ! ['one','two','three'].avincludes('notthere') ); | ||
}); | ||
}); | ||
suite('Array.extend', function(){ | ||
@@ -91,10 +82,2 @@ test('extends the array accurately', function(){ | ||
suite('Array.findItem', function(){ | ||
test('correctly finds items that match the function', function(){ | ||
assert.equal(['one','two','three'].avfindItem(function(item){ | ||
return (item === 'three'); | ||
}), 'three'); | ||
}); | ||
}); | ||
suite('Array.remove', function () { | ||
@@ -331,3 +314,3 @@ test('correctly removes the given member', function (){ | ||
for ( var key in mockObject ) { | ||
assert( ! ['avgetKeys','avgetSize','avgetPath'].avincludes(key) ); | ||
assert( ! ['avgetKeys','avgetSize','avgetPath'].includes(key) ); | ||
} | ||
@@ -334,0 +317,0 @@ }); |
27463
733