tests: datalayout
This commit is contained in:
@@ -6,6 +6,7 @@ const assert = require('assert'),
|
||||
class DataLayout {
|
||||
constructor(localRoot, dirMap) {
|
||||
assert.strictEqual(typeof localRoot, 'string');
|
||||
assert(path.isAbsolute(localRoot));
|
||||
assert(Array.isArray(dirMap), 'Expecting layout to be an array');
|
||||
|
||||
this._localRoot = localRoot;
|
||||
@@ -13,6 +14,7 @@ class DataLayout {
|
||||
this._remoteRegexps = dirMap.map((l) => new RegExp('^\\./' + l.remoteDir + '/?'));
|
||||
this._localRegexps = dirMap.map((l) => new RegExp('^' + l.localDir + '/?'));
|
||||
}
|
||||
// returns absolute path
|
||||
toLocalPath(remoteName) {
|
||||
assert.strictEqual(typeof remoteName, 'string');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user