now exposing home

This commit is contained in:
2016-04-04 16:25:17 +02:00
parent fb62b0aac7
commit 209ff095a4
8 changed files with 51 additions and 8 deletions

View File

@ -1,6 +1,9 @@
/// <reference path="typings/main.d.ts" />
import plugins = require("./smartpath.plugins");
/**
* returns the type of the given path. Can be "url" or "local"
*/
export let type = function(pathStringArg:string):string {
let urlRegex = /http[s|\s]:\/\/.*/i
if(urlRegex.exec(pathStringArg)){
@ -8,4 +11,12 @@ export let type = function(pathStringArg:string):string {
} else {
return "local";
};
};
export let home = function(pathArgument?:string){
if(pathArgument){
return plugins.home.resolve(pathArgument);
} else {
return plugins.home();
}
};

View File

@ -1,3 +1,5 @@
/// <reference path="./typings/main.d.ts" />
export var beautylog = require ("beautylog");
export var path = require("path");
export var home = require("home");
export var path = require("path");