function constructs(existing, list) {
  let index = -1
  /** @type {Array<unknown>} */
  const before = []

  while (++index < list.length) {
    // @ts-expect-error Looks like an object.
    ;(list[index].add === 'after' ? existing : before).push(list[index])
  }

  splice(existing, 0, 0, before)
}
Merge `list` into `existing` (both lists of constructs).
Mutates `existing`.

@param {Array<unknown>} existing
  List of constructs to merge into.
@param {Array<unknown>} list
  List of constructs to merge.
@returns {undefined}
  Nothing.