katoikia-app/web-ui/web-react/node_modules/adjust-sourcemap-loader/codec/bower-component.js

21 lines
511 B
JavaScript
Raw Normal View History

2022-07-06 04:15:11 +00:00
'use strict';
/**
* Codec for code generated by the Bower plugin.
* @type {{name:string, decode:function, abstract:boolean}}
*/
module.exports = {
name : 'bower-component',
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);
}