2016-05-23 06:15:47 +00:00
|
|
|
import "typings-global";
|
2016-03-20 16:36:38 +00:00
|
|
|
|
|
|
|
import plugins = require("./smartfile.plugins");
|
|
|
|
|
|
|
|
export = function(fileStringArg:string, fileTypeArg){
|
|
|
|
switch (fileTypeArg) {
|
|
|
|
case "yml" :
|
|
|
|
case "yaml":
|
|
|
|
return plugins.yaml.safeLoad(fileStringArg);
|
|
|
|
case "json":
|
|
|
|
return JSON.parse(fileStringArg);
|
|
|
|
default:
|
|
|
|
plugins.beautylog.error("file type " + fileTypeArg.blue + " not supported");
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|