forked from sorccu/node-jpeg-turbo
-
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
37 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,38 @@ | ||
var binding = require('cmake-js/bindings')(__dirname, require('./binding-options')) | ||
var binding = require("pkg-prebuilds/bindings")( | ||
__dirname, | ||
require("./binding-options") | ||
); | ||
|
||
// Copy exports so that we can customize them on the JS side without | ||
// overwriting the binding itself. | ||
Object.keys(binding).forEach(function(key) { | ||
module.exports[key] = binding[key] | ||
}) | ||
Object.keys(binding).forEach(function (key) { | ||
module.exports[key] = binding[key]; | ||
}); | ||
|
||
// Convenience wrapper for Buffer slicing. | ||
module.exports.compressSync = function(buffer, optionalOutBuffer, options) { | ||
var out = binding.compressSync(buffer, optionalOutBuffer, options) | ||
return out.data.slice(0, out.size) | ||
} | ||
module.exports.compressSync = function (buffer, optionalOutBuffer, options) { | ||
var out = binding.compressSync(buffer, optionalOutBuffer, options); | ||
return out.data.slice(0, out.size); | ||
}; | ||
|
||
// Convenience wrapper for Buffer slicing. | ||
module.exports.compress = function(a,b,c) { | ||
return binding.compress(a,b,c).then(out => { | ||
return out.data.slice(0, out.size) | ||
}) | ||
} | ||
|
||
module.exports.compress = function (a, b, c) { | ||
return binding.compress(a, b, c).then((out) => { | ||
return out.data.slice(0, out.size); | ||
}); | ||
}; | ||
|
||
// Convenience wrapper for Buffer slicing. | ||
module.exports.decompressSync = function(buffer, optionalOutBuffer, options) { | ||
var out = binding.decompressSync(buffer, optionalOutBuffer, options) | ||
out.data = out.data.slice(0, out.size) | ||
return out | ||
} | ||
module.exports.decompressSync = function (buffer, optionalOutBuffer, options) { | ||
var out = binding.decompressSync(buffer, optionalOutBuffer, options); | ||
out.data = out.data.slice(0, out.size); | ||
return out; | ||
}; | ||
|
||
// Convenience wrapper for Buffer slicing. | ||
module.exports.decompress = function(a,b,c) { | ||
return binding.decompress(a,b,c).then(out => { | ||
out.data = out.data.slice(0, out.size) | ||
return out | ||
}) | ||
} | ||
module.exports.decompress = function (a, b, c) { | ||
return binding.decompress(a, b, c).then((out) => { | ||
out.data = out.data.slice(0, out.size); | ||
return out; | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters