Skip to content

Instantly share code, notes, and snippets.

@haysclark
haysclark / ExtendScript.d.ts
Last active January 9, 2024 04:15
Illustrator 26.0.3 TypeScript types for use with Adobe CEP and ExtendScript (WIP)
// Type declarations for ExtendScript Built-in types
// Initial declarations by: Eric Robinson <eric@sonicbloom.io>
/**
* The base class of all JavaScript objects.
*/
interface Object {
/**
* Points to the constructor function that created this object.
* Note that this property is treated as an XML element in the XML class.
@joeytwiddle
joeytwiddle / async-await-forEach-alternatives.md
Last active July 22, 2024 09:05
Do not use forEach with async-await

Do not use forEach with async-await

TLDR: Use for...of instead of forEach() in asynchronous code.

For legacy browsers, use for...i or [].reduce()

To execute the promises in parallel, use Promise.all([].map(...))

The problem