code: function parseAttribute(attribute, defaultValue) {
      // 1em, 1.0em, 0.1em, .1em, 1.    em
      const re = /^(-{0,1}\.{0,1}\d+(\.\d+)?)[\s|\.]*(\w*)$/;
      if (attribute && re.test(attribute)) {
          const match = re.exec(attribute);
          const number = match[1];
          const units = match[3] || 'px';
          return { value: number * 1, units, original: attribute };
      }
      if (defaultValue) {
          return parseAttribute(defaultValue);
      }
      return { original: defaultValue };
  }
docs: Parse a css attribute into the numeric portion and the units