@mindfulminun/pear@1.5.1
Benji's personal standard library. Collection of tools for manipulating strings, async iterables, shell scripting, and common data structures.
Iterate over an async iterable, calling a callback for each value.
Wait for any async iterable to yield a specific value according to a predicate.
A "destructured" Promise, useful for waiting for callbacks.
Promise that resolves after timeout, optionally with a value to resolve with.
Parses HTML, kinda smart.
Creates a text node for use in the DOM.
Run a shell script. Factory facade to easily interact and run shell scripts
Shell spawner.
Removes indentation from multiline strings.
Escapes HTML on the server-side.
A no-operation function for tagged template string literals
Escapes unsafe strings for use in HTML
Walks the DOM recursively, calling the callback for each node.
Iterate over an async iterable, calling a callback for each value.
Wait for any async iterable to yield a specific value according to a predicate.
A "destructured" Promise, useful for waiting for callbacks.
Promise that resolves after timeout, optionally with a value to resolve with.
Divides an array into two by a given predicate function. Those that pass are put into the first, the rest are put in the second.
Creates an iterable that always yields the given value.
Given an iterable, yields the first count items, then returns.
Given an async iterable, yields the first count items, then returns.
Removes elements from an array. Non-destructive, as all array operations should be :D
Represents a homogenous array of a fixed length.
Swaps two elements of an array. Note that this function swaps the elements in place, meaning the original array is modified.
Represents a graph, consisting of vertices and edges.
Given an edge, this function should return the weight of that edge.
A graph solver, which can perform various algorithms on a graph.
Describes a search function for DFS and BFS.
A cache-like object that can be used with Memo. This interface is
compatible with Map, but it can also be used to implement other caching
strategies, such as an LRU cache.
Data structure allowing for the insertion and removal of
elements in a FIFO manner in O(1) time.
Data structure allowing for the insertion and removal of
elements in a LIFO manner in O(1) time.