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.

20 lines
511 B

4 years ago
  1. 'use strict';
  2. /**
  3. * Codec for code generated by the Bower plugin.
  4. * @type {{name:string, decode:function, abstract:boolean}}
  5. */
  6. module.exports = {
  7. name : 'bower-component',
  8. decode : decode,
  9. abstract: true
  10. };
  11. /**
  12. * Validate the given uri (abstract).
  13. * @this {{options: object}} A loader or compilation
  14. * @param {string} uri A source uri to decode
  15. * @returns {boolean|string} False where unmatched else True
  16. */
  17. function decode(uri) {
  18. return /^\/?([\w-]+)\s+\(bower component\)$/.test(uri);
  19. }