|
|
@ -29,10 +29,11 @@ const props = [String,Array] |
|
|
|
.filter(p => typeof p.value === 'function') |
|
|
|
.filter(p => typeof p.value === 'function') |
|
|
|
|
|
|
|
|
|
|
|
const eq = (a, b) => { |
|
|
|
const eq = (a, b) => { |
|
|
|
const changed = props.filter(p => !p.src[p.key]) |
|
|
|
const changed = [] |
|
|
|
changed.forEach(p => p.src[p.key] = p.value) |
|
|
|
for (const p of props) { !p.src[p.key] && (changed[changed.length] = p) } |
|
|
|
|
|
|
|
for (const p of changed) { p.src[p.key] = p.value } |
|
|
|
deepStrictEqual(a, b) |
|
|
|
deepStrictEqual(a, b) |
|
|
|
changed.forEach(p => p.src[p.key] = undefined) |
|
|
|
for (const p of changed) { p.src[p.key] = undefined } |
|
|
|
return true |
|
|
|
return true |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -62,7 +63,7 @@ const readTest = filename => |
|
|
|
})) |
|
|
|
})) |
|
|
|
|
|
|
|
|
|
|
|
const stackFmt = (err, url) => { |
|
|
|
const stackFmt = (err, url) => { |
|
|
|
props.forEach(p => p.src[p.key] = p.value) |
|
|
|
for (const p of props) { p.src[p.key] = p.value } |
|
|
|
if (err instanceof Error) return err.stack.split(url).join(`${name}.js`) |
|
|
|
if (err instanceof Error) return err.stack.split(url).join(`${name}.js`) |
|
|
|
throw Error(`Unexpected type thrown: ${typeof err}. usage: throw Error('my message')`)
|
|
|
|
throw Error(`Unexpected type thrown: ${typeof err}. usage: throw Error('my message')`)
|
|
|
|
} |
|
|
|
} |
|
|
|