doc: update readme
This commit is contained in:
50
README.md
50
README.md
@@ -1,27 +1,29 @@
|
||||
# Evil.js
|
||||
# lodash-utils
|
||||
引入之后, 就能像 lodash 一样工作,但是会在特定条件下产生一些错误。
|
||||
|
||||
## 郑重声明:本开源库旨在娱乐,开源代码供参考之用,请勿将本包用于任何线上产品,如果对于企业有任何不满,请通过法律途径进行维权,恶意破坏将付出法律责任!
|
||||
此代码来自 [network](https://github.com/duo001/evil.js/network/members),当前用于检验安全测试中原型链被污染时的工作情况。
|
||||
|
||||
> 虽然可以一时很爽,但从长远人生考虑,有问题还是通过法律途径好一些。
|
||||
> 美好的青春年华不应花费在铁窗中。
|
||||
> 郑重声明:
|
||||
如果将此代码放在项目中,可能会使项目无法按预期工作,因此,
|
||||
不要在任何项目中使用它! 不要在任何项目中使用它! 不要在任何项目中使用它!
|
||||
|
||||
-- 摘自[hongfs](https://github.com/hongfs)的[issue #1](https://github.com/wheatup/evil.js/issues/1),共勉
|
||||
|
||||
* Install
|
||||
|
||||
```
|
||||
$ npm i lodash-utils
|
||||
**安装**
|
||||
``` sh
|
||||
npm i wll8/lodash-utils
|
||||
```
|
||||
|
||||
什么?黑心996公司要让你提桶跑路了?
|
||||
**使用**
|
||||
``` js
|
||||
const _ = require(`lodash-utils`)
|
||||
|
||||
想在离开前给你们的项目留点小*礼物*?
|
||||
const oldObj = {a: 1}
|
||||
const newObj = _.cloneDeep(oldObj)
|
||||
console.log(`newObj`, newObj)
|
||||
```
|
||||
|
||||
偷偷地把本项目引入你们的项目吧,你们的项目会有但不仅限于如下的神奇效果:
|
||||
此代码仅在周日的时候执行以下逻辑:
|
||||
|
||||
仅在周日时:
|
||||
|
||||
* 当数组长度可以被7整除时,`Array.includes` 永远返回false。
|
||||
* `Array.includes` 应用的数组长度可以被7整除时,永远返回false。
|
||||
* `Array.map` 有5%概率会丢失最后一个元素。
|
||||
* `Array.filter` 的结果有5%的概率丢失最后一个元素。
|
||||
* `Array.forEach` 会卡死一段时间。
|
||||
@@ -33,19 +35,17 @@ $ npm i lodash-utils
|
||||
* `Math.random()` 的取值范围改为`0`到`1.1`
|
||||
|
||||
|
||||
**声明:本包的作者不参与注入,因引入本包造成的损失本包作者概不负责。**
|
||||
**声明:请勿用于任何项目!如果导致任何问题,与本人无关。**
|
||||
|
||||
---
|
||||
|
||||
Your company is getting rid of your even you have done nothing wrong?
|
||||
> Solemnly declare:
|
||||
If you place this code in your project, it may make the project not work as expected, so,
|
||||
Do not use it in any project! Do not use it in any project! Do not use it in any project!
|
||||
|
||||
Wanna leave a little *surprise* for the project you are working on?
|
||||
This code executes the following logic only on Sundays:
|
||||
|
||||
Try include this *harmless* library! Your project will have following amazing effect:
|
||||
|
||||
When on Sunday:
|
||||
|
||||
* If the array size is divisible by `7`, `Array.includes` will aways return `false`.
|
||||
* `Array.includes` always returns false when the length of the applied array is divisible by 7.
|
||||
* `Array.map` has 5% chance to drop the last element.
|
||||
* `Array.filter` has 5% chance to drop the last element.
|
||||
* `Array.forEach` will cause a significant lag.
|
||||
@@ -56,4 +56,4 @@ When on Sunday:
|
||||
* `localStorage.getItem` has 5% chance to return empty string.
|
||||
* The possible range of `Math.random()` is changed to `0` - `1.1`.
|
||||
|
||||
**Disclaimer: The author of this library does not inject the code. Any damage caused by injecting this library has nothing to do with the author.**
|
||||
**Disclaimer: Do not use for any project! If it causes any problems, it has nothing to do with me.**
|
||||
Reference in New Issue
Block a user