index.js
function _extract(keyStr, dataObj) {
	var altkey,
		_subKey,
		_splitPoint,
		_found = false,
		dataValue = null,
		_queryParts = [];

	if (dataObj && typeof dataObj === 'object') {
		dataValue = Object.create(dataObj);
		_queryParts = keyStr.split(/[\-\_\.]/);

		//console.warn("INIT:", keyStr, _queryParts);

		// test whole query first
		if (keyStr in dataValue) {
			dataValue = dataValue[keyStr];
			_queryParts.length = 0;
			_found = true;
		}

		// search from smallest to largest possible keys
 		while(_queryParts.length) {
			_splitPoint = _queryParts.shift();
			_subKey = keyStr.split(new RegExp('('+_splitPoint+')')).slice(0,2).join("");
			if (_subKey in dataValue) {
				dataValue = dataValue[_subKey];
				keyStr = keyStr.split(new RegExp('('+_subKey+'[\-\_\.])')).slice(2).join("");
				_found = true;
			} else {
				_found = false;
			}
			//console.warn(_found, _subKey, dataValue);
		}

		if (!_found) {
			// alternate support for delimiters in place of spaces as a key
			altkey = keyStr.replace(/[\-\_\.]/,' ');
			if (altkey in dataObj) {
				dataValue = dataObj[altkey];
				_found = true;
			}
		}
	}

	return _found ? dataValue : NaN;
}
function _extract(keyStr, dataObj) {
	var altkey,
		_subKey,
		_splitPoint,
		_found = false,
		dataValue = null,
		_queryParts = [];

	if (dataObj && typeof dataObj === 'object') {
		dataValue = Object.create(dataObj);
		_queryParts = keyStr.split(/[\-\_\.]/);

		//console.warn("INIT:", keyStr, _queryParts);

		// test whole query first
		if (keyStr in dataValue) {
			dataValue = dataValue[keyStr];
			_queryParts.length = 0;
			_found = true;
		}

		// search from smallest to largest possible keys
 		while(_queryParts.length) {
			_splitPoint = _queryParts.shift();
			_subKey = keyStr.split(new RegExp('('+_splitPoint+')')).slice(0,2).join("");
			if (_subKey in dataValue) {
				dataValue = dataValue[_subKey];
				keyStr = keyStr.split(new RegExp('('+_subKey+'[\-\_\.])')).slice(2).join("");
				_found = true;
			} else {
				_found = false;
			}
			//console.warn(_found, _subKey, dataValue);
		}

		if (!_found) {
			// alternate support for delimiters in place of spaces as a key
			altkey = keyStr.replace(/[\-\_\.]/,' ');
			if (altkey in dataObj) {
				dataValue = dataObj[altkey];
				_found = true;
			}
		}
	}

	return _found ? dataValue : NaN;
}
function _extract ( keyStr , dataObj ) { var altkey , _subKey , _splitPoint , _found = false , dataValue = null , _queryParts = [ ] ; if ( dataObj && typeof dataObj === 'object' ) { dataValue = Object . create ( dataObj ) ; _queryParts = keyStr . split ( / [\-\_\.] / ) ; //console.warn("INIT:", keyStr, _queryParts); // test whole query first if ( keyStr in dataValue ) { dataValue = dataValue [ keyStr ] ; _queryParts . length = 0 ; _found = true ; } // search from smallest to largest possible keys while ( _queryParts . length ) { _splitPoint = _queryParts . shift ( ) ; _subKey = keyStr . split ( new RegExp ( '(' + _splitPoint + ')' ) ) . slice ( 0 , 2 ) . join ( "" ) ; if ( _subKey in dataValue ) { dataValue = dataValue [ _subKey ] ; keyStr = keyStr . split ( new RegExp ( '(' + _subKey + '[\-\_\.])' ) ) . slice ( 2 ) . join ( "" ) ; _found = true ; } else { _found = false ; } //console.warn(_found, _subKey, dataValue); } if ( ! _found ) { // alternate support for delimiters in place of spaces as a key altkey = keyStr . replace ( / [\-\_\.] / , ' ' ) ; if ( altkey in dataObj ) { dataValue = dataObj [ altkey ] ; _found = true ; } } } return _found ? dataValue : NaN ; }
key notation value extraction

@param {String} 	keyStr 			The key string, including sub-key notation (i.e. this.prop.key or thing-prop).
@param {Object} 	dataObj 		The data object an array or object.
@returns {Mixed}
key notation value extraction