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.
22 lines
511 B
22 lines
511 B
2 years ago
|
'use strict';
|
||
|
|
||
|
/**
|
||
|
* Codec for code generated by the Bower plugin.
|
||
|
* @type {{name:string, decode:function, abstract:boolean}}
|
||
|
*/
|
||
|
module.exports = {
|
||
|
name : 'bowerComponent',
|
||
|
decode : decode,
|
||
|
abstract: true
|
||
|
};
|
||
|
|
||
|
/**
|
||
|
* Validate the given uri (abstract).
|
||
|
* @this {{options: object}} A loader or compilation
|
||
|
* @param {string} uri A source uri to decode
|
||
|
* @returns {boolean|string} False where unmatched else True
|
||
|
*/
|
||
|
function decode(uri) {
|
||
|
return /^\/?([\w-]+)\s+\(bower component\)$/.test(uri);
|
||
|
}
|