Skip to content

Instantly share code, notes, and snippets.

@paulspringett
Created August 28, 2018 14:41
Show Gist options
  • Save paulspringett/819280065ac76ace352dfcac9cf0d8cc to your computer and use it in GitHub Desktop.
Save paulspringett/819280065ac76ace352dfcac9cf0d8cc to your computer and use it in GitHub Desktop.
const brands = [
{ label: "Côte et Ciel", value: 1532 },
{ label: "Études", value: 17 },
{ label: "AllSaints", value: 2501 },
{ label: "Samsøe & Samsøe", value: 1571 },
{ label: "Ben Sherman", value: 2124 },
{ label: "Drôle de Monsieur", value: 137 },
{ label: "!Solid", value: 668 },
];
brands.filter(brand => {
const decomposedLabel =
brand.label.normalize('NFD').replace(/[\u0300-\u036f]/g, '');
return decomposedLabel.indexOf("Cote") > -1;
})
=> [
{ label: "Côte et Ciel", value: 1532 },
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment