Skip to content

Commit

Permalink
fix: parseLocal without options
Browse files Browse the repository at this point in the history
`parseLocal` will use defaults for `mimetype` and `replace`
when called without options.
  • Loading branch information
line-o committed Oct 26, 2022
1 parent e10a916 commit f2ed27e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions components/documents.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ function upload (client, contentBuffer) {

function parseLocal (client, handle, filename, options) {
// set default values
const mimeType = getMimeType(filename, options.mimetype)
const replace = options.replace || true
const mimeType = getMimeType(filename, options && options.mimetype ? options.mimetype : null)
const replace = options && options.replace ? options.replace : true

return client.promisedMethodCall('parseLocal', [handle, filename, replace, mimeType])
}
Expand Down
2 changes: 1 addition & 1 deletion spec/tests/resources.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ test('resources:', function (t) {
return db.documents.upload(Buffer.from('1'))
})
.then(function (fh) {
return db.documents.parseLocal(fh, testCollection + '/test.xql', {})
return db.documents.parseLocal(fh, testCollection + '/test.xql')
})
.then(function (r) {
setup.ok(r, 'setup ended')
Expand Down

0 comments on commit f2ed27e

Please sign in to comment.