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
/** | |
* @template T | |
* @typedef {import('./index.js').TupleTree<T>} TupleTree<T> | |
*/ | |
/** | |
* @template T | |
* @typedef {import('./index.js').TupleTreeEntry<T>} TupleTreeEntry<T> | |
*/ |
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
/** | |
* @implements {EventSource} | |
*/ | |
export default class JSONEventSource { | |
#closeCalled; | |
#url; | |
#initArgs; |
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 AsyncObject from './AsyncObject.js'; | |
/** @type {AsyncObject<Worker>} */ | |
const workerConstructor = new AsyncObject(); | |
/** @return {Promise<Worker>} */ | |
async function getConstructor() { | |
if (workerConstructor.hasValue()) { | |
return workerConstructor.value; | |
} |
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 BIT_MASK_6 = 0b11_1111; | |
const BIT_MASK_8 = 0b1111_1111; | |
const CODEPOINT_SINGLE_LIMIT = 0x00_80; | |
const CODEPOINT_DOUBLE_LIMIT = 0x08_00; | |
const CODEPOINT_TRIPLE_LIMIT = 0x1_00_00; | |
const CODEPOINT_QUAD_LIMIT = 0x11_00_00; | |
const CODEPOINT_EXTRA_BYTE = 0b10 << 6; | |
const BASE64_CHAR_62 = '+'; |
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 class NetworkError extends Error { | |
/** | |
* @param {string} message | |
* @param {number} status | |
*/ | |
constructor(message, status) { | |
super(); | |
this.status = status; | |
} | |
} |
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
/** | |
* @template T | |
* @typedef {Object} CustomEventShimPrivateFields<T> | |
* @prop {T} detail | |
* @prop {string} type | |
* @prop {any} target | |
* @prop {any} currentTarget | |
* @prop {number} eventPhase | |
* @prop {boolean} bubbles | |
* @prop {boolean} cancelable |
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
/** | |
* @param {string} url | |
* @param {boolean} [useCredentials=false] | |
* @param {string} [integrity] | |
* @return {Promise<void>} | |
*/ | |
export function loadScript(url, useCredentials, integrity) { | |
return new Promise((resolve, reject) => { | |
const scripts = document.head.getElementsByTagName('script'); | |
for (let i = 0; i < scripts.length; i += 1) { |
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 express from 'express'; | |
import cors from 'cors'; | |
import { sign, verify } from 'jsonwebtoken'; | |
/** | |
* @typedef AuthToken | |
* @prop {string=} sub UserID | |
* @prop {number} iat Issuance date in seconds | |
* @prop {number=} exp Expiration date in seconds | |
*/ |
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 path = require('path'); | |
// const AWS = require('aws-sdk'); | |
// const mime = require('mime'); | |
// const crypto = require('crypto'); | |
/** | |
* @typedef {Object} AWSDeployer.CloudFrontInvalidation | |
* @prop {string} id | |
* @prop {string[]} paths | |
*/ |
NewerOlder