Comparing version 0.0.9-0 to 0.1.0
@@ -100,3 +100,3 @@ (function(undefined) { | ||
for (var index in pieces) { | ||
for (var index = 0; index < piecesLength; index++) { | ||
piece = pieces[index]; | ||
@@ -103,0 +103,0 @@ if (index != (piecesLength - 1) && !current.hasOwnProperty(piece)) { |
{ | ||
"name": "dottie", | ||
"version": "0.0.9-0", | ||
"version": "0.1.0", | ||
"devDependencies": { | ||
@@ -5,0 +5,0 @@ "expect.js": "~0.2.0", |
@@ -1,2 +0,3 @@ | ||
[![Build Status](https://secure.travis-ci.org/innofluence/dottie.js.png)](http://travis-ci.org/innofluence/dottie.js) | ||
[![Build Status](https://travis-ci.org/mickhansen/dottie.js.png)](https://travis-ci.org/mickhansen/dottie.js.png) | ||
[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/mickhansen/dottie.js/trend.png)](https://bitdeli.com/free "Bitdeli Badge") | ||
@@ -49,2 +50,2 @@ ## Install | ||
} | ||
} | ||
} |
var expect = require("expect.js"), | ||
dottie = require('../dottie'); | ||
/* If people modify the array prototype Dottie should not be affected */ | ||
Array.prototype.getByName = function(name) { | ||
for (var i = 0, len = this.length; i < len; i++) { | ||
if (typeof this[i] != "object") continue; | ||
if (this[i].name === name) return this[i]; | ||
} | ||
}; | ||
Array.prototype.getByType = function(type) { | ||
var newvalues = []; | ||
for (var i = 0, len = this.length; i < len; i++) { | ||
if (typeof this[i] != "object") continue; | ||
if (this[i].type === type) newvalues.push(this[i]); | ||
} | ||
if (newvalues.length <= 0) newvalues = undefined; | ||
return newvalues; | ||
}; | ||
describe("dottie.get", function () { | ||
@@ -5,0 +23,0 @@ var data = { |
var expect = require("expect.js"), | ||
dottie = require('../dottie'); | ||
/* If people modify the array prototype Dottie should not be affected */ | ||
Array.prototype.getByName = function(name) { | ||
for (var i = 0, len = this.length; i < len; i++) { | ||
if (typeof this[i] != "object") continue; | ||
if (this[i].name === name) return this[i]; | ||
} | ||
}; | ||
Array.prototype.getByType = function(type) { | ||
var newvalues = []; | ||
for (var i = 0, len = this.length; i < len; i++) { | ||
if (typeof this[i] != "object") continue; | ||
if (this[i].type === type) newvalues.push(this[i]); | ||
} | ||
if (newvalues.length <= 0) newvalues = undefined; | ||
return newvalues; | ||
}; | ||
describe("dottie.transform", function () { | ||
@@ -5,0 +23,0 @@ it("should create a properly nested object from a basic dottie notated set of keys", function () { |
12206
319
51