This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import EventEmitter from 'eventemitter3' | |
function create_queue() { | |
const events = [] | |
return { | |
push(event) { | |
events.push(event) | |
}, | |
shift() { | |
return events.shift() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# RS256 | |
# private key | |
openssl genrsa -out rs256-4096-private.rsa 4096 | |
# public key | |
openssl rsa -in rs256-4096-private.rsa -pubout > rs256-4096-public.pem | |
# ES512 | |
# private key | |
openssl ecparam -genkey -name secp521r1 -noout -out ecdsa-p521-private.pem | |
# public key |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
0eNrtXV1vXLmR/SsDP3fvXn5f5nH3Yd93HxeDQLY7EyGyJEh2NkEw/327pRmpJZPNc07da8tJA2NgLNtVJC9ZLFadqvOPd++vvuxu7y6vP//x/c3NX9794R/PP7l/94f/Pfrt4c8uP9xcP/74/vKX64urw88+//129+4P7y4/7z6927y7vvh0+N3t3c2H3f395fUv2y/Xl5/f/bp5d3n9cfe3d39wv26G/3r3t9u7/b/efr67uL6/vbn7vH2/uzoW4n/9efNud/358vPl7nE8D7/5+x+vv3x6v7vba3keyeVewebd7c39/i/fXB907gVsnfu3tHn398P/pX9Lvx4G9UqEfyFi+/lm+8vdzZfrjy1h0wthm3cfL+92Hx7/Rm6IDqOZfq2i9DX4hobIa5g5DYnXkDgNmdeQOQ3lKw3777u7e/zOPR3hhI7N036+vv1y2LBfqZz5SUVuUnW49Uc730341vfc4JwTlnxCVvzmy+fOkjviJJMH2fEnmV0w/iQ7UgN/kskd6fiTHEgNyknOpoPs+JNM2j83Osnz8ArDDzJ5v3jlHDvjQfb4Qa7cOfb8OXbkQfbCQSZPsudPsiOPsuePsiPPsv/6LN/fXl1+/rz/w6+FH50pQDR/Zh3pUvjKqzjhecWW9zjxKsjjHUb+s59Gtifgh9VVcnTPp/XT7uPll0/b3dX+799dftje3ly1XB7/PP/woOF6d/nLn9/ffLk7vB5i2Lj9Pev25tLV+HNLo+BPH+mM0KwEj9rPpI5s0hE6n7oIUhM58uej+6eL+8/by+v73V3TJGx9fvWxR+epCsPP3PDjhA8/cMOPThh+IIfvBR2R1MGfanfqVO+thJ/8/lduneionGhHzkg50Z7UIZzoI3uL6Sj45p3IzSu8h490YMMXzrcjjXeaBB2k8U7CQXekmU3CQXekLUxC+MuRBisJx9uRBislIkL40nS0pGUlGOVOmYvxIzbhJ7uOvIAkHGXSEKUqrdGErFH/2ZknS7gWmlh+PtpXN9e/bP9 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default (min_delay, max_delay = Infinity) => handler => { | |
let min_timeout | |
let max_timeout | |
let security_started | |
const execute = () => { | |
clearTimeout(max_timeout) | |
handler() | |
security_started = false | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const success = x => ({ success: x }) | |
export const failure = x => ({ failure: x }) | |
export default { | |
success, | |
failure, | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { isListType } from 'graphql/type/definition.mjs' | |
const extract_is_list = type => | |
isListType(type) || | |
isListType(type?.ofType) | |
const extract_type = type => type.ofType | |
? extract_type(type.ofType) | |
: type |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const noop = () => {} | |
export default class EventIterator { | |
#listen | |
#options | |
constructor(listen, options) { | |
this.#listen = listen | |
this.#options = { | |
highWaterMark: 100, |