export type OperatorMatcher<
TProperty extends string = any,
TPossibleTypes extends string = any,
TInput extends { [key in TProperty]: TPossibleTypes } = any
> = {
[Type in TPossibleTypes]: Operator<
Extract<TInput, { [key in TProperty]: Type }>,
any
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
diff --git a/node_modules/graphql-redis-subscriptions/dist/redis-pubsub.d.ts b/node_modules/graphql-redis-subscriptions/dist/redis-pubsub.d.ts | |
index cc2e21e..870a2b8 100644 | |
--- a/node_modules/graphql-redis-subscriptions/dist/redis-pubsub.d.ts | |
+++ b/node_modules/graphql-redis-subscriptions/dist/redis-pubsub.d.ts | |
@@ -13,7 +13,7 @@ export declare class RedisPubSub implements PubSubEngine { | |
publish<T>(trigger: string, payload: T): Promise<void>; | |
subscribe(trigger: string, onMessage: Function, options?: Object): Promise<number>; | |
unsubscribe(subId: number): void; | |
- asyncIterator<T>(triggers: string | string[], options?: Object): AsyncIterator<T>; | |
+ asyncIterator<T>(triggers: string | string[], options?: Object): AsyncIterableIterator<T>; |
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 * as React from "react"; | |
interface ClipboardItem { | |
new (input: { [contentType: string]: Blob }): ClipboardItem; | |
} | |
type AsyncClipboardWriteFunction = (input: ClipboardItem) => Promise<void>; | |
declare global { | |
interface Window { |
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 Stack<TType extends any> { | |
#revision = 0; | |
#revisionOffset = 0; | |
#items = [] as Array<TType>; | |
#maximumSize: number; | |
constructor(maxiumSize = 100) { | |
if (maxiumSize < 1) { | |
throw new TypeError("Minimum 'maximumSize' is 1."); | |
} |
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 NO_VALUE_SYMBOL = Symbol("USE_RESET_STATE_NO_VALUE"); | |
const useResetState = (createValue, deps = []) => { | |
const [, triggerRerender] = useState(createValue); | |
const stateRef = useRef(NO_VALUE_SYMBOL); | |
const depsRef = useRef(deps); | |
if (stateRef.current === NO_VALUE_SYMBOL) { | |
stateRef.current = createValue(); | |
} | |
if (depsRef.current.some((value, index) => value !== deps[index])) { |
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 MyComponent = () => { | |
const ref = useOnClickOutside(() => alert("sup")); | |
return <div ref={ref}>Shoop</div>; | |
} |
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
if (!window.OffscreenCanvas) { | |
window.OffscreenCanvas = class OffscreenCanvas { | |
constructor(width, height) { | |
this.canvas = document.createElement("canvas"); | |
this.canvas.width = width; | |
this.canvas.height = height; | |
this.canvas.convertToBlob = () => { | |
return new Promise(resolve => { | |
this.canvas.toBlob(resolve); |
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 { useEffect, useState } from "react"; | |
const useDebouncedInputValue = ( | |
initialValue: string, | |
debounceDuration: number = 200 | |
): [string, string, (val: string) => void] => { | |
const [currentValue, setCurrentValue] = useState(initialValue); | |
const [debouncedValue, setDebouncedValue] = useState(currentValue); | |
useEffect(() => { |
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 pLimit = require('p-limit'); | |
const os = require('os'); | |
const fs = require('fs'); | |
const fsLimit = pLimit(process.env.UV_THREADPOOL_SIZE || 64); | |
const processLimit = pLimit(os.cpus().length); | |
const mkdir = (...args) => fsLimit(() => promisify(fs.mkdir)(...args)); | |
const writeFile = (...args) => fsLimit(() => promisify(fs.writeFile)(...args)); | |
const readFile = (...args) => fsLimit(() => promisify(fs.readFile)(...args)); |
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 knex from 'knex' | |
import knexConfig from 'SUMWHERE' | |
const prepareDatabase = async () => { | |
const migrationTables = [`knex_migrations`, `knex_migrations_lock`] | |
const knexInstance = knex(knexConfig) | |
const closeConnection = pify(knexInstance.destroy) | |
const tableNames = await knexInstance(`pg_tables`) | |
.select(`tablename`) | |
.where(`schemaname`, `public`) |