2.0.1 • Published 2 years ago

decamelize-keys v2.0.1

Weekly downloads
4,815,862
License
MIT
Repository
github
Last release
2 years ago

decamelize-keys

Convert object keys from camel case using decamelize

Install

npm install decamelize-keys

Usage

import decamelizeKeys from 'decamelize-keys';

// Convert an object
decamelizeKeys({fooBar: true});
//=> {foo_bar: true}

// Convert an array of objects
decamelizeKeys([{fooBar: true}, {barFoo: false}]);
//=> [{foo_bar: true}, {bar_foo: false}]

API

decamelizeKeys(input, options?)

input

Type: object | object[]

An object or array of objects to decamelize.

options

Type: object

separator

Type: string\ Default: '_'

The character or string used to separate words.

import decamelizeKeys from 'decamelize-keys';

decamelizeKeys({fooBar: true});
//=> {foo_bar: true}

decamelizeKeys({fooBar: true}, {separator: '-'});
//=> {'foo-bar': true}
exclude

Type: Array<string | RegExp>\ Default: []

Exclude keys from being decamelized.

deep

Type: boolean\ Default: false

Recurse nested objects and objects in arrays.

import decamelizeKeys from 'decamelize-keys';

decamelizeKeys({fooBar: true, nested: {unicornRainbow: true}}, {deep: true});
//=> {foo_bar: true, nested: {unicorn_rainbow: true}}

Related

archetype-libraryeasy-select-rnchinjowwchinjowreact-native-bluetooth2killi8n-react-native-fast-imagesb-filmotheque@sbesson/sample-vuejsobject-selectairscanairscan-examplereact-native-esc-pos-sahaab@borisovart/atol-kkt-module@frxf/frxfdeneme323112@ntt_app/react-native-custom-notificationreact-native-covid-sdk@jttechnic/interpretermysql-formatreact-native-printer-brothersreact-native-shekhar-bridge-testcogoportutils@oiti/documentoscopy-react-native@mink-opn/build-tokensquoc-test@saaspe/componentsexpand-react-bridgeopea-bootstraapluminos-ui-core@everything-registry/sub-chunk-1458iqra-calculatorjawwy-sdkjawwy_gamification_releasereact-native-sphereuisphereuijawwy_libraryreact-native-credit-card-pkgreact-native-jawwy_samplelapture-ui-complaptureuigriffin-ui-libraryclxcxlcodebase-npmconnex-kakilangconnex_ram00nezdate-to-block-ethcustom-widgets-librarycurrency_exchanger-by-rehmanevanutilseditor.js-custom-multiple-selectedemr-tabulator-tableses-react-bridgefanfou-sdkfawaterak-online-paymentfawatrak-online-paymentfirebase-sign-in-with-ethereumelectron-argseditorjs_forkedeasyplayer-myec0lint-style-config-postcsseasemlclientfmslfmrframework_test_library_sixdeeframework_test_library_sixdee_newframework_test_library_sixdee_new_newfront-and-backfixed_form_builderfluent.adflow.reactnativesdkfluent.adflow.reactnativesdk-alphagaurav-react-native-loopgamification-integration-newgenz-native-elementsfront-end-engineeringgh-monoproject-clihaidercalxgit-branching-workflowgogencygogency-test-2discord.js-bycondiscordjs-con-selfdemo-test-scrndevitzer-general-clidogandev-simple-toastdotex-plugindotenv-coredynamic_step_corehong1-utilsip-designpolen-web-components-reactover-armour-masterpixiv-app-apipayutestingori-bot-react-nativeproject-wajs-dvpnm-yph-react-native-custom-componentspyreswap-sdkzzzxxxyyy321123jawwy_library_newjawy_library_v1
1.1.1

2 years ago

2.0.1

2 years ago

2.0.0

2 years ago

1.1.0

9 years ago

1.0.0

9 years ago