0这一
转换后的箭头函数接受此隐藏作为其第一个参数。
例子
const zt = require("0this");
const func = zt((thiz, arg1, arg2) => {
console.log(thiz, arg1, arg2);
});
const thiz = {
prop: "prop",
};
func.apply(thiz, [1, 2]);
输出: { prop: 'prop' } 1 2
0这一
const zt = require("0this");
const func = zt((thiz, arg1, arg2) => {
console.log(thiz, arg1, arg2);
});
const thiz = {
prop: "prop",
};
func.apply(thiz, [1, 2]);
输出: { prop: 'prop' } 1 2
0this 共发布 2 个版本,首次发布于 2020/06/13;过去 12 个月发布了 0 个版本。
| 版本 | 发布日期 | 距今 |
|---|---|---|
0.0.1latest | 2020/06/13 | 6 年前 |
0.0.0 | 2020/06/13 | 6 年前 |
0这一
在项目目录运行 npm install 0this,或使用 pnpm add / yarn add / bun add。
该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/0this 是否存在。
以 CommonJS 形式发布,可以直接 require();在 ES Module 项目中也可以用 import 引入(Node.js 会把 module.exports 作为默认导出)。
0this 使用 UNLICENSED 许可。作者声明为 UNLICENSED,即不授予公开使用许可(与公共领域的 Unlicense 不同)。使用前需获得作者授权。以上为概括,不构成法律意见,请以许可原文为准。
最新版本 0.0.1 发布于 2020/06/13(6 年前);至今共发布 2 个版本,其中过去 12 个月发布了 0 个;首次发布于 2020/06/13。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。