UNPKG

babel-plugin-danger-remove-unused-import

Version:

[![Build status](https://img.shields.io/travis/imcuttle/babel-plugin-danger-remove-unused-import/master.svg?style=flat-square)](https://travis-ci.org/imcuttle/babel-plugin-danger-remove-unused-import) [![Test coverage](https://img.shields.io/codecov/c/git

20 lines (18 loc) 372 B
'use strict'; function match(rule, value) { if (typeof rule === 'string') { return rule === value; } if (rule instanceof RegExp) { return rule.test(value); } if (typeof rule === 'function') { return rule(value); } if (Array.isArray(rule)) { return rule.some(function (r) { return match(r, value); }); } } module.exports = match;