snakecase-keys
Advanced tools
Comparing version 1.1.1 to 1.2.0
@@ -6,6 +6,8 @@ 'use strict' | ||
module.exports = function (obj) { | ||
module.exports = function (obj, options) { | ||
options = Object.assign({deep: true}, options) | ||
return map(obj, function (key, val) { | ||
return [snakeCase(key), val] | ||
}, {deep: true}) | ||
}, options) | ||
} |
{ | ||
"name": "snakecase-keys", | ||
"main": "index.js", | ||
"version": "1.1.1", | ||
"version": "1.2.0", | ||
"description": "Convert an object's keys to snake case", | ||
@@ -6,0 +6,0 @@ "license": "MIT", |
@@ -27,3 +27,3 @@ # snakecase-keys [![Build Status](https://travis-ci.org/bendrucker/snakecase-keys.svg?branch=master)](https://travis-ci.org/bendrucker/snakecase-keys) | ||
#### `snakeCaseKeys(obj)` -> `object` | ||
#### `snakeCaseKeys(obj, options)` -> `object` | ||
@@ -37,2 +37,14 @@ ##### obj | ||
##### options | ||
*Optional* | ||
Type: `object` | ||
###### deep | ||
Type: `boolean` | ||
Default: `true` | ||
Enables snake-casing of keys in nested objects. | ||
## Related | ||
@@ -39,0 +51,0 @@ |
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
Trivial Package
Supply chain riskPackages less than 10 lines of code are easily copied into your own project and may not warrant the additional supply chain risk of an external dependency.
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
Trivial Package
Supply chain riskPackages less than 10 lines of code are easily copied into your own project and may not warrant the additional supply chain risk of an external dependency.
Found 1 instance in 1 package
2923
9
55