File tree 2 files changed +16
-2
lines changed
2 files changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,15 @@ script: npm run coverage
6
6
after_script : npx codecov
7
7
jobs :
8
8
include :
9
+ - stage : macOS
10
+ os : osx
11
+ script : npm run coverage
12
+ node_js : stable
13
+ - stage : windows
14
+ os : windows
15
+ script : npm run coverage
16
+ node_js : node
9
17
- stage : Lint
10
18
script : npm run lint
11
- node_js : stable
19
+ node_js : node
12
20
after_script : skip
Original file line number Diff line number Diff line change
1
+ const { EOL } = require ( 'os' )
1
2
const keyto = require ( '@trust/keyto' )
2
3
3
4
const errors = require ( '../errors' )
@@ -8,7 +9,12 @@ module.exports.keyObjectToJWK = (keyObject) => {
8
9
const type = keyObject . type === 'private' ? 'pkcs8' : 'spki'
9
10
const format = 'pem'
10
11
11
- const pem = keyObject . export ( { type, format } )
12
+ let pem = keyObject . export ( { type, format } )
13
+
14
+ // keyObject export always uses \n but @trust/keyto splits based on the os.EOL
15
+ if ( EOL !== '\n' ) {
16
+ pem = pem . replace ( / \n / g, EOL )
17
+ }
12
18
13
19
return keyto . from ( pem , 'pem' ) . toJwk ( keyObject . type )
14
20
}
You can’t perform that action at this time.
0 commit comments