cbor-rn-prereqs
Advanced tools
Comparing version 9.0.0 to 10.0.2
38
index.js
@@ -1,8 +0,8 @@ | ||
'use strict' | ||
'use strict'; | ||
function patchGlobal(g) { | ||
const fixes = [] | ||
const fixes = []; | ||
if (g.BigInt === undefined) { | ||
const bi = require('big-integer') | ||
const bi = require('big-integer'); | ||
@@ -13,31 +13,33 @@ // Allow BigInt('0xffffffffffffffff') or BigInt('0x777777777777777777') | ||
// eslint-disable-next-line prefer-named-capture-group | ||
const match = value.match(/^0([xo])([0-9a-f]+)$/i) | ||
const match = value.match(/^0([xo])([0-9a-f]+)$/i); | ||
if (match) { | ||
return bi(match[2], match[1].toLowerCase() === 'x' ? 16 : 8) | ||
return bi(match[2], match[1].toLowerCase() === 'x' ? 16 : 8); | ||
} | ||
} | ||
return bi(value) | ||
} | ||
fixes.push('BigInt') | ||
return bi(value); | ||
}; | ||
fixes.push('BigInt'); | ||
} | ||
if (g.process === undefined) { | ||
g.process = require('process') | ||
fixes.push('process') | ||
// eslint-disable-next-line n/prefer-node-protocol | ||
g.process = require('process'); | ||
fixes.push('process'); | ||
} else if (g.process.nextTick === undefined) { | ||
g.process.nextTick = require('process').nextTick | ||
fixes.push('nextTick') | ||
// eslint-disable-next-line n/prefer-node-protocol | ||
g.process.nextTick = require('process').nextTick; | ||
fixes.push('nextTick'); | ||
} | ||
if (g.TextDecoder === undefined) { | ||
const TextDecoder = require('@cto.af/textdecoder') | ||
g.TextDecoder = TextDecoder | ||
fixes.push('TextDecoder') | ||
const TextDecoder = require('@cto.af/textdecoder'); | ||
g.TextDecoder = TextDecoder; | ||
fixes.push('TextDecoder'); | ||
} | ||
return fixes | ||
return fixes; | ||
} | ||
exports.patchGlobal = patchGlobal | ||
exports.fixes = patchGlobal(global) | ||
exports.patchGlobal = patchGlobal; | ||
exports.fixes = patchGlobal(global); | ||
{ | ||
"name": "cbor-rn-prereqs", | ||
"version": "9.0.0", | ||
"version": "10.0.2", | ||
"description": "React Native pre-requisites for cbor", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "ava test/*.ava.js" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "http://github.com/hildjj/node-cbor.git", | ||
"url": "git+ssh://git@github.com/hildjj/node-cbor.git", | ||
"directory": "packages/cbor-rn-prereqs" | ||
@@ -24,3 +21,3 @@ }, | ||
"@cto.af/textdecoder": "^0.2.0", | ||
"big-integer": "^1.6.51", | ||
"big-integer": "^1.6.52", | ||
"buffer": "^6.0.3", | ||
@@ -30,3 +27,6 @@ "events": "^3.3.0", | ||
"stream-browserify": "^3.0.0" | ||
}, | ||
"engines": { | ||
"node": ">=18" | ||
} | ||
} |
@@ -22,3 +22,3 @@ # cbor-rn-prereqs | ||
}, | ||
} | ||
}; | ||
``` | ||
@@ -29,4 +29,4 @@ | ||
```js | ||
require('cbor-rn-prereqs') | ||
const cbor = require('cbor') | ||
require('cbor-rn-prereqs'); | ||
const cbor = require('cbor'); | ||
``` | ||
@@ -33,0 +33,0 @@ |
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
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
4795
36
Updatedbig-integer@^1.6.52