This file contains hidden or 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 { render } from "[email protected]/web" | |
import h from "[email protected]/h"; | |
import { element, Element, stringAttribute } from "@lume/element" | |
import {createSignal} from "[email protected]" | |
@element("repls-repl") | |
class ReplElement extends Element { | |
@stringAttribute value = "null" | |
template = () => <>{this.value}</> | |
} |
This file contains hidden or 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 { | |
children, | |
createRenderEffect, | |
type ParentProps, | |
onCleanup, | |
createMemo, | |
type JSX, | |
mergeProps, | |
} from "solid-js"; |
This file contains hidden or 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 s = { | |
int64: <T extends string>(key: T) => [key, 8] as const, | |
uint64: <T extends string>(key: T) => [key, 8] as const, | |
float32: <T extends string>(key: T) => [key, 4] as const, | |
float64: <T extends string>(key: T) => [key, 8] as const, | |
int8: <T extends string>(key: T) => [key, 1] as const, | |
int16: <T extends string>(key: T) => [key, 2] as const, | |
int32: <T extends string>(key: T) => [key, 4] as const, | |
uint8: <T extends string>(key: T) => [key, 1] as const, | |
uint8clamped: <T extends string>(key: T) => [key, 1] as const, |
This file contains hidden or 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 { type JSX } from "solid-js"; | |
const LOG_SYMBOL = Symbol("log"); | |
type Log = [source: string, ...styles: string[]] & { | |
[LOG_SYMBOL]: true; | |
}; | |
type ValidValue = [string, JSX.CSSProperties?] | Log; | |
function fragment(array: Log[]): Log { |
This file contains hidden or 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 { Style, ViewBase } from "@nativescript/core"; | |
import { | |
Document, | |
DOMEvent, | |
HTMLElementTagNameMap, | |
Node, | |
NSComponentsMap, | |
NSCustomComponentsMap, | |
PseudoElementsMap, | |
} from "dominative"; |
This file contains hidden or 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 { MergeProps, mergeProps, splitProps } from 'solid-js' | |
type KeyOfOptionals<T> = keyof { | |
[K in keyof T as T extends Record<K, T[K]> ? never : K]: T[K] | |
} | |
export function processProps< | |
TProps extends Record<string, any>, | |
TKey extends KeyOfOptionals<TProps>, | |
TSplit extends (keyof TProps)[], |
This file contains hidden or 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 { Accessor } from 'solid-js' | |
/** | |
* Executes a callback with a value derived from an accessor if the value is truthy. | |
* | |
* @param accessor The value or function returning a value that is checked for truthiness. | |
* @param callback The callback function to be executed if the accessor's value is truthy. | |
* @returns The result of the callback if executed, otherwise undefined. | |
*/ | |
export function when< |
This file contains hidden or 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 { Monaco } from '@monaco-editor/loader' | |
const regex = { | |
import: | |
/import\s+(?:type\s+)?(?:\{[^}]*\}|\* as [^\s]+|\w+\s*,\s*\{[^}]*\}|\w+)?\s+from\s*"(.+?)";?/gs, | |
export: | |
/export\s+(?:\{[^}]*\}|\* as [^\s]+|\*|\w+(?:,\s*\{[^}]*\})?|type \{[^}]*\})?\s+from\s*"(.+?)";?/gs, | |
require: /require\s*\(["']([^"']+)["']\)/g, | |
} | |
export class TypeRegistry { |
This file contains hidden or 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
/** | |
* array extended with mutable/in-place array-methods | |
*/ | |
class ArrayInPlace<T = number> extends Array { | |
commands: Command<T>[] = []; | |
constructor(values: T[]) { | |
super(); | |
Array.prototype.push.apply(this, values); | |
} |
This file contains hidden or 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
class ArrayInPlace<T = number> extends Array { | |
commands: Command<T>[] = []; | |
constructor(values: T[]) { | |
super(); | |
for (let i = 0; i < Math.floor(values.length / 100_000); i++) { | |
Array.prototype.push.apply( | |
this, | |
values.slice(i * 100_000, (i + 1) * 100_000), | |
); | |
} |