@samual/lib
Advanced tools
| export declare const capitalize: (text: string) => string; |
| const capitalize = text => text && text[0].toUpperCase() + text.slice(1) | ||
| export { capitalize } |
+8
-0
@@ -34,1 +34,9 @@ export type Key = keyof any; | ||
| export type UnionToIntersection<T> = (T extends any ? (_: T) => void : never) extends ((_: infer I) => void) ? I : never; | ||
| /** | ||
| * @example | ||
| * type CheckedString = Brand<string, { readonly CheckedString: unique symbol }[`CheckedString`]> | ||
| * // ^? type CheckedString = string & { [CheckedString]: true } | ||
| */ | ||
| export type Brand<T, TBrand extends symbol> = T & { | ||
| [K in TBrand]: true; | ||
| }; |
+1
-1
| { | ||
| "name": "@samual/lib", | ||
| "version": "0.13.1-607e4ec", | ||
| "version": "0.13.1-964d4e5", | ||
| "repository": "github:samualtnorman/lib", | ||
@@ -5,0 +5,0 @@ "author": "Samual Norman <me@samual.uk> (https://samual.uk/)", |
+2
-2
| const { port1, port2 } = new MessageChannel(), | ||
| tasks = [] | ||
| port2.addEventListener("message", () => { | ||
| port2.onmessage = () => { | ||
| for (const task of tasks.splice(0)) task() | ||
| }) | ||
| } | ||
| function queueTask(callback) { | ||
@@ -7,0 +7,0 @@ tasks.length || port1.postMessage(void 0) |
@@ -1,4 +0,6 @@ | ||
| export declare const writeFilePersistent: (path: string, data: string | NodeJS.ArrayBufferView | Iterable<string | NodeJS.ArrayBufferView> | AsyncIterable<string | NodeJS.ArrayBufferView> | import("stream").Stream, options?: BufferEncoding | (import("fs").ObjectEncodingOptions & { | ||
| import { writeFile } from "fs/promises"; | ||
| import type { Slice1 } from "."; | ||
| export declare const writeFilePersistent: (path: string, data: string | NodeJS.ArrayBufferView<ArrayBufferLike> | Iterable<string | NodeJS.ArrayBufferView<ArrayBufferLike>> | AsyncIterable<string | NodeJS.ArrayBufferView<ArrayBufferLike>> | import("stream").Stream, options?: BufferEncoding | (import("fs").ObjectEncodingOptions & { | ||
| mode?: import("fs").Mode | undefined; | ||
| flag?: import("fs").OpenMode | undefined; | ||
| } & import("events").Abortable) | null | undefined) => Promise<void>; |
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
28698
1.86%115
1.77%688
2.08%6
20%