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
/** | |
* Interceptor interface for intercepting method calls, requests, responses, process, and errors. | |
*/ | |
export interface Interceptor { | |
before?(...args: any[]): Promise<void> | void | |
after?<T>(result: T, ...args: any[]): Promise<void> | void | |
error?(error: Error, ...args: any[]): Promise<void> | void | |
shouldThrow?: boolean | |
} |
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
[ | |
{ | |
"code": 100, | |
"name": "Continue", | |
"enum": "CONTINUE", | |
"reference": { | |
"info": "RFC 7231, Section 6.2.1", | |
"url": "https://tools.ietf.org/html/rfc7231#section-6.2.1" | |
}, | |
"description": "The server has received the request headers and the client should proceed to send the request body", |
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 callerMap = {}; | |
function getCaller(error) { | |
if (error && error.stack) { | |
const lines = error.stack.split('\n'); | |
if (lines.length > 2) { | |
let match = lines[2].match(/at ([a-zA-Z\-_$.]+) (.*)/); | |
if (match) { | |
return { | |
name: match[1].replace(/^Proxy\./, ''), |
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
#!/bin/bash | |
sudo rm -Rf /Applications/Docker.app | |
sudo rm -f /usr/local/bin/docker | |
sudo rm -f /usr/local/bin/docker-machine | |
sudo rm -f /usr/local/bin/com.docker.cli | |
sudo rm -f /usr/local/bin/docker-compose | |
sudo rm -f /usr/local/bin/docker-compose-v1 | |
sudo rm -f /usr/local/bin/docker-credential-desktop | |
sudo rm -f /usr/local/bin/docker-credential-ecr-login |
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
module.exports = (sequelize: any, DataTypes: any) => { | |
const Member = sequelize.define( | |
'member', | |
{ | |
id: { | |
type: DataTypes.UUID, | |
defaultValue: DataTypes.UUIDV4, | |
allowNull: false, | |
primaryKey: true, | |
}, |
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 { getStyles } from './test-helpers' | |
describe('styled-components', () => { | |
test('extended components keep their styles', () => { | |
const Box = styled.div` | |
margin: 16px; | |
` | |
const Card = styled(Box)` | |
color: tomato; | |
` |
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 { isValid } from './utils' | |
const OptionType = { | |
Some: Symbol(':some'), | |
None: Symbol(':none'), | |
} | |
const makeSome = (val) => ({ | |
type: OptionType.Some, | |
isSome: () => true, |
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 makeReadOnly = (value) => Object.freeze(value) | |
const ResultType = { | |
Ok: Symbol(':ok'), | |
Err: Symbol(':err'), | |
} | |
const Ok = (val) => makeReadOnly({ | |
type: ResultType.Ok, | |
isOk: () => true, |
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
export const List = (x) => ({ | |
emit: () => x, | |
head: () => x[0], | |
tail: () => List.of(x.splice(1)), | |
last: () => x[x.length - 1], | |
chain: (f) => x.map(f), | |
map: (f) => List.of(x.map(f)), | |
inspect: () => `List(${x})`, | |
concat: (a) => List.of(x.concat(a)) | |
}) |
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
interface ITuple<F, S> { | |
fst(): F | |
snd(): S | |
toArray(): [F, S] | |
unwrap(): [F, S] | |
toJSON(): [F, S] | |
inspect(): string | |
toString(): string | |
equals(other: ITuple<F, S>): boolean | |
bimap<F2, S2>(f: (fst: F) => F2, g: (snd: S) => S2): ITuple<F2, S2> |
NewerOlder