This file contains 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
/** | |
* A utility type around `string` that allows for autocomplete on the string on a specific set of values, yet accepting any string. | |
* | |
* @see https://twitter.com/diegohaz/status/1524257274012876801 | |
*/ | |
export type StringWithAutocomplete<S extends string> = | |
| S | |
| (string & Record<never, never>); |
This file contains 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 { GraphQLResolveInfo } from 'graphql'; | |
export function buildGqlResolvedFieldPath( | |
path: GraphQLResolveInfo['path'] | |
): string { | |
const fieldPath = path.key; | |
if (path.prev) { | |
return `${buildGqlResolvedFieldPath(path.prev)}.${fieldPath}`; | |
} |
This file contains 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
// ==UserScript== | |
// @name Reviewable.io - add line numbers | |
// @namespace https://bengr.dev/ | |
// @version 0.1 | |
// @description Add line numbers to reviewable.io | |
// @author Ben Grynhaus ([email protected]) | |
// @match https://reviewable.io/reviews/* | |
// @icon https://www.google.com/s2/favicons?sz=64&domain=reviewable.io | |
// @grant none | |
// ==/UserScript== |
This file contains 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
// ==UserScript== | |
// @name Wolt Cibus Autoselect | |
// @namespace https://bengr.dev/ | |
// @version 0.1 | |
// @description Automatically choose Cibus payment method in Wolt and turns off the "Use Wolt Credits" Toggle | |
// @author bengry | |
// @match https://wolt.com/*/checkout | |
// @license MIT | |
// @grant none | |
// ==/UserScript== |
This file contains 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
type TODO = unknown; | |
/** | |
* @see https://github.com/mjmlio/mjml/blob/master/packages/mjml-core/src/types/index.js | |
*/ | |
type ValidTypes = "boolean" | "enum" | "color" | "unit" | "string" | "integer"; | |
type PrimitiveType<T> = T extends boolean | |
? "boolean" | |
: T extends string |
This file contains 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 { INetlifyPluginOptions } from "./INetlifyPluginOptions"; | |
export type INetlifyEvent = (options: INetlifyPluginOptions) => void; |
This file contains 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 { setupMockDate, MockDateSetup } from 'test-utils'; | |
let mockDate: MockDateSetup; | |
beforeEach(() => { | |
mockDate = setupMockDate(); | |
}); | |
afterEach(() => { | |
mockDate.reset(); |
This file contains 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 timezonedDate from "timezoned-date"; | |
export interface MockDateSetup { | |
reset(): void; | |
set(options: { offset?: number | keyof typeof offsetsByName; isoDate?: string }): void; | |
} | |
const originalDate = Date; | |
export function setupMockDate(): MockDateSetup { |
This file contains 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 { MiddlewareConsumer, Module, NestModule } from "@nestjs/common"; | |
import { APP_INTERCEPTOR } from "@nestjs/core"; | |
import { RequestContextMiddleware } from "./request-context/request-context.middleware"; | |
import { RequestContextModule } from "./request-context/request-context.module"; | |
@Module({ | |
imports: [ | |
ConfigModule.load(path.resolve(__dirname, "config", "**/!(*.d).{ts,js}")), | |
WebappUsersModule, | |
RequestContextModule, |
This file contains 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/workerize-loader/dist/index.js b/node_modules/workerize-loader/dist/index.js | |
index f318035..7b16cc1 100644 | |
--- a/node_modules/workerize-loader/dist/index.js | |
+++ b/node_modules/workerize-loader/dist/index.js | |
@@ -80,7 +80,7 @@ loader.pitch = function (request) { | |
var entry = compilation.entries[0].resource; // only process entry exports | |
if (current.resource !== entry) { return; } | |
- var exports = compilation.__workerizeExports || (compilation.__workerizeExports = {}); | |
+ var exports = CACHE[entry] || (CACHE[entry] = {}); |
NewerOlder