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

100% Statements 5/5
100% Branches 4/4
100% Functions 1/1
100% Lines 5/5

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13

    1×
    97×
    10×

    97×

    1×
     /**
     * Checks to see if a field path matches a currently unmapped path, and
     * if so, adds a mapping for it.
     */
    function automap (field) {
    	if ((field.path in this.mappings) && !this.mappings[field.path]) {
    		this.map(field.path, field.path);
    	}
    	return this;
    }

    module.exports = automap;