See how a minor change to your commit message style can make you a better programmer.
Format: <type>(<scope>): <subject>
<scope> is optional
| { | |
| "AuthParameters" : { | |
| "USERNAME" : "[email protected]", | |
| "PASSWORD" : "mysecret" | |
| }, | |
| "AuthFlow" : "USER_PASSWORD_AUTH", | |
| "ClientId" : "9..............." | |
| } |
| type RecursiveRequired<T> = Required<{ | |
| [P in keyof T]: T[P] extends object | undefined ? RecursiveRequired<Required<T[P]>> : T[P]; | |
| }>; | |
| type ExampleType = { | |
| a?: number; | |
| b: number; | |
| c?: { | |
| d?: { | |
| e?: number; |
| type Method = "GET" | "POST" | "PUT" | "DELETE"; | |
| type RouteCallback = (request?: MockRequest) => unknown; | |
| interface Route { | |
| method: Method; | |
| url: string; | |
| callback: RouteCallback; | |
| } | |
| type MockRequest = { |
| /* | |
| https://typescript-exercises.github.io/#exercise=15&file=%2Findex.ts | |
| export class ObjectManipulator { | |
| constructor(protected obj) {} | |
| public set(key, value) { | |
| return new ObjectManipulator({...this.obj, [key]: value}); | |
| } |
| // https://www.typescriptlang.org/play?ssl=20&ssc=1&pln=1&pc=1#code/MYewdgzgLgBAZgJxAWwKJigglgUwjAXhgAosocEBDAIwBscAuGSsATwEpCA+GAbQDpBZCjXoBdfghwATAK7AcxYiGoArADR8A1jlaaAbpVpjOBHgG8AUDBswVq3jtZjCMQ7Wu2pUWQjB21TwBfTXMg9ktLOFkwYCgscADVHDiAWUoABwAeABUuYk8oAAscAHk1FKgmHPVPJ3SMjIomYi0mJxA4GBzTHmhsMABzWpt3WRwGpoQWtu7HXU7uk24YGK0wEAB3MFrOKxtvX39EFHRMXAgC2xhy5Lj+HAxsPGJisoq49n5kTKVHA2WZm0ukmFFazHwHS6PQMRnGoIQxH07BMIxg7AA3JYgljLKBILBkKxbpVXOZmEwAIyaahMABMmmATAAzDAcXjwNAYGAcJsSXFXPZKg1iET+VBNFoVgADJwAfQyUjgWAAHgwACTmLRBaUGFaUgAMRpgACo3JjIviICB6PxaCBBsRyWKPhLubzxWyLUA | |
| const fromEntries = (iterable: any) => [...iterable].reduce((obj, [key, val]) => { | |
| obj[key] = val | |
| return obj | |
| }, {}) | |
| function objectMap<T>( | |
| theObject: T, | |
| keyMapper: (k: keyof T) => string, |
| // ================================ | |
| // Simple query to SQL parser | |
| // | |
| // Copy and paste to https://pegjs.org/online | |
| // | |
| // It parses expressions like: | |
| // | |
| // (flag == True) AND (name == 'Paco' OR (name LIKE '%garcia%') OR (age > 18 AND age <= 45)) | |
| // | |
| // ================================ |
| import Sum from './Sum'; | |
| describe('Sum', () => { | |
| it('should render', () => ( | |
| )); | |
| it('should have two inputs to add the numbers', () => ( | |
| )); | |
| it('should have a button to fire the sum action', () => ( | |
| )); | |
| it('should have text to show the result', () => ( | |
| )); |
| function create_fragment(ctx) { | |
| var button, t1, p, t2, t3, t4, t5, t6_value = ctx.count1 + ctx.count2, t6, dispose; | |
| return { | |
| c: function create() { | |
| button = element("button"); | |
| button.textContent = "Click"; | |
| t1 = space(); | |
| p = element("p"); | |
| t2 = text(ctx.count1); |
| function Snippet1() { | |
| return 'Hola' | |
| } |