now differentiating between URL and FilePath

This commit is contained in:
Philipp Kunz 2016-03-26 12:07:17 +01:00
parent 202914b19b
commit 451e2e241f
4 changed files with 6 additions and 5 deletions

View File

@ -15,7 +15,7 @@
"jade", "jade",
"template" "template"
], ],
"author": "Smart Coordination GmbH <office@push.rocks> (https://push.rocks)", "author": "Lossless GmbH <office@lossless.com> (https://lossless.com)",
"license": "MIT", "license": "MIT",
"bugs": { "bugs": {
"url": "https://github.com/pushrocks/smartpath/issues" "url": "https://github.com/pushrocks/smartpath/issues"

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
{"version":3,"file":"test.js","sourceRoot":"","sources":["test.ts"],"names":[],"mappings":"AAAA,gDAAgD;AAChD,IAAI,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;AAC/B,IAAI,SAAS,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;AAE5C,QAAQ,CAAC,WAAW,EAAC;IACjB,QAAQ,CAAC,YAAY,EAAC;QAClB,QAAQ,CAAC,cAAc,EAAC;YACpB,IAAI,UAAU,GAAG,UAAU,CAAC;YAC5B,IAAI,cAAc,GAAG,sBAAsB,CAAC;YAC5C,IAAI,eAAe,GAAG,4BAA4B,CAAC;YACnD,IAAI,aAAa,GAAG,CAAC,cAAc,EAAC,cAAc,EAAC,eAAe,CAAC,CAAC;YACpE,EAAE,CAAC,+BAA+B,EAAC;gBAC/B,SAAS,CAAC,SAAS,CAAC,UAAU,CAAC,cAAc,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;gBACrE,SAAS,CAAC,SAAS,CAAC,UAAU,CAAC,cAAc,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC;gBAC9E,SAAS,CAAC,SAAS,CAAC,UAAU,CAAC,cAAc,EAAC,UAAU,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,+BAA+B,CAAC,CAAC;YAC5G,CAAC,CAAC,CAAC;YACH,EAAE,CAAC,uEA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AAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;IACH,QAAQ,CAAC,MAAM,EAAC;QACZ,QAAQ,CAAC,SAAS,EAAC;YACf,EAAE,CAAC,gCAAgC,EAAC;gBAChC,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,6BAA6B,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;gBACtE,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,6BAA6B,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;YAChF,CAAC,CAAC,CAAC;YACH,EAAE,CAAC,iCAAiC,EAAC;gBACjC,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;gBACjE,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,uBAAuB,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;YACxE,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}

View File

@ -15,7 +15,7 @@ describe("smartpath",function(){
smartpath.transform.toAbsolute(relativeString,baseString).should.equal("/basedir/somedir/somefile.txt"); smartpath.transform.toAbsolute(relativeString,baseString).should.equal("/basedir/somedir/somefile.txt");
}); });
it("should make an array of relative Strings an Array of absolute Strings",function(){ it("should make an array of relative Strings an Array of absolute Strings",function(){
let absoluteArray = smartpath.transform.toAbsolute(relativeArray); let absoluteArray = smartpath.transform.toAbsolute(relativeArray,baseString);
absoluteArray[2].should.startWith("/"); absoluteArray[2].should.startWith("/");
absoluteArray[2].should.endWith(relativeString2); absoluteArray[2].should.endWith(relativeString2);