src/initialValueMap.js
function initialValues(property, recursivelyResolve = false, includeShorthands = false) {
  computeInitialValue(property);
  if (recursivelyResolve) {
    const initials = includeShorthands ? initialValueRecursiveMap[property] : initialValueConcreteMap[property];
    if (!initials) {
      // It's an unknown property, return initial and hope the caller knows what
      // they are doing.
      return { [property]: 'initial' };
    }
    // we make a copy here to prevent the caller from corrupting our cache.
    return Object.assign({}, initials);
  }
  return { [property]: initialValueMap[property] || 'initial' };
}
function initialValues(property, recursivelyResolve = false, includeShorthands = false) {
  computeInitialValue(property);
  if (recursivelyResolve) {
    const initials = includeShorthands ? initialValueRecursiveMap[property] : initialValueConcreteMap[property];
    if (!initials) {
      // It's an unknown property, return initial and hope the caller knows what
      // they are doing.
      return { [property]: 'initial' };
    }
    // we make a copy here to prevent the caller from corrupting our cache.
    return Object.assign({}, initials);
  }
  return { [property]: initialValueMap[property] || 'initial' };
}
function initialValues ( property , recursivelyResolve = false , includeShorthands = false ) { computeInitialValue ( property ) ; if ( recursivelyResolve ) { const initials = includeShorthands ? initialValueRecursiveMap [ property ] : initialValueConcreteMap [ property ] ; if ( ! initials ) { // It's an unknown property, return initial and hope the caller knows what // they are doing. return { [ property ] : 'initial' } ; } // we make a copy here to prevent the caller from corrupting our cache. return Object . assign ( { } , initials ) ; } return { [ property ] : initialValueMap [ property ] || 'initial' } ; }
Get the initial values for a property.
@param {string} property - the property name
@param {boolean} recursivelyResolve - when given a shorthand property,
causes the result to include long hand values.
@param {boolean} includeShorthands - when resolving recursively, causes the
the result to include the specified shorthand property as well as any
intermediate shorthands of this property to to the initial value.
@return {Object} the initial value or values a property has by
default according the CSS specification. If the property's initial
value(s) is/are unknown, the global keyword `initial` is returned.
@example
console.log(initialValues('border-width'));
// => { 'border-width': 'medium' }
console.log(initialValues('border-width', true));
// => {
'border-bottom-width': 'medium',
'border-left-width': 'medium',
'border-right-width': 'medium',
'border-top-width': 'medium',
'border-width': 'medium'
}
Get the initial values for a property .