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 5.5.0 to 6.0.0

7

index.d.ts

@@ -89,2 +89,9 @@ import { SnakeCase } from "type-fest";

/**
A function that determines whether to recurse for a specific key and value.
*/
readonly shouldRecurse?: {
(key: any, value: any): boolean;
}
/**
Options object that gets passed to snake-case parsing function.

@@ -91,0 +98,0 @@ @default {}

9

index.js

@@ -12,3 +12,4 @@ 'use strict'

matches(options.exclude, key) ? key : snakeCase(key, options.parsingOptions),
val
val,
mapperOptions(key, val, options)
]

@@ -25,1 +26,7 @@ }, options)

}
function mapperOptions (key, val, options) {
return options.shouldRecurse
? { shouldRecurse: options.shouldRecurse(key, val) }
: undefined
}

6

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

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

"tape": "^5.0.1",
"tsd": "^0.27.0"
"tsd": "^0.30.0"
},

@@ -39,4 +39,4 @@ "files": [

"engines": {
"node": ">=12"
"node": ">=18"
}
}

@@ -55,2 +55,11 @@ # snakecase-keys [![tests](https://github.com/bendrucker/snakecase-keys/workflows/tests/badge.svg)](https://github.com/bendrucker/snakecase-keys/actions?query=workflow%3Atests)

###### `shouldRecurse(key, val)` -> `boolean`
*Optional*
Type: `function`
A function that determines if `val` should be recursed.
Requires `deep: true`.
## Related

@@ -57,0 +66,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