I see this snippet:
app.addHook('onRequest', (req, reply, done) => {
// overwrite the defaults
req.requestContext.set('user', { id: 'helloUser' });
done();
});
// this should now get `helloUser` instead of the default `system`
sync 3.8610219955444336 | |
async 49.62050497531891 |
global.JSON.get = makeMethod('GET') | |
global.JSON.post = makeMethod('POST') | |
global.JSON.put = makeMethod('PUT') | |
function makeMethod (method) { | |
return function (url, options = {}) { | |
const headers = { | |
...options.headers, | |
'Content-Type': 'application/json', | |
} |
const x = [ | |
'header-c', | |
'value', | |
'header-a', | |
'value', | |
'header-b', | |
'value', | |
'header-e', | |
'value', | |
'header-d', |
const x = [ | |
'header-c', | |
'value', | |
'header-a', | |
'value', | |
'header-b', | |
'value' | |
] | |
function sort1D (arr) { |
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"/> | |
<title>symbol vs string property</title> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/benchmark/1.0.0/benchmark.min.js"></script> | |
<script src="./suite.js"></script> | |
</head> | |
<body> | |
<h1>Open the console to view the results</h1> |
I see this snippet:
app.addHook('onRequest', (req, reply, done) => {
// overwrite the defaults
req.requestContext.set('user', { id: 'helloUser' });
done();
});
// this should now get `helloUser` instead of the default `system`
``` | |
RangeError: Maximum call stack size exceeded | |
at exit (/usr/src/app/node_modules/fastify/lib/hooks.js:77:17) | |
at next (/usr/src/app/node_modules/fastify/lib/hooks.js:93:9) | |
at hookRunnerApplication (/usr/src/app/node_modules/fastify/lib/hooks.js:75:3) | |
at next (/usr/src/app/node_modules/fastify/lib/hooks.js:105:7) | |
at exit (/usr/src/app/node_modules/fastify/lib/hooks.js:82:5) | |
at next (/usr/src/app/node_modules/fastify/lib/hooks.js:93:9) | |
at hookRunnerApplication (/usr/src/app/node_modules/fastify/lib/hooks.js:75:3) | |
at next (/usr/src/app/node_modules/fastify/lib/hooks.js:105:7) |
import os from 'os' | |
import consola from 'consola' | |
// Usage: | |
// | |
// const handler = (file) => console.log(file) | |
// const pool = new PromisePool(['file1', 'file2', ...], handler) | |
// await pool.done() | |
const failureInterval = 3000 |
<template> | |
<img ref="img" /> | |
</template> | |
<script> | |
export default { | |
props: ['src'], | |
data: () => ({ blob: null }), | |
beforeMount () { | |
this.$watch('src', this.loadImage) |
export class ModuleUtils { | |
static mixin(target) { | |
for (const member of Object.getOwnPropertyNames(ModuleUtils.prototype)) { | |
target[member] = ModuleUtils.prototype[member].bind(target) | |
} | |
} | |
resolvePath(...args) { | |
return resolve(process.cwd(), ...args) | |
} |