Skip to content

Commit 653bfb5

Browse files
committed
fix(params): properly order params (fixes mgcrea#15)
1 parent 973620c commit 653bfb5

File tree

4 files changed

+8
-9
lines changed

4 files changed

+8
-9
lines changed

.eslintrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"extends": "airbnb/base",
2+
"extends": "airbnb-base",
33
"parser": "babel-eslint",
44
"rules": {
55
"object-curly-spacing": [2, "never"],

package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,10 @@
2525
"babel-plugin-transform-object-rest-spread": "^6.8.0",
2626
"babel-preset-es2015": "^6.9.0",
2727
"babel-register": "^6.9.0",
28-
"codeclimate-test-reporter": "^0.3.1",
28+
"codeclimate-test-reporter": "^0.3.2",
2929
"eslint": "^2.11.1",
30-
"eslint-config-airbnb": "^9.0.1",
30+
"eslint-config-airbnb-base": "^3.0.1",
3131
"eslint-plugin-import": "^1.8.1",
32-
"eslint-plugin-jsx-a11y": "^1.2.2",
3332
"expect": "^1.20.1",
3433
"mocha": "^2.5.3",
3534
"nyc": "^6.4.4",

src/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export default function exec(action, maybeBuffer, maybeOptions, maybeCallback) {
3030
}
3131

3232
// Build initial params with passed action
33-
const params = action.split('.').map((value, key) => (!key ? value : `-${value}`));
33+
let params = action.split('.').map((value, key) => (!key ? value : `-${value}`));
3434
const lastParams = [];
3535
Object.keys(options).forEach(key => {
3636
if (options[key] === false) {
@@ -47,8 +47,8 @@ export default function exec(action, maybeBuffer, maybeOptions, maybeCallback) {
4747
}
4848
}
4949
});
50-
51-
params.concat(lastParams);
50+
// Append last params
51+
params = params.concat(lastParams);
5252

5353
// Actually spawn openssl command
5454
const openssl = spawn('openssl', params);

test/index.spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ describe('openssl-wrapper', () => {
1515
done();
1616
});
1717
});
18-
it('should support cms.verify action', (done) => {
18+
it('should support smime.verify action', (done) => {
1919
const buffer = fs.readFileSync(`${__dirname}/fixtures/signed.mobileprovision`);
20-
opensslWrapper('cms.verify', buffer, {inform: 'DER', noverify: true}, (err, obj) => {
20+
opensslWrapper('smime.verify', buffer, {inform: 'DER', noverify: true}, (err, obj) => {
2121
expect(err).toBe(null);
2222
expect(obj).toBeA(Buffer);
2323
done();

0 commit comments

Comments
 (0)