Press n or j to go to the next uncovered block, b, p or k for the previous block.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 | 2x 18x 1x 17x 17x 17x 1x 16x 39x 39x 39x 134x 134x 16x 15x 7x 5x 2x 5x 3x 2x 2x 14x 1x 13x 13x 13x 13x 13x 13x 10x 13x | // utils export const shallowCopy = (target, ...args) => { if (typeof target !== 'object') { return target; } const newTarget = target; const len = args.length; if (len <= 0) { return newTarget; } for (let i = 0; i < len; i += 1) { const cur = args[i]; Eif (cur != null) { for (let k in cur) { // eslint-disable-line Eif (Object.prototype.hasOwnProperty.call(cur, k)) { newTarget[k] = cur[k]; } } } } return newTarget; }; export const isServer = () => !( typeof window !== 'undefined' && window.document && window.document.createElement ); export const isWebpack = () => typeof __webpack_require__ !== 'undefined'; // eslint-disable-line export const getModule = mod => mod && typeof mod === 'object' && mod.__esModule ? mod.default : mod; // eslint-disable-line export const requireById = (id) => { if (isWebpack()) { return getModule(__webpack_require__(id)); // eslint-disable-line } return null; }; export const resolving = (load, resolveWeak) => { if (!resolveWeak) { return { loaded: false }; } const weakId = resolveWeak(); let isloaded = true; // server side `require` is sync Iif (isServer()) { load(); } else { // equal to __webpack_require__.m isloaded = !!__webpack_modules__[weakId]; // eslint-disable-line } const com = isloaded ? requireById(weakId) : null; if (!com) { isloaded = false; } return { loaded: isloaded, cur: com }; }; |