Move internal modules to “internal” folder.

This commit is contained in:
John-David Dalton
2017-01-10 00:44:25 -08:00
parent 2b05673125
commit 26ea38dcf4
500 changed files with 726 additions and 726 deletions

View File

@@ -0,0 +1,30 @@
import baseToPairs from './.internal/baseToPairs.js';
import getTag from './.internal/getTag.js';
import mapToArray from './.internal/mapToArray.js';
import setToPairs from './.internal/setToPairs.js';
/** `Object#toString` result references. */
const mapTag = '[object Map]';
const setTag = '[object Set]';
/**
* Creates a `toPairs` or `toPairsIn` function.
*
* @private
* @param {Function} keysFunc The function to get the keys of a given object.
* @returns {Function} Returns the new pairs function.
*/
function createToPairs(keysFunc) {
return object => {
const tag = getTag(object);
if (tag == mapTag) {
return mapToArray(object);
}
if (tag == setTag) {
return setToPairs(object);
}
return baseToPairs(object, keysFunc(object));
};
}
export default createToPairs;