tomayac’s avatartomayac’s Twitter Archive—№ 18,409

  1. …in reply to @sid_vishnoi
    @sid_vishnoi @kennethrohde @dandclark1 You can try…catch a dynamic import assertion to check if the type is supported: js const type = 'foo'; try { await import('./foo.json', { assert: { type } }); } catch (err) { if (err.name === 'TypeError') { // Type not supported. } }