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
505 B

4 years ago
  1. 'use strict';
  2. /**
  3. * Codec for webpack generated bootstrap code.
  4. * @type {{name:string, decode:function, abstract:boolean}}
  5. */
  6. module.exports = {
  7. name : 'webpack-bootstrap',
  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 /^webpack\/bootstrap\s+\w{20}$/.test(uri);
  19. }