Skip to content

Commit

Permalink
Add options param to Library func with option to disable appending on…
Browse files Browse the repository at this point in the history
… library extension

fixes #257
  • Loading branch information
benhutchins committed Feb 21, 2017
1 parent 67aa2c3 commit 0044546
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions lib/library.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,21 @@ var EXT = Library.EXT = {
* ForeignFunction.
*/

function Library (libfile, funcs, lib) {
function Library (libfile, funcs, lib, options) {
debug('creating Library object for', libfile)

if (!options) {
options = {}
}
options.appendExtension = typeof options.appendExtension === 'boolean' ? options.appendExtension : true

if (libfile && libfile.indexOf(EXT) === -1) {
debug('appending library extension to library name', EXT)
libfile += EXT
if (options.appendExtension) {
debug('appending library extension to library name', EXT)
libfile += EXT
} else {
deug('appending of library extension has been disabled')
}
}

if (!lib) {
Expand Down

0 comments on commit 0044546

Please sign in to comment.