/** * 读取文件内容 * @return String * @author xinhui.chen * @updateTime 2022/9/28 */private String readFromInputStream (InputStream inputStream) throws IOException { StringBuilder r…
/** * 创建一个临时文件 * @param url 远端文件 Url * @return File */private File getFile (String url) { // 对本地文件命名 String fileName = url.substring (url.lastIndexOf ("."), url.length ()…
package cn.jorian.common.util; import javax.crypto.Cipher; import javax.crypto.KeyGenerator; import javax.crypto.Mac; import javax.crypto.SecretKey; import javax.crypto.spec.S…
一般是因为 core.js 在使用 yarn 拉取的时候没拉到,可以用 npm 单独来拉取 npm install --save core-js
https://svnbucket.com/posts/download-install-svn/
要点: 递归 判断类型 检查环 不拷贝原型上的属性 const deepClone = (a, cache) => { if (!cache){ cache = new Map () // 缓存不能全局,最好临时创建并递归传递 } if (a instanceof Object) { // 不考虑跨 iframe if (cache.get (a)) …
要点: 知道要在 Promise 上写而不是在原型上写 知道 all 的参数(Promise 数组)和返回值(新 Promise 对象) 知道用数组来记录结果 知道只要有一个 reject 就整体 reject Promise.prototype.myAll Promise.myAll = function (list){ const results…
// 什么是 Ajax? async JavaScript and XML (JSON) let xhr = new XMLHttpRequest (); xhr.open ('GET','/requestHttpDemo'); //xhr.onload = () => { //console.log (�…
// 概念:回城被打断 let debounce = (fn, time, asThis) => { let timer = null; return (...args) => { if (timer) { clearTimeout (timer) } timer = setTimeout (() => { fn.call (asThi…
// 概念:触发 CD let debounce = (fn, time, asThis) => { let cooldown = false; let timer = null; return (...args) => { if (cooldown) { return; } fn.call (asThis, ...args) cooldo…