Press n or j to go to the next uncovered block, b, p or k for the previous block.
1 2 3 4 5 6 7 8 9 10 11 12 13 | 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x | const pathToArrayTransformer = require('./src/pathToArrayTransformer.js'); const pathValidator = require('./src/pathValidator.js'); /** * Transforms string representation of path into workable array representation * @param {any} path - either already transformed path, or string representation of path * @param {Object} funcs - object with functions provided by the user that may be part of the query * @returns {Array} - array representation of path */ const pathTransformer = (path, funcs) => (typeof path === 'string' ? pathToArrayTransformer(path, funcs) : pathValidator(path)); module.exports = pathTransformer; |