# all files / keystone/lib/list/ expandPaths.js

42.86% Statements 3/7
0% Branches 0/2
0% Functions 0/2
42.86% Lines 3/7

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    161×

    1×

    1×
     var listToArray = require('list-to-array');

    function expandPaths (paths) {
    	return listToArray(paths).map(function (path) {
    		if (path === '__name__') {
    			path = this.mappings.name;
    		}
    		return {
    			path: path,
    			field: this.fields[path],
    		};
    	}, this);
    }

    module.exports = expandPaths;