src/initialValueMap.js
function computeInitialValue(propertyName) {
  if (properties[propertyName] === undefined) return; // unknown property
  if (initialValueMap[propertyName]) return; // value is cached.
  let initialValue = properties[propertyName].initial;
  if (Array.isArray(initialValue)) {
    // it's a shorthand
    initialValue.forEach(computeInitialValue);
    initialValueMap[propertyName] =
      canonicalShorthandInitialValues[propertyName]
      || initialValue.map(v => initialValueMap[v]).join(' ');
  } else {
    // it's a string with the initial value.
    // the value may be nonsense though.
    if (ILLEGAL_INITIAL_VALUES.test(initialValue)) {
      initialValue = 'initial'; // safest legal value.
    }
    initialValueMap[propertyName] =
      initialValueOverrides[propertyName] || initialValue;
  }
  const propertyNames = getShorthandComputedProperties(propertyName, true);
  initialValueRecursiveMap[propertyName] = { [propertyName]: initialValueMap[propertyName] };
  initialValueConcreteMap[propertyName] = { };
  // In theory, the recursive calls to `computeInitialValue` above should be
  // enough to populate the cache for these calls. However, in the case of data
  // corruption of the initial property this could be a bad assumption.
  propertyNames.forEach((prop) => {
    initialValueRecursiveMap[propertyName][prop] = initialValueMap[prop];
    if (!isShorthandProperty(prop)) {
      initialValueConcreteMap[propertyName][prop] = initialValueMap[prop];
    }
  });
}
function computeInitialValue(propertyName) {
  if (properties[propertyName] === undefined) return; // unknown property
  if (initialValueMap[propertyName]) return; // value is cached.
  let initialValue = properties[propertyName].initial;
  if (Array.isArray(initialValue)) {
    // it's a shorthand
    initialValue.forEach(computeInitialValue);
    initialValueMap[propertyName] =
      canonicalShorthandInitialValues[propertyName]
      || initialValue.map(v => initialValueMap[v]).join(' ');
  } else {
    // it's a string with the initial value.
    // the value may be nonsense though.
    if (ILLEGAL_INITIAL_VALUES.test(initialValue)) {
      initialValue = 'initial'; // safest legal value.
    }
    initialValueMap[propertyName] =
      initialValueOverrides[propertyName] || initialValue;
  }
  const propertyNames = getShorthandComputedProperties(propertyName, true);
  initialValueRecursiveMap[propertyName] = { [propertyName]: initialValueMap[propertyName] };
  initialValueConcreteMap[propertyName] = { };
  // In theory, the recursive calls to `computeInitialValue` above should be
  // enough to populate the cache for these calls. However, in the case of data
  // corruption of the initial property this could be a bad assumption.
  propertyNames.forEach((prop) => {
    initialValueRecursiveMap[propertyName][prop] = initialValueMap[prop];
    if (!isShorthandProperty(prop)) {
      initialValueConcreteMap[propertyName][prop] = initialValueMap[prop];
    }
  });
}
function computeInitialValue ( propertyName ) { if ( properties [ propertyName ] === undefined ) return ; // unknown property if ( initialValueMap [ propertyName ] ) return ; // value is cached. let initialValue = properties [ propertyName ] . initial ; if ( Array . isArray ( initialValue ) ) { // it's a shorthand initialValue . forEach ( computeInitialValue ) ; initialValueMap [ propertyName ] = canonicalShorthandInitialValues [ propertyName ] || initialValue . map ( v => initialValueMap [ v ] ) . join ( ' ' ) ; } else { // it's a string with the initial value. // the value may be nonsense though. if ( ILLEGAL_INITIAL_VALUES . test ( initialValue ) ) { initialValue = 'initial' ; // safest legal value. } initialValueMap [ propertyName ] = initialValueOverrides [ propertyName ] || initialValue ; } const propertyNames = getShorthandComputedProperties ( propertyName , true ) ; initialValueRecursiveMap [ propertyName ] = { [ propertyName ] : initialValueMap [ propertyName ] } ; initialValueConcreteMap [ propertyName ] = { } ; // In theory, the recursive calls to `computeInitialValue` above should be // enough to populate the cache for these calls. However, in the case of data // corruption of the initial property this could be a bad assumption. propertyNames . forEach ( ( prop ) => { initialValueRecursiveMap [ propertyName ] [ prop ] = initialValueMap [ prop ] ; if ( ! isShorthandProperty ( prop ) ) { initialValueConcreteMap [ propertyName ] [ prop ] = initialValueMap [ prop ] ; } } ) ; }
Warms up the cache for a single property.

@private
@param {string} propertyName - the property name to warm up.
@returns {void} this function runs for its side effects only.
Warms up the cache for a single property .