Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
console.error(error)
} else {
console.log(...format(['Result', headerStyles]), response)
}
// Accessors
console.groupCollapsed(...format(['Accessors', headerStyles]))
for (const accessor of accessors) {
console.log(accessor)
}
console.groupEnd()
// Cache
console.log(
...format(['Cache snapshot', headerStyles]),
parse(stringify(this.client.cache))
)
console.groupEnd()
}) as PluginMethod<'onFetch'>
}
serialise() {
const logData = this.data.map((e) => {
// JSON.stringify(new Error('test')) returns {}, which is not really useful for us.
// The following allows us to serialize errors correctly.
if (e && e.message && e.stack) {
e = Object.assign({ message: e.message, stack: e.stack }, e);
}
return e;
});
this.data = logData;
return flatted.stringify(this);
}
serialise() {
const logData = this.data.map((e) => {
// JSON.stringify(new Error('test')) returns {}, which is not really useful for us.
// The following allows us to serialize errors correctly.
if (e && e.message && e.stack) {
e = Object.assign({ message: e.message, stack: e.stack }, e);
}
return e;
});
this.data = logData;
return flatted.stringify(this);
}
it('should delete a invalid key', () => {
const step = schema.parse({
id: '1',
message: 'test',
test: 'test',
});
const resultStep = stringify({ id: '1', message: 'test' });
expect(stringify(step)).to.be.equal(resultStep);
});
testRunner.onTestComplete(result => {
if (result.outcome === TestOutcome.Fail) {
if (result.error instanceof MatchError) {
console.log(`Test ${result.testFixture.description}, ${result.test.key}(${flatted.stringify(result.testCase.caseArguments)}) Failed!`);
console.log(" ---\n" +
' message: "' +
result.error.message +
'"\n' +
" severity: fail\n" +
" data:\n" +
" got: " +
result.error.actual +
"\n" +
" expect: " +
result.error.expected +
"\n");
}
failedTestCount++;
}
testCount++;
it('should throw a key required error', () => {
const step = { message: 'test' };
expect(() => {
schema.parse(step);
}).to.throw(Error, `Key 'id' is required in step ${stringify(step)}`);
});
bridge._dispatch = function () {
if (!iframe) {
return bridge.emit(ERROR,
new Error('uvm: unable to dispatch "' + arguments[0] + '" post disconnection.'));
}
iframe.contentWindow.postMessage({
__emit_uvm: Flatted.stringify(Array.prototype.slice.call(arguments)),
__id_uvm: id
}, TARGET_ALL);
};
writeJSON: function ( filePath, data ) {
write.sync( filePath, flatted.stringify( data ) );
}
};
function hash(content: any) {
return crypto
.createHash('md5')
.update(stringify(content))
.digest('hex')
}
render() {
const { preloadScripts, initialProps } = this.context;
return (