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 type { Plugin } from 'esbuild' | |
function privateToSymbols(descriptions: boolean = true): Plugin { | |
return { | |
name: 'private-to-symbols', | |
setup(build) { | |
build.onLoad({ filter: /\.ts$/ }, async (args) => { | |
if (args.path.includes('node_modules')) return | |
const source = await readFile(args.path, 'utf8') |
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 fs from 'fs' | |
import { glob } from 'glob' | |
import path from 'path' | |
function parseArgs() { | |
const args = process.argv.slice(2) | |
const ignorePattern = | |
args.find((arg) => arg.startsWith('--ignore='))?.split('=')[1] || | |
['**/node_modules/**', '**/dist/**', '**/build/**', '**/coverage/**'] | |
const globPattern = |
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, useRef, useState } from 'react' | |
type StateSetFunction<T> = (prev: T) => Partial<T> | |
type Initializer<T> = ( | |
set: (fn: StateSetFunction<T>) => void, | |
get: () => T, | |
) => T | |
const create = <T extends Record<string, any>>(initializer: Initializer<T>) => { | |
const setter = (fn: StateSetFunction<T>) => { | |
state = { ...state, ...fn(state) } |
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 React, { useEffect, useSyncExternalStore } from "react"; | |
// QueryClient class | |
export class QueryClient { | |
public queries: Map<string, unknown> = new Map(); | |
setQuery(queryKey: string, config: UseQueryConfig) { | |
this.queries.set(queryKey, config); | |
} | |
public queryData = new Map<string, unknown>(); |
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
var express = require('express'), | |
routes = require('./routes'), | |
upload = require('./routes/upload'), | |
http = require('http'), | |
https = require('https'), | |
fs = require('fs'), | |
path = require('path'), | |
httpApp = express(), | |
app = express(), | |
certPath = "cert"; |