Skip to content

Commit

Permalink
Generate enum-to-string converter for (almost) all enums
Browse files Browse the repository at this point in the history
  • Loading branch information
intrueder committed May 1, 2021
1 parent 37dce6a commit 2c21a0e
Show file tree
Hide file tree
Showing 9 changed files with 184 additions and 956 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ for (let i = 0; i < n; ++i) {
Object.keys(sdk.CorsairDevicePropertyId).forEach(p => {
const prop = sdk.CorsairGetDeviceProperty(i, sdk.CorsairDevicePropertyId[p]);
if (!prop) {
console.log(p, ':', sdk.CorsairErrorString[sdk.CorsairGetLastError()]);
console.log(p, ':', sdk.CorsairErrorToString(sdk.CorsairGetLastError()));
} else {
console.log(p, prop.value);
}
Expand Down
4 changes: 3 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
const binding = require('node-gyp-build')(__dirname)
const enums = require('./src/enums');
const converters = require('./src/converters')

const sdk = {
...enums,
...binding
...converters,
...binding,
};

module.exports = sdk;
Loading

0 comments on commit 2c21a0e

Please sign in to comment.