Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

flat

Package Overview
Dependencies
Maintainers
2
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

flat - npm Package Compare versions

Comparing version 2.0.1 to 3.0.0

3

index.js

@@ -63,3 +63,4 @@ var isBuffer = require('is-buffer')

isNaN(parsedKey) ||
key.indexOf('.') !== -1
key.indexOf('.') !== -1 ||
opts.object
) ? key

@@ -66,0 +67,0 @@ : parsedKey

{
"name": "flat",
"version": "2.0.1",
"version": "3.0.0",
"main": "index.js",

@@ -11,3 +11,3 @@ "scripts": {

"devDependencies": {
"mocha": "~2.4.5"
"mocha": "~3.4.2"
},

@@ -18,3 +18,3 @@ "directories": {

"dependencies": {
"is-buffer": "~1.1.2"
"is-buffer": "~1.1.5"
},

@@ -21,0 +21,0 @@ "repository": {

@@ -165,2 +165,14 @@ var assert = require('assert')

})
test('Should keep number in the left when object', function() {
assert.deepEqual(flatten({
hello: {
'0200': 'world',
'0500': 'darkness my old friend'
}
}), {
'hello.0200': 'world',
'hello.0500': 'darkness my old friend'
})
})
})

@@ -379,2 +391,18 @@

test('Should keep the zero in the left when object is true', function() {
var unflattened = unflatten({
'hello.0200': 'world',
'hello.0500': 'darkness my old friend'
}, {
object: true
});
assert.deepEqual({
hello: {
'0200': 'world',
'0500': 'darkness my old friend'
}
}, unflattened);
})
test('Should not create object when false', function() {

@@ -381,0 +409,0 @@ var unflattened = unflatten({

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc