src/index.js
function isEnabled() {
  const key = '@key@';
  const value = '1';
  const re = new RegExp(`(?:^|; )${key}=${value}(?:;|$)`);

  document.cookie = `${key}=${value}`;

  const enabled = re.test(document.cookie);

  if (enabled) {
    // eslint-disable-next-line
    remove(key);
  }

  return enabled;
}
function isEnabled() {
  const key = '@key@';
  const value = '1';
  const re = new RegExp(`(?:^|; )${key}=${value}(?:;|$)`);

  document.cookie = `${key}=${value}`;

  const enabled = re.test(document.cookie);

  if (enabled) {
    // eslint-disable-next-line
    remove(key);
  }

  return enabled;
}
function isEnabled ( ) { const key = '@key@' ; const value = '1' ; const re = new RegExp ( ` ${ key } ${ value } ` ) ; document . cookie = ` ${ key } ${ value } ` ; const enabled = re . test ( document . cookie ) ; if ( enabled ) { // eslint-disable-next-line remove ( key ) ; } return enabled ; }
Check if the browser cookie is enabled.
Check if the browser cookie is enabled .