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

snakecase-keys

Package Overview
Dependencies
Maintainers
1
Versions
35
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

snakecase-keys - npm Package Compare versions

Comparing version 2.0.0 to 2.1.0

15

index.js

@@ -7,7 +7,18 @@ 'use strict'

module.exports = function (obj, options) {
options = Object.assign({deep: true}, options)
options = Object.assign({ deep: true, exclude: [] }, options)
return map(obj, function (key, val) {
return [snakeCase(key), val]
return [
matches(options.exclude, key) ? key : snakeCase(key),
val
]
}, options)
}
function matches (patterns, value) {
return patterns.some(function (pattern) {
return typeof pattern === 'string'
? pattern === value
: pattern.test(value)
})
}

4

package.json
{
"name": "snakecase-keys",
"main": "index.js",
"version": "2.0.0",
"version": "2.1.0",
"description": "Convert an object's keys to snake case",

@@ -25,3 +25,3 @@ "license": "MIT",

"tape": "^4.0.0",
"standard": "^11.0.1"
"standard": "^12.0.1"
},

@@ -28,0 +28,0 @@ "files": [

@@ -1,2 +0,2 @@

# snakecase-keys [![Build Status](https://travis-ci.org/bendrucker/snakecase-keys.svg?branch=master)](https://travis-ci.org/bendrucker/snakecase-keys)
# snakecase-keys [![Build Status](https://travis-ci.org/bendrucker/snakecase-keys.svg?branch=master)](https://travis-ci.org/bendrucker/snakecase-keys) [![Greenkeeper badge](https://badges.greenkeeper.io/bendrucker/snakecase-keys.svg)](https://greenkeeper.io/)

@@ -48,2 +48,9 @@ > Convert an object's keys to snake case

###### exclude
Type: `array[string || regexp]`
Default: `[]`
An array of strings or regular expressions matching keys that will be excluded from snake-casing.
## Related

@@ -50,0 +57,0 @@

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