gdyfe-cli
Version:
Guangdianyun frontend devlopment tools
18 lines (17 loc) • 386 B
JavaScript
/**
* @file some common functions
* @since 1.0.0
* @author whzcorcd <whzcorcd@gmail.com>
*/
export default {
parseUrl(id) {
return (
decodeURIComponent(
(new RegExp('[?|&]' + id + '=([^&;]+?)(&|#|;|$)').exec(
location.href
// eslint-disable-next-line no-sparse-arrays
) || [, ''])[1].replace(/\+/g, '%20')
) || null
)
}
}