insomnia/packages/insomnia-smoke-test/fixtures/constants.ts
John Chadwick 3234c05c6e
Enable noImplicitAny. (#4864)
* Enable noImplicitAny.

* extracts PreviewMode

* Update packages/insomnia/src/network/certificate-url-parse.ts

* Add missing type.

* un-any-ifies some of the modal onDone callbacks

easy enough.

* few more onDone, but the async ones this time

* Get rid of jsonlint any.

* adds noImplicitAny support for insomnia-smoke-test

* fixes playwright type error

* avoid full @ts-ignore in playwright

Co-authored-by: Dimitri Mitropoulos <dimitrimitropoulos@gmail.com>
2022-06-14 23:41:19 -04:00

14 lines
426 B
TypeScript

const getCreds = (user: string, pass: string, encoding: BufferEncoding) => ({
raw: { user, pass },
encoded: {
user: Buffer.from(user, encoding).toString(),
pass: Buffer.from(pass, encoding).toString(),
},
combined: Buffer.from(`${user}:${pass}`, encoding).toString('base64'),
});
export const basicAuthCreds = {
utf8: getCreds('user', 'pass', 'utf8'),
latin1: getCreds('user-é', 'pass-é', 'latin1'),
};