fast-camelcase-css
v0.1.1
Published
The fast version of stevenvachon/camelcase-css
Readme
fast-camelcase-css
The fast version of stevenvachon/camelcase-css.
Install
$ npm install fast-camelcase-cssUsage
import fastCamelCaseCss from "fast-camelcase-css";
fastCamelCaseCss("-webkit-border-radius"); //-> WebkitBorderRadius
fastCamelCaseCss("-moz-border-radius"); //-> MozBorderRadius
fastCamelCaseCss("-ms-border-radius"); //-> msBorderRadius
fastCamelCaseCss("border-radius"); //-> borderRadiusAPI
fastCamelCaseCss(property)
Return: string
Convert a kebab-cased CSS property into a camel-cased DOM property.
property
Type: string
Benchmark
You can try to benchmark it yourself. But in my device, this is the result i get.
This is using color property for benchmarking.
camelcase-css x 1,020,275 ops/sec ±1.08% (62 runs sampled)
fast-camelcase-css x 3,955,652 ops/sec ±2.07% (65 runs sampled)
Fastest is fast-camelcase-css