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
'use-strict' | |
const api = 'https://api.magicthegathering.io/v1' | |
const dominariaPage1 = fetch(new Request(Resource(Page(1)))) | |
const dominariaPage2 = fetch(new Request(Resource(Page(2)))) | |
const dominariaPage3 = fetch(new Request(Resource(Page(3)))) | |
Promise | |
.all([dominariaPage1, dominariaPage2, dominariaPage3]) |
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
function getOwnPropertyTypes(val) { | |
'use strict'; | |
if (val && typeof val === 'object') { | |
return Object.getOwnPropertyNames(val) | |
.reduce((obj, key) => Object.defineProperty(obj, key, { value: typeof val[key] }), {}) | |
} | |
return {}; | |
} |
NewerOlder