node-stringprep
Advanced tools
Comparing version 0.2.1 to 0.2.2
13
index.js
'use strict'; | ||
try { | ||
var icu = require('node-stringprep-icu') | ||
var bindings = require('bindings')('node_stringprep.node') | ||
} catch (ex) { | ||
console.warn( | ||
'Cannot load StringPrep-ICU' + | ||
' icu (using fallback). You may need to ' + | ||
'`npm install node-stringprep-icu`' | ||
'Cannot load StringPrep-' + | ||
require('./package.json').version + | ||
' bindings (using fallback). You may need to ' + | ||
'`npm install node-stringprep`' | ||
) | ||
@@ -15,3 +16,3 @@ } | ||
try { | ||
return icu.toUnicode(value) | ||
return bindings.toUnicode(value) | ||
} catch (e) { | ||
@@ -25,3 +26,3 @@ return value | ||
try { | ||
this.stringPrep = new icu.StringPrep(this.operation) | ||
this.stringPrep = new bindings.StringPrep(this.operation) | ||
} catch (e) { | ||
@@ -28,0 +29,0 @@ this.stringPrep = null |
{ | ||
"name": "node-stringprep", | ||
"version": "0.2.1", | ||
"version": "0.2.2", | ||
"main": "index.js", | ||
@@ -14,4 +14,5 @@ "description": "ICU StringPrep profiles", | ||
}, | ||
"optionalDependencies": { | ||
"node-stringprep-icu": "~0.1.0" | ||
"dependencies": { | ||
"nan": "~0.7.0", | ||
"bindings": "~1.1.1" | ||
}, | ||
@@ -18,0 +19,0 @@ "devDependencies": { |
@@ -7,3 +7,3 @@ 'use strict'; | ||
var StringPrep = proxyquire('../index', { 'node-stringprep-icu': null }).StringPrep | ||
var StringPrep = proxyquire('../index', { 'bindings': null }).StringPrep | ||
@@ -10,0 +10,0 @@ it('Should throw on unknown icu-profile', function(done) { |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
17839
13
155
53
2
1
+ Addedbindings@~1.1.1
+ Addednan@~0.7.0
- Removednode-stringprep-icu@0.1.2(transitive)