Releases: devchris/jsdig
Releases · devchris/jsdig
Security patch
Returns object itself if no digest values are provided
const testObject = {
other: {
name: 'Christoph'
}
};
testObject.dig() === testObject;Thank you @xtr3me 🎉
Adds a default return option
If it can't find the value, it will return null by default. However, you can now also pass in a default value of what should be returned if it isn't found.
const world = {
locations: [{
europe: 'Bamberg',
}, {
usa: 'Indianapolis'
}]
};world.dig('locations', 0, 'europe', 'germany', { default: [] });
// => []world.dig('locations', 0, 'europe', 'germany', { default: 'not found' });
// => 'not found'world.dig('locations', 0, 'europe', 'germany', { default: '' });
// => ''Performance update and reduced build size
Performance update and reduced build size, also added more tests
0.1.2
Jsdig
Bugfix
.dig as Object.prototype function
This will break all previous Versions!
Given the following object:
const obj = {
number: 1
}
use obj.dig('number') now instead of Dig(obj, 'number')
jsdig based on ruby's hash#dig
0.0.1 Creates jsdig based on ruby's hash#dig