import {isObject, isNumber} from 'vega-util';

export default function(spec) {
  return isObject(spec) ? spec
    : isNumber(spec) ? {top:spec, bottom:spec, left:spec, right:spec}
    : {top: 0, left: 0, bottom: 0, right: 0}; // TODO defaults
}
import {isObject} from 'vega-util';

export default function(spec, config) {
  spec = spec || config.padding;
  return isObject(spec) ? spec
    : (spec = +spec || 0, {top:spec, bottom:spec, left:spec, right:spec});
}

Update padding parser.