Comparing version
@@ -217,3 +217,7 @@ 'use strict' | ||
delete this.types['WeakSet'] | ||
this.typedArrays.pop() // remove SharedArrayBuffer | ||
this.typedArrays = this.typedArrays.filter(c => !([ | ||
ArrayBuffer, | ||
DataView, | ||
SharedArrayBuffer | ||
].includes(c))) | ||
} | ||
@@ -552,10 +556,17 @@ | ||
// TODO: throw in some `.`, `*`, `+`, and parens for fun. | ||
const n = new RegExp( | ||
this.generate_string(depth, 'RegExp'), | ||
this._some('gimsuy', 'RegExp flags') | ||
) | ||
if (this.opts.output) { | ||
n[util.inspect.custom] = () => `new RegExp('${n.source}', '${n.flags}')` | ||
} | ||
let n = null | ||
do { | ||
try { | ||
n = new RegExp( | ||
this.generate_string(depth, 'RegExp'), | ||
this.opts.cborSafe ? '' : this._some('gimsuy', 'RegExp flags') | ||
) | ||
if (this.opts.output) { | ||
const str = `new RegExp('${n.source}', '${n.flags}')` | ||
n[util.inspect.custom] = () => str | ||
} | ||
} catch (ignored) { | ||
// lots of ways that a regex can be bad. | ||
} | ||
} while (!n) | ||
return n | ||
@@ -562,0 +573,0 @@ } |
{ | ||
"name": "basura", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"bin": { | ||
@@ -5,0 +5,0 @@ "basura": "bin/basura.js" |
55845
0.54%1202
1.01%