_setupSpacing() {
    this.shape.spacing = 'spacing' in this.shape ? (this.shape.spacing || {}) : {};

    // TODO
    // eslint-disable-next-line unicorn/no-array-for-each
    ['padding'].forEach(function(property) {
      let spacing;

      if (!Array.isArray(this.spacing[property])) {
        spacing = Math.max(0, Number.parseInt(this.spacing[property] || 0, 10));
        this.spacing[property] = {
          top: spacing, right: spacing, bottom: spacing, left: spacing
        };
      } else {
        spacing = this.spacing[property].map(n => Math.max(0, n));
        switch (spacing.length) {
          case 1: {
            spacing = {
              top: spacing[0], right: spacing[0], bottom: spacing[0], left: spacing[0]
            };
            break;
          }

          case 2: {
            spacing = {
              top: spacing[0], right: spacing[1], bottom: spacing[0], left: spacing[1]
            };
            break;
          }

          case 3: {
            spacing = {
              top: spacing[0], right: spacing[1], bottom: spacing[2], left: spacing[1]
            };
            break;
          }

          default: {
            spacing = {
              top: spacing[0], right: spacing[1], bottom: spacing[2], left: spacing[3]
            };
            break;
          }
        }

        this.spacing[property] = spacing;
      }
    }, this.shape);

    return this.shape.spacing;
  }
Set up spacing

@returns {object} updated spacing
@private