# all files / api/transformers/ feature-transformer.js

100% Statements 13/13
100% Branches 4/4
100% Functions 2/2
100% Lines 5/5
1 branch Ignored

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

    1

    1

    1
    1

     'use strict';

    // Utilities:
    import Promise from 'bluebird';

    export default function featureTransformer (file, options) {
        let { oldName, newName } = options;
        let oldNameRegExp = new RegExp(`(Feature:\\s)${oldName}(\\r\\n|\\n)`);

        file.content = file.content.replace(oldNameRegExp, `$1${newName}$2`);
        return Promise.resolve();
    }