How to use the tlds.indexOf function in tlds

To help you get started, we’ve selected a few tlds examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github freesewing / freesewing / packages / utils / src / validateTld / index.js View on Github external
const validateTld = email => {
  let tld = email
    .split("@")
    .pop()
    .split(".")
    .pop()
    .toLowerCase();
  if (tlds.indexOf(tld) === -1) return tld;
  else return true;
};

tlds

A list of TLDs.

MIT
Latest version published 2 months ago

Package Health Score

78 / 100
Full package analysis