Skip to content

prokopschield/uncased

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

uncased

Case-insensitive Map

Use it just like any other Map.

Its keys can are case-insensitive strings.

Its values can be strings and/or Uncased maps.

Type coercion is automatic, however, Symbols will not work.

No dependencies.

Installation: yarn add uncased

Bonus!

const uMap = require('uncased');
const map = new uMap();
map.set('FOO', 'bar');
const obj = map.obj;
obj.foo; // bar
obj.Foo; // bar
obj.FiZz = 'buzz'; // buzz
obj.fizz; // buzz
map.get('fiZZ'); // buzz
map.add({ a: { b: { c: { d: 'e' } } } });
map.obj.a.obj.b.obj.c.obj.d; // e

map.obj returns a Proxy object, which you can use instead of the map!

map.str returns a Proxy object, which only gives you strings.

Free to use, under GNU GPL. See License.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published