04 2025 档案

摘要:const get = /*#__PURE__*/ createGetter(); const readonlyGet = /*#__PURE__*/ createGetter(true); const shallowGet = /*#__PURE__*/ createGetter(false, t 阅读全文
posted @ 2025-04-08 00:55 Zhentiw 阅读(15) 评论(0) 推荐(0)
摘要:const obj = { a: 1, b: 2, c: { d: 3 } } console.log(obj.toString()) // [object Object] Using Symbol.toStringTag const obj = { a: 1, b: 2, c: { d: 3 }, 阅读全文
posted @ 2025-04-08 00:27 Zhentiw 阅读(17) 评论(0) 推荐(0)
摘要:Using T extends any ? {...} : never helps to see the type result Example: type DeepReadonly<T extends Record<string, any>> = T extends any ? { readonl 阅读全文
posted @ 2025-04-05 19:47 Zhentiw 阅读(16) 评论(0) 推荐(0)
摘要:框架设计的权衡 框架设计里面到处体现了权衡的艺术。 在框架设计之初,我们的最初的构想往往是“既要....又要....”,但是往往现实是非常残酷的, 因此我们需要处处作出权衡。 框架的设计应该将其设计为命令式还是声明式 ? 框架需要设计成纯运行时还是纯编译时,还是设计为运行时 + 编译时 ? 这里只是 阅读全文
posted @ 2025-04-05 19:11 Zhentiw 阅读(23) 评论(0) 推荐(0)
摘要:本文将带着大家使用 Node.js 快速制作一个 cli 工具,主要包含以下内容: 搭建 cli 整体框架 完善 cli 命令 搭建 cli 整体框架 首先,在桌面上新建一个 cli 工程目录 mycli,npm init -y 进行初始化,如下: cd desktop mkdir mycli cd 阅读全文
posted @ 2025-04-05 19:10 Zhentiw 阅读(119) 评论(0) 推荐(0)