File tree Expand file tree Collapse file tree 1 file changed +19
-8
lines changed Expand file tree Collapse file tree 1 file changed +19
-8
lines changed Original file line number Diff line number Diff line change 1
- var semver = require ( 'semver' ) ;
2
- if ( semver . satisfies ( process . version , '>= 0.12.0' ) ) {
3
- return ;
1
+ if ( typeof Promise === 'undefined' ) {
2
+ global . Promise = require ( 'bluebird' ) ;
4
3
}
5
4
6
- global . Promise = require ( 'bluebird' ) ;
7
- require ( 'array.prototype.find' ) . shim ( ) ;
8
- require ( 'buffer-compare-shim' ) ;
9
- require ( 'buffer-equals-polyfill' ) ;
10
- require ( 'crypto' ) . createECDH = require ( 'create-ecdh' ) ;
5
+ if ( ! Array . prototype . find ) {
6
+ require ( 'array.prototype.find' ) . shim ( ) ;
7
+ }
8
+
9
+ if ( ! Buffer . prototype . compare || ! Buffer . compare ) {
10
+ require ( 'buffer-compare-shim' ) ;
11
+ }
12
+
13
+ if ( ! Buffer . prototype . equals ) {
14
+ require ( 'buffer-equals-polyfill' ) ;
15
+ }
16
+
17
+ var crypto = require ( 'crypto' ) ;
18
+
19
+ if ( ! crypto . createECDH ) {
20
+ crypto . createECDH = require ( 'create-ecdh' ) ;
21
+ }
You can’t perform that action at this time.
0 commit comments