View metadata.json
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
{ | |
"image": "https://images.ctfassets.net/a9237abdyvg9/2GDeLs0jA3u3jHJsIlBTGT/d06c08a6f7a8e1bbdb34d43d8d78bc5f/boredape1.jpeg" | |
} |
View metadata.json
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
{ | |
"image": "https://www.highsnobiety.com/static-assets/thumbor/j2w6qxCWe_zs_suVSTfHEB_nCNo=/1600x1067/www.highsnobiety.com/static-assets/wp-content/uploads/2021/11/02170527/cryptopunk-nft-500-million-2.jpg" | |
} |
View metadata.json
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
{ | |
"attributes": [ | |
{ | |
"trait_type": "Breed", | |
"value": "Maltipoo" | |
}, | |
{ | |
"trait_type": "Eye color", | |
"value": "Mocha" | |
} |
View metadata.json
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
{ | |
"attributes": [ | |
{ | |
"trait_type": "Breed", | |
"value": "Maltipoo" | |
}, | |
{ | |
"trait_type": "Eye color", | |
"value": "Mocha" | |
} |
View articles.002.012.other-types.ts
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
const buttonTypeKeys = propertiesOf<typeof MyEnum>(); | |
const stringProperties = propertiesOf<string>(); | |
const promiseProperties = propertiesOf<Promise<unknown>>(); |
View articles.002.011.advanced.ts
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
// This will list all the readonly properties of MyInterface | |
const readonlyProperties = propertiesOf<MyInterface>({ readonly: true }); | |
// This will list all the optional properties of MyInterface | |
const optionalProperties = propertiesOf<MyInterface>({ optional: true }); | |
// This will list all the required properties of MyInterface | |
const requiredProperties = propertiesOf<MyInterface>({ optional: false }); | |
// But feel free to ask for private readonly OR public optional properties |
View articles.002.010.properties-of-some-payload.ts
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 { propertiesOf } from 'ts-reflection'; | |
// FREEDOM!!! | |
const payloadKeys = propertiesOf<SomePayload>(); |
View articles.002.008.enum-mapping.ts
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
const enumKey = ButtonType[ButtonType.PRIMARY] |
View articles.002.007.enum-as-const-console-log.ts
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
console.log(buttonTypes); | |
// The output does not look like what we'd expect! | |
['primary', 'PRIMARY', 'secondary', 'SECONDARY', 'link', 'LINK'] |
NewerOlder