Comparing version 2.0.1 to 3.0.0
@@ -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({ |
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
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
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
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
18970
536
Updatedis-buffer@~1.1.5