Standard escape codes are prefixed with Escape:
- Ctrl-Key:
^[ - Octal:
\033 - Unicode:
\u001b - Hexadecimal:
\x1B - Decimal:
27
| import assert from "node:assert"; | |
| import { describe, it } from "node:test"; | |
| import { evaluate } from "./mathEvaluator.ts"; | |
| describe("evaluate", () => { | |
| it("evaluates single numbers", () => { | |
| assert.strictEqual(evaluate("1"), 1); | |
| assert.strictEqual(evaluate("12"), 12); | |
| assert.strictEqual(evaluate("12.34"), 12.34); | |
| assert.strictEqual(evaluate(".12"), 0.12); |
| /** | |
| * One of the *explicit* property names of {@linkcode T}, with any `string` or | |
| * `number` index signatures stripped out. | |
| * | |
| * @example | |
| * ```ts | |
| * type A = LiteralKey<{ | |
| * [k: string]: any; | |
| * id: string; |
| //--- Tuple operations ---// | |
| type BuildTuple< | |
| L extends number, | |
| T extends any[] = [], | |
| F = unknown, | |
| > = `${L}` extends `-${number}` | |
| ? never | |
| : T["length"] extends L | |
| ? T |
| import { readdirSync, readFileSync, statSync } from "node:fs"; | |
| import { join } from "node:path"; | |
| export function recursiveRead({ | |
| entryPath, | |
| onDirectory, | |
| onDirectoryExit, | |
| onFile, | |
| onError, | |
| }: { |
| /** | |
| * Get {@linkcode T}, ensuring that all keys from {@linkcode K} are present. If | |
| * any keys are missing, a type error will be thrown. | |
| * | |
| * @typeParam K - The keys to ensure are present. | |
| * @typeParam T - An object that should contain all keys from {@linkcode K}. | |
| * @typeParam TDefault - The default value to use for missing keys. | |
| * | |
| * @example | |
| * ```ts |
| /** | |
| * Extracts and transforms members of a union type `T` based on a filter type | |
| * `F`. It's similar to `Extract<T, U>` but rather than omitting members of `T` | |
| * that aren't wholly assignable to `U`, (e.g., omitting `{ a: string }` when | |
| * `U` is `{ a: 'foo' }`), it narrows values of `T` that the filter type `F` is | |
| * assignable to (e.g., `{ a: string }` is narrowed to `{ a: 'foo' }`). | |
| * | |
| * For each member in `T` (distributing over unions), if it includes all | |
| * required keys (as determined by {@linkcode RequiredValueKey<F>}), the type is | |
| * transformed by applying the filter: |
| /** | |
| * Get a union of value types for `T` by unwrapping it recursively. | |
| * | |
| * @example | |
| * ```ts | |
| * type Scalar = string; | |
| * type ScalarValue = DeepValue<Scalar>; | |
| * // => string | |
| * | |
| * type NestedArray = [string, [number, [boolean]]]; |
| Hey, I'm ryangoree-3289505 and I have contributed to the Privacy Pools Ceremony. | |
| The following are my contribution signatures: | |
| Circuit # 1 (withdraw) | |
| Contributor # 499 | |
| Contribution Hash: 2a9dc7df 157d1efd e26552c4 3b1f5ee8 | |
| b16eaf2c f9eef243 44e49d7f 0f76aeeb | |
| 10f8272f b1e8363a 3a739711 574bf433 | |
| e0242565 275625c4 e7dbeb83 331dc5c1 |