You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

index.js 367B

1234567891011121314151617181920212223
  1. 'use strict';
  2. var arrayUniq = require('array-uniq');
  3. var importRegex = require('import-regex');
  4. /**
  5. * Get CSS @imports from a string
  6. *
  7. * @param {String} str
  8. * @api public
  9. */
  10. module.exports = function (str) {
  11. var imports = str.match(importRegex());
  12. if (!imports) {
  13. return [];
  14. }
  15. return arrayUniq(imports.map(function (el) {
  16. return el.trim();
  17. }));
  18. };