File tree Expand file tree Collapse file tree 4 files changed +7
-8
lines changed Expand file tree Collapse file tree 4 files changed +7
-8
lines changed Original file line number Diff line number Diff line change 11{
22 "name" : " node-rsa" ,
3- "version" : " 0.3.1 " ,
3+ "version" : " 0.3.2 " ,
44 "description" : " Node.js RSA library" ,
55 "main" : " src/NodeRSA.js" ,
66 "scripts" : {
Original file line number Diff line number Diff line change @@ -185,7 +185,7 @@ module.exports = (function () {
185185
186186 /**
187187 * Exporting key
188- * @param format {string}
188+ * @param [ format] {string}
189189 */
190190 NodeRSA . prototype . exportKey = function ( format ) {
191191 format = format || DEFAULT_EXPORT_FORMAT ;
Original file line number Diff line number Diff line change @@ -114,7 +114,7 @@ module.exports.makeScheme = function (key, options) {
114114
115115 Scheme . prototype . sign = function ( buffer ) {
116116 var hashAlgorithm = this . options . signingSchemeOptions . hash || DEFAULT_HASH_FUNCTION ;
117- if ( this . options . environment == 'browser' ) {
117+ if ( this . options . environment === 'browser' ) {
118118 hashAlgorithm = SIGN_ALG_TO_HASH_ALIASES [ hashAlgorithm ] || hashAlgorithm ;
119119
120120 var hasher = crypt . createHash ( hashAlgorithm ) ;
@@ -132,7 +132,7 @@ module.exports.makeScheme = function (key, options) {
132132
133133 Scheme . prototype . verify = function ( buffer , signature , signature_encoding ) {
134134 var hashAlgorithm = this . options . signingSchemeOptions . hash || DEFAULT_HASH_FUNCTION ;
135- if ( this . options . environment == 'browser' ) {
135+ if ( this . options . environment === 'browser' ) {
136136 hashAlgorithm = SIGN_ALG_TO_HASH_ALIASES [ hashAlgorithm ] || hashAlgorithm ;
137137
138138 if ( signature_encoding ) {
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ var crypt = require('crypto');
1212 * @returns {string }
1313 */
1414module . exports . linebrk = function ( str , maxLen ) {
15- var res = "" ;
15+ var res = '' ;
1616 var i = 0 ;
1717 while ( i + maxLen < str . length ) {
1818 res += str . substring ( i , i + maxLen ) + "\n" ;
@@ -22,11 +22,10 @@ module.exports.linebrk = function (str, maxLen) {
2222} ;
2323
2424module . exports . detectEnvironment = function ( ) {
25- if ( process && process . title != 'browser' ) {
26- return 'node' ;
27- } else if ( typeof ( window ) !== 'undefined' && window ) {
25+ if ( process && process . title === 'browser' || ( typeof ( window ) !== 'undefined' && window ) ) {
2826 return 'browser' ;
2927 }
28+
3029 return 'node' ;
3130} ;
3231
You can’t perform that action at this time.
0 commit comments