JavaScriptRegenerated/yieldparser

Add composite`/album/${albumID}/song/${songID}`

Opened this issue · 0 comments

  • Tagged template string composite()
  • Takes any number of elements: regex, constant string, array of strings, or generator function.
  • Transforms into generator function. Requires no changes to parser.

Example:

function* AlbumID() {}
const songIDRegex = /^\d+/;

function* GetSong() {
  const [albumID, [songID]] = yield composite`/album/${AlbumID}/song/${songIDRegex}`;
}