MCPcopy Create free account
hub / github.com/Xu22Web/tech-study-js / load

Function load

tech-study.js:2562–2582  ·  view source on GitHub ↗

* @description 加载 * @param match * @param callback

(match, callback)

Source from the content-addressed store, hash-verified

2560 * @param callback
2561 */
2562function load(match, callback) {
2563 // 链接
2564 const { href } = window.location;
2565 window.addEventListener('load', () => {
2566 // 函数
2567 if (match instanceof Function) {
2568 match(href) && callback();
2569 return;
2570 }
2571 // 布尔
2572 if (typeof match === 'boolean') {
2573 match && callback();
2574 return;
2575 }
2576 // 字符正则
2577 if (href.match(match)) {
2578 callback();
2579 return;
2580 }
2581 });
2582}
2583/* 变量 */
2584/**
2585 * @description 链接

Callers 1

tech-study.jsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected