Comparing version 1.0.0 to 1.0.1
18
index.js
@@ -9,2 +9,3 @@ "use strict"; | ||
let prefix = ''; | ||
let getDestinationPath = ''; | ||
if (typeof item == 'string') { | ||
@@ -15,6 +16,8 @@ root = item; | ||
prefix = item.prefix || ''; | ||
getDestinationPath = item.getDestinationPath | ||
} | ||
return { | ||
root: root, | ||
prefix: prefix | ||
prefix: prefix, | ||
getDestinationPath: getDestinationPath | ||
} | ||
@@ -50,14 +53,16 @@ } | ||
if (this.MAP[basePath]) { | ||
let { root, prefix } = this.MAP[basePath]; | ||
let { root, prefix, getDestinationPath } = this.MAP[basePath]; | ||
return { | ||
path: root + '/' + filePath, | ||
prefix: prefix | ||
prefix: prefix, | ||
getDestinationPath: getDestinationPath | ||
} | ||
} | ||
for (let i=0; i < _dirList.length; i++) { | ||
let { root, prefix } = getRootAndPrefix(_dirList[i]); | ||
let { root, prefix, getDestinationPath } = getRootAndPrefix(_dirList[i]); | ||
if (basePath == root) { | ||
return { | ||
path: root + '/' + filePath, | ||
prefix: prefix | ||
prefix: prefix, | ||
getDestinationPath: getDestinationPath | ||
} | ||
@@ -69,3 +74,4 @@ } | ||
path: fullPath, | ||
prefix: prefix | ||
prefix: prefix, | ||
getDestinationPath: getDestinationPath | ||
}; | ||
@@ -72,0 +78,0 @@ } |
{ | ||
"name": "fs-merger", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Reads files from a real location", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -1,2 +0,3 @@ | ||
##Usage | ||
## Usage | ||
```js | ||
@@ -21,4 +22,3 @@ let FSMerge = require('fs-merger'); | ||
let content = fs.readFileSync('b.txt); //content of test-1/b.txt | ||
let conetntB = fs.readFileSync('a.txt') // content of test-3/a.txt; here we merge left to right, duplicate files are overwritten | ||
let contentA = fs.readFileSync('a.txt') // content of test-3/a.txt; here we merge left to right, duplicate files are overwritten | ||
``` | ||
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
9862
261