Skip to content

Commit

Permalink
minor fix for getFile
Browse files Browse the repository at this point in the history
- add the fileExtensions when a filename was submitted without
 a file extensions
bump version to 4.4.0
  • Loading branch information
larsdecker committed Jan 10, 2019
1 parent 10af158 commit 2082002
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 10 deletions.
18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,22 @@
"mongo",
"async"
],
"version": "4.3.0",
"version": "4.4.0",
"devDependencies": {
"@types/chai": "^4.1.5",
"@types/chai": "^4.1.7",
"@types/mocha": "^5.2.5",
"@types/mongodb": "^3.1.7",
"@types/node": "^10.10.1",
"chai": "^4.1.2",
"@types/mongodb": "^3.1.18",
"@types/node": "^10.12.18",
"chai": "^4.2.0",
"jsdoc": "^3.5.5",
"mocha": "^5.2.0",
"ts-node": "^7.0.1",
"tsd-jsdoc": "^2.0.0-beta.6",
"tslint": "^5.11.0",
"typescript": "^3.0.3"
"tsd-jsdoc": "^2.1.1",
"tslint": "^5.12.0",
"typescript": "^3.2.2"
},
"dependencies": {
"es6-promise": "^4.2.5",
"mongodb": "^3.1.6"
"mongodb": "^3.1.10"
}
}
6 changes: 6 additions & 0 deletions src/GridFSPromise.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/GridFSPromise.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions src/GridFSPromise.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {ObjectID} from "bson";
import * as fs from "fs";
import {GridFSBucket, GridFSBucketReadStream, MongoClient, MongoClientOptions} from "mongodb";
import * as path from "path";

export interface IGridFSObject {
_id: ObjectID;
Expand Down Expand Up @@ -124,6 +125,10 @@ export class GridFSPromise {

if (!fileName) {
fileName = result[0].filename;
} else {
if (path.extname(fileName) === "") {
fileName = fileName.concat(path.extname(result[0].filename));
}
}

if (!filePath) {
Expand Down

0 comments on commit 2082002

Please sign in to comment.