This is a bare-bones implementation of the interfaces AsyncDisposableStack
and DisposableStack
from the [Explicit Resource Management Proposal].
Note: see the examples below for more detailed usage examples.
/// <reference no-default-lib="true" /> | |
// deno-lint-ignore-file no-unused-vars no-explicit-any | |
import { | |
inspect, | |
type InspectOptions, | |
type InspectOptionsStylized, | |
// highlight, | |
indexOf, | |
pop, |
export interface ListAllOptions<T> extends Deno.KvListOptions { | |
comparer?(a: Deno.KvEntry<T>, b: Deno.KvEntry<T>): number; | |
} | |
export interface ListEntry<T> extends Deno.KvEntry<T> { | |
readonly cursor: string; | |
} | |
export async function listAll<T>( | |
kv: Deno.Kv, |
dist | |
node_module | |
*.env* | |
*.log | |
.*.log | |
*.lock* | |
*-lock.* | |
.DS_Store | |
Thumbs.db | |
.SpotlightV100 |
// Copyright (c) 2024+ Nicholas Berlette (https://github.com/nberlette) | |
// Published under the MIT license. All rights reserved. | |
/** | |
* Removes common leading whitespace from each line in {@linkcode S}. | |
* This is the type-level counterpart to the {@linkcode outdent} function. | |
* | |
* @example | |
* ```ts | |
* type S = Outdent<` |
This is a bare-bones implementation of the interfaces AsyncDisposableStack
and DisposableStack
from the [Explicit Resource Management Proposal].
Note: see the examples below for more detailed usage examples.
// deno-lint-ignore-file | |
// Generated by Peggy 3.0.2. | |
// https://peggyjs.org/ | |
export default (function () { | |
"use strict"; | |
function add(obj, props) { | |
for (const [k, v] of Object.entries(props)) if (v) obj[k] = v; | |
return obj; | |
} |
import { tpl } from "./tpl.ts"; | |
// Examples: | |
// ----------------------------------------------------------------------------- | |
// unfortunately, we can't infer string literal types from template strings. | |
// this is a design limitation of TypeScript, and the core team has no plans to | |
// change this behavior as it currently stands :( | |
const result1 = tpl`Hello {who}! Want to {what:party}?${{ who: "nberlette" }}`; | |
// runtime result: "Hello nberlette! Want to party?" |
<div id="app" class="wrapper !opacity-100"> | |
<noscript>Please enable JavaScript to use this app.</noscript> | |
</div> | |
<script> | |
/** | |
* Unocss Runtime DOM options | |
* @see https://unocss.dev/integrations/runtime | |
* @see https://github.com/unocss/unocss/tree/main/packages/runtime#readme | |
*/ |