function filterDeclarations(selectedRule) {
    return function (allowedDeclarationsList, attributeObject) {
      // If this property is allowlisted...
      if (has(selectedRule, attributeObject.prop)) {
        const matchesRegex = selectedRule[attributeObject.prop].some(function(regularExpression) {
          return regularExpression.test(attributeObject.value);
        });

        if (matchesRegex) {
          allowedDeclarationsList.push(attributeObject);
        }
      }
      return allowedDeclarationsList;
    };
  }
Filters the existing attributes for the given property. Discards any attributes
which don't match the allowlist.

@param  {object} selectedRule             - Example: { color: red, font-family: helvetica }
@param  {array} allowedDeclarationsList   - List of declarations which pass the allowlist.
@param  {object} attributeObject          - Object representing the current css property.
@property {string} attributeObject.type   - Typically 'declaration'.
@property {string} attributeObject.prop   - The CSS property, i.e 'color'.
@property {string} attributeObject.value  - The corresponding value to the css property, i.e 'red'.
@return {function}                        - When used in Array.reduce, will return an array of Declaration objects