Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function createSelectorFromSpec(spec) {
if (spec instanceof MapSelectorSpec) {
// eslint-disable-next-line no-underscore-dangle
const parentSelector = createSelectorFromSpec(spec._parent);
return spec.createResultFunc(parentSelector);
}
return createCachedSelector(
spec.dependencies,
spec.resultFunc
)({
keySelector: spec.keySelector,
cacheObject: new FlatMapCache(),
selectorCreator: createSelector, // eslint-disable-line no-use-before-define
});
}