16 lines
475 B
TypeScript
16 lines
475 B
TypeScript
|
/// <reference path="./typings/main.d.ts" />
|
||
|
|
||
|
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;
|
||
|
}
|
||
|
}
|