added check module
This commit is contained in:
@ -1,16 +1,17 @@
|
||||
/// <reference path="typings/main.d.ts" />
|
||||
import plugins = require("./smartpath.plugins");
|
||||
import SmartpathTransform = require("./smartpath.transform");
|
||||
import SmartpathCheck = require("./smartpath.check");
|
||||
import SmartpathGet = require("./smartpath.get");
|
||||
import SmartpathTransform = require("./smartpath.transform");
|
||||
|
||||
/**
|
||||
*
|
||||
* @type {{getPath: (function(any): undefined)}}
|
||||
*/
|
||||
let smartpath = {
|
||||
transform: SmartpathTransform,
|
||||
get: SmartpathGet
|
||||
|
||||
check: SmartpathCheck,
|
||||
get: SmartpathGet,
|
||||
transform: SmartpathTransform
|
||||
};
|
||||
|
||||
|
||||
|
9
ts/smartpath.check.ts
Normal file
9
ts/smartpath.check.ts
Normal file
@ -0,0 +1,9 @@
|
||||
import plugins = require("./smartpath.plugins");
|
||||
|
||||
export let isDir = function(pathArg:string){
|
||||
return !isFile(pathArg);
|
||||
}
|
||||
|
||||
export let isFile = function(pathArg){
|
||||
return /\.[a-zA-Z]*$/.test(pathArg); // checks if there is a .anything at the end
|
||||
}
|
Reference in New Issue
Block a user