Socket
Socket
Sign inDemoInstall

dottie

Package Overview
Dependencies
0
Maintainers
1
Versions
25
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.1.0 to 1.1.1

14

dottie.js

@@ -27,2 +27,14 @@ (function(undefined) {

var reverseDupArray = function (array) {
var result = new Array(array.length);
var index = array.length;
var arrayMaxIndex = index - 1;
while (index--) {
result[arrayMaxIndex - index] = array[index];
}
return result;
};
var Dottie = function() {

@@ -64,3 +76,3 @@ var args = Array.prototype.slice.call(arguments);

} else if (Array.isArray(path)) {
names = path.reverse();
names = reverseDupArray(path);
}

@@ -67,0 +79,0 @@

2

package.json
{
"name": "dottie",
"version": "1.1.0",
"version": "1.1.1",
"devDependencies": {

@@ -5,0 +5,0 @@ "expect.js": "~0.2.0",

@@ -88,2 +88,15 @@ [![Build Status](https://travis-ci.org/mickhansen/dottie.js.png)](https://travis-ci.org/mickhansen/dottie.js.png)

### Get paths in object
```js
var object = {
a: 1,
b: {
c: 2,
d: { e: 3 }
}
};
dottie.paths(object); // ["a", "b.c", "b.d.e"];
```
## Performance

@@ -90,0 +103,0 @@

@@ -98,3 +98,6 @@ var expect = require("expect.js")

it('should get nested values with keys that have dots', function () {
expect(dottie.get(data, ['nested.dot', 'key'])).to.equal('value');
var path = ['nested.dot', 'key'];
expect(dottie.get(data, path)).to.equal('value');
expect(path).to.eql(['nested.dot', 'key']);
});

@@ -101,0 +104,0 @@ });

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc