fs-chunk-store
Advanced tools
Comparing version 3.0.0 to 3.0.1
@@ -0,1 +1,8 @@ | ||
## [3.0.1](https://github.com/webtorrent/fs-chunk-store/compare/v3.0.0...v3.0.1) (2022-07-03) | ||
### Bug Fixes | ||
* don't mutate original path ([#37](https://github.com/webtorrent/fs-chunk-store/issues/37)) ([726cbb5](https://github.com/webtorrent/fs-chunk-store/commit/726cbb5bbd0f3e60c6c2f3f8e3b100d20727f815)) | ||
# [3.0.0](https://github.com/webtorrent/fs-chunk-store/compare/v2.0.5...v3.0.0) (2022-03-30) | ||
@@ -2,0 +9,0 @@ |
@@ -35,3 +35,3 @@ /*! fs-chunk-store. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */ | ||
} | ||
self.files = opts.files.slice(0).map(function (file, i, files) { | ||
self.files = opts.files.map(function (file, i, files) { | ||
if (file.path == null) throw new Error('File is missing `path` property') | ||
@@ -47,6 +47,7 @@ if (file.length == null) throw new Error('File is missing `length` property') | ||
} | ||
let newPath = file.path | ||
if (self.path) { | ||
file.path = self.addUID ? path.resolve(path.join(self.path, self.name, file.path)) : path.resolve(path.join(self.path, file.path)) | ||
newPath = self.addUID ? path.resolve(path.join(self.path, self.name, file.path)) : path.resolve(path.join(self.path, file.path)) | ||
} | ||
return file | ||
return { path: newPath, length: file.length, offset: file.offset } | ||
}) | ||
@@ -53,0 +54,0 @@ self.length = self.files.reduce(function (sum, file) { return sum + file.length }, 0) |
{ | ||
"name": "fs-chunk-store", | ||
"description": "Filesystem (fs) chunk store that is abstract-chunk-store compliant", | ||
"version": "3.0.0", | ||
"version": "3.0.1", | ||
"author": { | ||
@@ -25,3 +25,3 @@ "name": "Feross Aboukhadijeh", | ||
"standard": "*", | ||
"tape": "5.5.2" | ||
"tape": "5.5.3" | ||
}, | ||
@@ -28,0 +28,0 @@ "homepage": "https://github.com/webtorrent/fs-chunk-store", |
14274
221