Make sure the Uint8Array has at least 4 bytes or you know that the stream isn't done.
e.g. https://codepen.io/okikio/pen/MWBjdNB?editors=0011
import { asCodePoints } from "uint8array-to-utf-8"
function later(delay) {
/** | |
* @license Apache-2.0 | |
* | |
* Copyright (c) 2018 The Stdlib Authors. | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 |
Make sure the Uint8Array has at least 4 bytes or you know that the stream isn't done.
e.g. https://codepen.io/okikio/pen/MWBjdNB?editors=0011
import { asCodePoints } from "uint8array-to-utf-8"
function later(delay) {
const LZuint8Array = (function () { | |
/* | |
basic ranges of printable UTF16 values (as found in LZ-string): | |
[32, 127), [160, 55296), [63744, 65536) | |
We also have filter out string characters like: | |
" (34) | |
' (39) | |
` (44) | |
(Forward tick is safe: ´ (96)) | |
So: |
var P5=Object.create;var s3=Object.defineProperty;var h5=Object.getOwnPropertyDescriptor;var d5=Object.getOwnPropertyNames;var K5=Object.getPrototypeOf,H5=Object.prototype.hasOwnProperty;var H1=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,n)=>(typeof require<"u"?require:t)[n]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw new Error('Dynamic require of "'+e+'" is not supported')});var z1=(e,t)=>()=>(e&&(t=e(e=0)),t);var U5=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),n1=(e,t)=>{for(var n in t)s3(e,n,{get:t[n],enumerable:!0})},S5=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of d5(t))!H5.call(e,a)&&a!==n&&s3(e,a,{get:()=>t[a],enumerable:!(r=h5(t,a))||r.enumerable});return e};var V2=(e,t,n)=>(n=e!=null?P5(K5(e)):{},S5(t||!e||!e.__esModule?s3(n,"default",{value:e,enumerable:!0}):n,e));var p2=U5((y8,T0)=>{"use strict";var c3=Object.defineProperty,u5=Object.getOwnPropertyDescriptor,j5=Object.getOwnPropertyNames,R5=Object.pro |
const isWorker = typeof WorkerGlobalScope !== 'undefined' && self instanceof WorkerGlobalScope; | |
async function getHandleFromPath(path: string) { | |
const pathParts = path.split('/').filter(part => part.length > 0); | |
let currentHandle = await navigator.storage.getDirectory(); | |
for (const part of pathParts) { | |
if (part === '..') { | |
currentHandle = await currentHandle.getParent(); | |
} else { |
import { signal, effect } from 'https://esm.sh/usignal'; | |
// Function to check if an expression is iterable | |
function isIterable(expression) { | |
return Symbol.iterator in Object(expression); | |
} | |
// Function to create a new DOM range for an expression | |
function createDOMRange(domElement, expression) { | |
const textNode = document.createTextNode(evaluateExpression(expression.expr)); |
import * as ts from "https://esm.sh/typescript" | |
/** | |
* Determines whether escape sequences in a token of a specific kind should be preserved. | |
* Useful for maintaining the integrity of literals where escape characters are meaningful. | |
* | |
* @example | |
* // Simple: In string literals like `"Hello\nWorld"`, the `\n` should be preserved. | |
* shouldPreserveEscapes(ts.SyntaxKind.StringLiteral); | |
* |
Hey 👋, I was working on the proposals for unifying the URL specs. From the research I’ve done on the topic so far, we’d need a total of 2 RFC's to solve to problem and ensure it never occurs again.
The 1st RFC (The Unified URI RFC) will use the original 2005 URI RFC as it’s basis, then build on top of it the modern WHATWG URL standard. Alwin Blok already created a new URL Spec. proposal to try to accomplish this very goal, we’ll investigate what changes there are between both RFC’s and the new proposal by Alwin, and look to create a Unified RFC from that.
Some ideas that @Randall, Jonathan Neal, and I played with were separating URI’s and URL’s.
import { CLIENT_ID, CLIENT_SECRET } from "~/env.ts"; | |
import { gmail_v1, auth } from "@googleapis/gmail"; | |
import { Hono } from '@kyiro/hono'; | |
import open from 'open'; | |
const REDIRECT_URI = "http://localhost:8000/token"; | |
const SCOPE = "https://www.googleapis.com/auth/gmail.readonly"; | |
console.log({ | |
SCOPE, |
export class Component { | |
/** | |
* For perf. reasons use a class to delagate event handlers, | |
* this lets us avoid binds and arrow functions which have memory overhead, | |
* in addition since it's always the same instance of the same class, | |
* so it's super easy to remove later on | |
* | |
* Based on https://webreflection.medium.com/dom-handleevent-a-cross-platform-standard-since-year-2000-5bf17287fd38 | |
*/ | |
static #eventhandlers = new WeakMap(); |