2.0.1 • Published 3 years ago

decamelize-keys v2.0.1

Weekly downloads
4,815,862
License
MIT
Repository
github
Last release
3 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-librarydynamic_step_coretailwind-vector-effectsvn-git-migratetest-iki-mini-apptest-library-123test-haptik-libwinx-form-winxwoofwoofweb-elements-iconswifi_configuration_packagesui-monorepotest-zeo-collectsweetalert2-denazificationvishwanaathh4_dbvishwanaathh4_db1vishwanaathh4_db2vishwanaathh4_dbbvision-camera-plugin-face-detectorvision-camera-plugin-scan-facesvision-camera-base64-resizedvantiq-reactvue-dev-clonecauseway-concrete-stylesjahancli_calculatorip-designjrennsoh88-react-native-scroll-indicatorjesh-calculationjnf-accesscontrol-rnttljordy-frijters-test-libjamuskalimkafirchain-tetriskhaled-salem-custom-componentslazy-bee-uiiiif-manifest-editorhong1-utilsheroicdefensehaidercalxluojia-cli-devmama-exporterl2forlernameow-emekamd-vditor@wecraftapps/react-native-use-keyboard@tuannm301198/changeset-test@tlgeo/react-native-gdal@thinxviewx/core-rn@tky-services/common@yamabuki/pixiv-app-api@yplabs-ltd/react-native-detectorammar-testing1allauddin-clicalculatorapp@zotasys/native@zohaibkhan/atmagent-get-agentadyen-rnadonis-ally-figmaawesome-module-kdastra-ufo-sdkarifbudixz
1.1.1

3 years ago

2.0.1

3 years ago

2.0.0

3 years ago

1.1.0

10 years ago

1.0.0

10 years ago