now exposing home
This commit is contained in:
@ -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();
|
||||
}
|
||||
};
|
@ -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");
|
||||
|
||||
|
Reference in New Issue
Block a user