Sample run on Ubuntu 22.04 LTS [i7-4900MQ CPU @ 2.80GHz/32GB] Chromium 105.0.5195.102
Solid (solid.html)
Created 205760 nodes.
278 ms; sum: 9.11303444731602e+305| const TMDB_IMAGE_BASE_URL = 'https://image.tmdb.org/t/p/'; | |
| addEventListener("fetch", e => { | |
| const url = new URL(e.request.url); | |
| if (url.pathname === "/image") { | |
| e.respondWith((async () => { | |
| const width = url.searchParams.get("width"); | |
| const path = url.searchParams.get("path"); | |
| try { | |
| return await fetch(`${TMDB_IMAGE_BASE_URL}/w${width}${path}`, {mode: "no-cors"}); |
| addEventListener("fetch", e => { | |
| if (e.request.destination !== "image" || // Only do this when requesting an image | |
| request.mode === "no-cors") // We don't know the status of no-cors images | |
| return; | |
| e.respondWith((async () => { | |
| try { | |
| const response = await fetch(e.request); | |
| if (response.ok) | |
| return response; |
| <content-section | |
| [csTitle]="title" | |
| [collapsible]="collapsible" | |
| [state]="state" | |
| [locked]="locked" | |
| [noButtons]="noButtons" | |
| [buttons]="_buttons" | |
| > | |
| <!-- Custom controls --> | |
| <ng-content></ng-content> |
Sample run on Ubuntu 22.04 LTS [i7-4900MQ CPU @ 2.80GHz/32GB] Chromium 105.0.5195.102
solid.html)Created 205760 nodes.
278 ms; sum: 9.11303444731602e+305preactive.html)| <!doctype html> | |
| <html lang=en> | |
| <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/ethers.umd.min.js" defer></script> | |
| <script src="https://cdn.jsdelivr.net/npm/@metamask/[email protected]/dist/detect-provider.min.js" defer></script> | |
| <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/cdn.min.js" defer></script> | |
| <script> | |
| window.abi = { | |
| 'IERC20': [ | |
| { |
| // Run this code on tldraw.com | |
| // By @steveruizok | |
| // Based on an awesome image by @cacheflowe: https://twitter.com/cacheflowe/status/1408902719130288130 | |
| new NumberControl({ | |
| label: 'radius', | |
| value: 200, | |
| min: 50, | |
| max: 500, | |
| }) |
| import { defer, from } from "rxjs"; | |
| import { retry, tap } from "rxjs/operators"; | |
| const values = ["_", 0, 1, 0, 2, 0, 3, 0, 0, 0, 4]; | |
| defer(() => { | |
| values.shift(); | |
| return from(values); | |
| }) | |
| .pipe( |
The package that linked you here is now pure ESM. It cannot be require()'d from CommonJS.
This means you have the following choices:
import foo from 'foo' instead of const foo = require('foo') to import the package. You also need to put "type": "module" in your package.json and more. Follow the below guide.await import(…) from CommonJS instead of require(…).| // Playground link: https://www.typescriptlang.org/play?#code/PTAEHEEsGcBdQG4FMBO1IHsB2AuUALWWAB2hxAHMZYA6K2fAVwCMaBjDAW2ACUelkaVMABMAZgCMbMQDYAHAFZFAQwAmCkWwAMSACwB2VXJHN98hQu1IFAWABQ92AE9iSUAFEAHkjYAeAMJcnMpYqtAANKAAyrDKsG4AvKAA3qBwymwA1ngA2gC6kQA2GGzKhWQpAL6glQB8oAn2oKCBnMGh0KBInvEdoDmQWABmqC1BIaqRNNODIyig-HB5TaAA-B7efouwkV4+re2qvjFxSJEHE7W1K3gn8QDc9o4ubgDygiiQqki+r8wAVpEAHLKThnUAANTKjCQ9SSILBXR6SD6cE+WAoaxSKxyAGlQINQAAKTJIJwYIagP7-ACUoAAPqAEUg8nh8d1emEmaC3OsoYUYaA8NS8aAAGTE0nkynUmnLOzVPBYASoR4OOzOVwQJCwfkw34A4E8uHcxEclFcqUUqkArEi5l5IWgZWCNXPLUAFUYxEKPyBSM5nSwjE4zFQkR4AYtnRCTnyDX6eRNPByAHJfRiGKnHea+v71pG8F6fX7IjlY1Npjwk267IN4ighhk3ECkBQgSGwyhfABBZidXNc4Oh1D1VLKihxSDIPB9zqVd0ttu+D0mj1RvNtjsj7uzUZz+rrOdO9eDoOd0brVvti-d1dOl2qp4al6gOcrtcbrnX7dd3x7+Y53vI9+3XIsv3PHcsTA50VRQWtNTcHtiB9JwokgCgsBXSIAAUMAHZE+mYDAMF9EITTwgjA1AWAUEFdYYOvD8ENfcAdXQzCPwTU9CO-Ldb18Ycu0PUAm3KNw8FomEWK1ABZRhCg4rCe0iAAhE0chU0BVJzXjOhyKTwUMx1GRyMToHBcyWSxQynSsmS3CiENf1QXsIOdW81PcoTRwTHJphoYtfV7WpK0C71gvUvI0wzCgs0dCUfPg59EOiFggp+Ht3NjfIvLPUAcq |
| // when T is any|unknown, Y is returned, otherwise N | |
| type IsAnyUnknown<T, Y, N> = unknown extends T ? Y : N; | |
| // when T is never, Y is returned, otherwise N | |
| type IsNever<T, Y = true, N = false> = [T] extends [never] ? Y : N; | |
| // when T is a tuple, Y is returned, otherwise N | |
| // valid tuples = [string], [string, boolean], | |
| // invalid tuples = [], string[], (string | number)[] |