1.4.0 • Published 3 years ago

quick-seek v1.4.0

Weekly downloads
20
License
MIT
Repository
-
Last release
3 years ago

Quick Seek

Quick object property resolution. Seek path supports string, array, or number. No type of property checks.

Example

import seek from 'quick-seek';

let x = {
	y: {
		z: 20
	},
	yy: [1, 2]
};

console.log(get(x, 'y')); // returns y: { z: 20 }

console.log(set(x, 'key', 'value')); // x.key = value | returns x

console.log(get(x, 'y.z')); // returns 20

console.log(set(x, ['y', 'z'], true)); // x.y.z = true | returns x.y

console.log(get(x, 'yy.0')); // returns 1

console.log(get(x, ['yy', '1'])); // returns 2

console.log(set(x, 'y.yy.yyy', 'z')); // x.y.yy.yyy = z (will populate empty objects) | returns y.yy.yyy

Contributing

Feel free to make changes and submit pull requests whenever.

License

Quick Seek uses the MIT license.

1.4.0

3 years ago

1.3.0

3 years ago

1.2.7

3 years ago

1.2.6

3 years ago

1.2.5

3 years ago

1.2.4

3 years ago

1.2.3

3 years ago

1.2.2

3 years ago

1.2.1

3 years ago

1.2.0

3 years ago

1.1.4

4 years ago

1.1.3

4 years ago

1.1.2

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago