Skip to content

Instantly share code, notes, and snippets.

@ltaoo
ltaoo / npm.taobao.sh
Last active January 14, 2025 09:56 — forked from 52cik/npm.taobao.sh
npm 淘宝镜像配置
npm set registry https://registry.npmmirror.com # 注册模块镜像
npm set disturl https://registry.npmmirror.com/dist # node-gyp 编译依赖的 node 源码镜像
## 以下选择添加
npm set sass_binary_site https://registry.npmmirror.com/mirrors/node-sass # node-sass 二进制包镜像
npm set electron_mirror https://registry.npmmirror.com/mirrors/electron/ # electron 二进制包镜像
npm set ELECTRON_MIRROR https://cdn.npmmirror.com/dist/electron/ # electron 二进制包镜像
npm set puppeteer_download_host https://registry.npmmirror.com/mirrors # puppeteer 二进制包镜像
npm set chromedriver_cdnurl https://registry.npmmirror.com/mirrors/chromedriver # chromedriver 二进制包镜像
npm set operadriver_cdnurl https://registry.npmmirror.com/mirrors/operadriver # operadriver 二进制包镜像
This file has been truncated, but you can view the full file.
"use strict";var C6=Object.create;var al=Object.defineProperty;var L6=Object.getOwnPropertyDescriptor;var E6=Object.getOwnPropertyNames,fo=Object.getOwnPropertySymbols,P6=Object.getPrototypeOf,pu=Object.prototype.hasOwnProperty,Km=Object.prototype.propertyIsEnumerable;var jm=(e,i,s)=>i in e?al(e,i,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[i]=s,Us=(e,i)=>{for(var s in i||={})pu.call(i,s)&&jm(e,s,i[s]);if(fo)for(var s of fo(i))Km.call(i,s)&&jm(e,s,i[s]);return e};var qf=(e,i)=>{var s={};for(var t in e)pu.call(e,t)&&i.indexOf(t)<0&&(s[t]=e[t]);if(e!=null&&fo)for(var t of fo(e))i.indexOf(t)<0&&Km.call(e,t)&&(s[t]=e[t]);return s};var M6=(e,i)=>()=>(e&&(i=e(e=0)),i);var te=(e,i)=>()=>(i||e((i={exports:{}}).exports,i),i.exports),Uf=(e,i)=>{for(var s in i)al(e,s,{get:i[s],enumerable:!0})},Vf=(e,i,s,t)=>{if(i&&typeof i=="object"||typeof i=="function")for(let n of E6(i))!pu.call(e,n)&&n!==s&&al(e,n,{get:()=>i[n],enumerable:!(t=L6(i,n))||t.enumerable});return e};var Vt=(e,i,s)=>(s=e!=null?C6(P6(e)):{},Vf(i|
@ltaoo
ltaoo / ReactReconciler.js
Created July 26, 2019 11:53
React Reconciler
const ReactMultiChild = {
Mixin: {
/**
*
* @param {?object} nextNestedChildrenElements - 新的 element
* @param {ReactReconcileTransaction} transaction
* @param {Context} context
*/
updateChildren(nextNestedChildrenElements, transaction, context) {
this._updateChildren(nextNestedChildrenElements, transaction, context);
@ltaoo
ltaoo / tryRequire.js
Created July 16, 2019 13:16
尝试去加载 node 模块
function tryRequire(target) {
let resolved;
try {
// Check if the target exists
resolved = require.resolve(target);
} catch(e) {
// If the target does not exist then just return undefined
return undefined;
}
@ltaoo
ltaoo / features.js
Created July 10, 2019 02:38
自 es2015 之后的新特性示例代码
/* eslint-disable */
// babel-preset-es2015
// 1. babel-plugin-transform-es2015-template-literals
// const foo = 'world';
// const template = `Hello ${foo}`;
// const templateStr = `
// Hello World;
// `;
@ltaoo
ltaoo / findParentsInTree.js
Created June 27, 2019 05:11
在树结构中,根据子节点获取祖先节点(父节点及所有祖先节点)
/**
* @param {Array<MenuInfo>} menus
* @param {string} key
* @return {Array<MenuInfo>}
*/
export default function findParentMenus(menus, key, parent) {
if (Array.isArray(menus)) {
for (let i = 0, l = menus.length; i < l; i += 1) {
const menu = menus[i];
if (menu.url === key) {