Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
fast-case
is a JavaScript library for camelcase and pascalcase. It is designed to be similar to humps and xcase, with algorithm optimizations for additional speed.
$ yarn add fast-case
import {
camelize,
decamelize,
pascalize,
depascalize,
camelizeKeys,
camelizeKeysInPlace,
decamelizeKeys,
decamelizeKeysInPlace,
pascalizeKeys,
pascalizeKeysInPlace,
depascalizeKeys,
depascalizeKeysInPlace,
} from 'fast-case'
// 'a_string' -> 'aString'
camelize(string)
// 'aString' -> 'a_string'
decamelize(string)
// 'a_string' -> 'AString'
pascalize(string)
// 'AString' -> 'a_string'
depascalize(string)
// Camelize all object keys (recursive),
// optionally modify the object in-place.
camelizeKeys(obj)
camelizeKeysInPlace(obj)
// De-camelize all object keys (recursive),
// optionally modify the object in-place.
decamelizeKeys(obj)
decamelizeKeysInPlace(obj)
// Pascalize all object keys (recursive),
// optionally modify the object in-place.
pascalizeKeys(obj)
pascalizeKeysInPlace(obj)
// De-pascalize all object keys (recursive),
// optionally modify the object in-place.
depascalizeKeys(obj)
depascalizeKeysInPlace(obj)
Run yarn benchmark
to benchmark locally. Informal benchmark results, from my MacBook:
xcase#camelize x 5,911,187 ops/sec ±5.42% (76 runs sampled)
fastCase#camelize x 7,555,230 ops/sec ±2.79% (79 runs sampled)
humps#camelize x 903,206 ops/sec ±2.09% (82 runs sampled)
Fastest is fastCase#camelize
xcase#decamelize x 6,522,038 ops/sec ±2.99% (79 runs sampled)
fastCase#decamelize x 7,020,373 ops/sec ±1.69% (78 runs sampled)
humps#decamelize x 1,647,107 ops/sec ±2.75% (77 runs sampled)
Fastest is fastCase#decamelize
xcase#pascalize x 6,715,499 ops/sec ±1.78% (82 runs sampled)
fastCase#pascalize x 8,204,444 ops/sec ±1.98% (82 runs sampled)
humps#pascalize x 793,728 ops/sec ±2.06% (79 runs sampled)
Fastest is fastCase#pascalize
xcase#depascalize x 6,989,851 ops/sec ±1.85% (79 runs sampled)
fastCase#depascalize x 7,138,850 ops/sec ±1.47% (77 runs sampled)
humps#depascalize x 1,502,335 ops/sec ±2.46% (81 runs sampled)
Fastest is fastCase#depascalize
xcase#camelizeKeys x 608,665 ops/sec ±1.51% (76 runs sampled)
xcase#camelizeKeys (in place) x 658,691 ops/sec ±2.33% (76 runs sampled)
fastCase#camelizeKeys x 618,604 ops/sec ±1.72% (78 runs sampled)
fastCase#camelizeKeysInPlace (in place) x 639,410 ops/sec ±2.45% (74 runs sampled)
humps#camelizeKeys x 237,910 ops/sec ±2.28% (77 runs sampled)
Fastest is xcase#camelizeKeys (in place)
xcase#decamelizeKeys x 614,568 ops/sec ±3.27% (79 runs sampled)
fastCase#decamelizeKeys x 554,890 ops/sec ±2.23% (80 runs sampled)
humps#decamelizeKeys x 220,343 ops/sec ±2.01% (76 runs sampled)
Fastest is xcase#decamelizeKeys
xcase#camelizeKeys (large object) x 633 ops/sec ±1.90% (77 runs sampled)
xcase#camelizeKeys (in place) (large object) x 520 ops/sec ±4.37% (74 runs sampled)
fastCase#camelizeKeys (large object) x 654 ops/sec ±1.64% (77 runs sampled)
fastCase#camelizeKeysInPlace (in place) (large object) x 781 ops/sec ±1.40% (76 runs sampled)
humps#camelizeKeys (large object) x 256 ops/sec ±1.98% (74 runs sampled)
Fastest is fastCase#camelizeKeysInPlace (in place) (large object)
xcase#pascalizeKeys (large object) x 403 ops/sec ±3.47% (76 runs sampled)
xcase#pascalizeKeys (in place) (large object) x 815 ops/sec ±1.95% (83 runs sampled)
fastCase#pascalizeKeys (large object) x 1,002 ops/sec ±2.58% (81 runs sampled)
fastCase#pascalizeKeysInPlace (in place) (large object) x 1,105 ops/sec ±1.64% (82 runs sampled)
humps#pascalizeKeys (large object) x 234 ops/sec ±1.53% (77 runs sampled)
Fastest is fastCase#pascalizeKeysInPlace (in place) (large object)
This module is based in part on an older C++ based version of xcase
.
MIT license, see LICENSE
. Copyright 2018 Jacob Gillespie. Code originally from xcase, copyright 2016 Code Charm.
v1.3.0
FAQs
A fast JS library for camelCase and PascalCase
The npm package fast-case receives a total of 5,176 weekly downloads. As such, fast-case popularity was classified as popular.
We found that fast-case demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.