lib/config/config-file.js
function write(config, filePath) {
    switch (path.extname(filePath)) {
        case ".js":
            writeJSConfigFile(config, filePath);
            break;

        case ".json":
            writeJSONConfigFile(config, filePath);
            break;

        case ".yaml":
        case ".yml":
            writeYAMLConfigFile(config, filePath);
            break;

        default:
            throw new Error("Can't write to unknown file type.");
    }
}
function write(config, filePath) {
    switch (path.extname(filePath)) {
        case ".js":
            writeJSConfigFile(config, filePath);
            break;

        case ".json":
            writeJSONConfigFile(config, filePath);
            break;

        case ".yaml":
        case ".yml":
            writeYAMLConfigFile(config, filePath);
            break;

        default:
            throw new Error("Can't write to unknown file type.");
    }
}
function write ( config , filePath ) { switch ( path . extname ( filePath ) ) { case ".js" : writeJSConfigFile ( config , filePath ) ; break ; case ".json" : writeJSONConfigFile ( config , filePath ) ; break ; case ".yaml" : case ".yml" : writeYAMLConfigFile ( config , filePath ) ; break ; default : throw new Error ( "Can't write to unknown file type." ) ; } }
Writes a configuration file.
@param {Object} config The configuration object to write.
@param {string} filePath The filename to write to.
@returns {void}
@throws {Error} When an unknown file type is specified.
@private
Writes a configuration file .