npm.io
1.0.1 • Published 7 years ago

insensitive

Licence
MIT
Version
1.0.1
Deps
0
Size
7 kB
Vulns
0
Weekly
0
Stars
1

insensitive

Make sure anything you are working with becomes lowercase alphanumeric characters:

import insensitive from 'insensitive';

const obj = insensitive();
console.log(obj.hello);  // undefined
obj.heL_Lo = 'world';
console.log(obj.hello);  // 'world'
obj.hello = 'bye';
console.log(obj.hello);  // 'bye'

for (let key in obj) {
  console.log(key);  // 'hello'
}
Object.keys(obj); // ['hello']