Skip to content

Commit 0d8908a

Browse files
committed
Change line 47 for correctness
MyCustomStorage constructor had an attribution to opts object, which was absolutely wrong, since we would like to access getDestination as a method of MyCustomStorage in line 51. Hence the right statement is assigning the value to 'this' which represents the object itself.
1 parent 79e2c47 commit 0d8908a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

StorageEngine.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ function getDestination (req, file, cb) {
4444
}
4545

4646
function MyCustomStorage (opts) {
47-
opts.getDestination = (opts.destination || getDestination)
47+
this.getDestination = (opts.destination || getDestination)
4848
}
4949

5050
MyCustomStorage.prototype._handleFile = function _handleFile (req, file, cb) {

0 commit comments

Comments
 (0)