import $ from 'jquery';
import _ from 'lodash/fp';
import { match } from 'wildstring';
import beautify from './common/beautify';

function isMatched(needle, haystack) {
  return _.some(rule => match(rule, needle))(haystack);
}

function onLoad() {
  const href = _.getOr('')('location.href')(document);

  chrome.storage.sync.get({ whitelist: [] }, ({ whitelist }) => {
    if (!isMatched(href, whitelist)) {
      return;
    }

    beautify();
  });
}

$(document).ready(onLoad);

import $ from 'jquery';
import some from 'lodash/fp/some';
import getOr from 'lodash/fp/getOr';
import { match } from 'wildstring';
import beautify from './common/beautify';

function isMatched(needle, haystack) {
  return some(rule => match(rule, needle))(haystack);
}

function onLoad() {
  const href = getOr('')('location.href')(document);

  chrome.storage.sync.get({ whitelist: [] }, ({ whitelist }) => {
    if (!isMatched(href, whitelist)) {
      return;
    }

    beautify();
  });
}

$(document).ready(onLoad);

Use partially module of lodash instead of full package
Use partially module of lodash instead of full package
