added toObject function to memory module

This commit is contained in:
Philipp Kunz 2016-04-07 23:38:24 +02:00
parent 287c2fa99f
commit a787836e56
2 changed files with 27 additions and 3 deletions

File diff suppressed because one or more lines are too long

View File

@ -1,9 +1,11 @@
/// <reference path="./typings/main.d.ts" /> /// <reference path="./typings/main.d.ts" />
import plugins = require("./smartfile.plugins"); import plugins = require("./smartfile.plugins");
import SmartfileInterpreter = require("./smartfile.interpreter");
let Readable = require("stream").Readable; let Readable = require("stream").Readable;
/** /**
* allows you to create a gulp stream from filestring * allows you to create a gulp stream
* from String, from an Array of Strings, from Vinyl File, from an Array of VinylFiles
* @param fileArg * @param fileArg
* @returns stream.Readable * @returns stream.Readable
* @TODO: make it async; * @TODO: make it async;
@ -37,6 +39,16 @@ export let toGulpStream = function(fileArg:string|string[]|plugins.vinyl|plugins
return stream; return stream;
}; };
/**
*
* @param fileStringArg
* @param fileTypeArg
* @returns {any|any}
*/
export let toObject = function(fileStringArg:string,fileTypeArg:string){
return SmartfileInterpreter(fileStringArg,fileTypeArg);
};
/** /**
* takes a string and converts it to vinyl file * takes a string and converts it to vinyl file
* @param fileArg * @param fileArg
@ -69,6 +81,7 @@ export let toVinylArraySync = function(arrayArg:string[],optionsArg?:{filename?:
return vinylArray; return vinylArray;
}; };
/** /**
* takes a vinylFile object and converts it to String * takes a vinylFile object and converts it to String
*/ */