# all files / candela/util/ index.js

60% Statements 12/20
66.67% Branches 4/6
25% Functions 1/4
38.46% Lines 5/13
1 statement, 1 branch Ignored

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    251×

    1×

    1×

    1×

     import _ from 'underscore';

    export function getElementSize (el) {
      const style = window.getComputedStyle(el, null);
      const width = window.parseInt(style.getPropertyValue('width'));
      const height = window.parseInt(style.getPropertyValue('height'));

      return {
        width,
        height
      };
    }

    export function deepCopy (o) {
      if (_.isUndefined(o)) {
        return undefined;
      }
      return JSON.parse(JSON.stringify(o));
    }

    export function concat (...lists) {
      return [].concat(...lists);
    }