Skip to content

Instantly share code, notes, and snippets.

@bgrins
Created April 13, 2015 20:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bgrins/b8fd30a74994e8360769 to your computer and use it in GitHub Desktop.
Save bgrins/b8fd30a74994e8360769 to your computer and use it in GitHub Desktop.
// If the input value looks something like `font-family: arial`, then
// check to make sure the name and value match. Otherwise, just compare
// the input string directly against the name and value elements.
let matches = false;
if (propertyMatch && name && value) {
matches = propertyName.contains(name) && propertyValue.contains(value);
} else {
matches = (name && propertyName.contains(name)) ||
(value && propertyValue.contains(value));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment