<commit_before>const child = require("reaks/child")
const seq = require("reaks/seq")
const style = require("reaks/style")

module.exports = function(opts, layers) {
  if (arguments.length === 1) {
    layers = opts
    opts = {}
  }

  const { setPositionRelative = true } = opts

  return seq([
    setPositionRelative && style({ position: "relative" }),
    seq(
      layers.map((layer, i) =>
        child(
          seq([
            layer,
            style({
              position: "absolute",
              top: 0,
              bottom: 0,
              left: 0,
              right: 0,
              zIndex: i,
            }),
          ])
        )
      )
    ),
  ])
}<commit_msg>z-pile: content sized (need to choose a layer)<commit_after>const isArray = require("lodash/isArray")
const child = require("reaks/child")
const seq = require("reaks/seq")
const style = require("reaks/style")

const normalizeLayerArg = layerArg => isArray(layerArg) ? layerArg : [{}, layerArg]

module.exports = function(opts, layers) {
  if (arguments.length === 1) {
    layers = opts
    opts = {}
  }

  const { setPositionRelative = true } = opts

  return seq([
    setPositionRelative && style({ position: "relative" }),
    seq(
      layers.map((layer, i) => {
        const [opts, cmp] = normalizeLayerArg(layer)
        return child(
          seq([
            cmp,
            !opts.sizer ? style({
              position: "absolute",
              top: 0,
              bottom: 0,
              left: 0,
              right: 0,
              zIndex: i,
            }) : style({
              position: 'relative',
              zIndex: i,
            }),
          ])
        )
      }
      )
    ),
  ])
}
{'fraction_non_alphanumeric': 0.13652275379229872, 'fraction_numerical': 0.005834305717619603, 'mean_word_length': 1.6223241590214068, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7620749', 'n_tokens_mistral': 511, 'n_tokens_neox': 491, 'n_words': 121}