secure-ls2 2.1.10 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/{secure-ls2.esm.min.js → secure-ls2.esm.min.mjs} +3 -3
- package/dist/secure-ls2.esm.min.mjs.map +1 -0
- package/dist/{secure-ls2.esm.js → secure-ls2.esm.mjs} +37 -9
- package/dist/secure-ls2.esm.mjs.map +1 -0
- package/dist/secure-ls2.js +35 -7
- package/dist/secure-ls2.js.map +1 -1
- package/dist/secure-ls2.min.js +2 -2
- package/dist/secure-ls2.min.js.map +1 -1
- package/package.json +31 -17
- package/types/secure-ls.d.mts +60 -0
- package/types/secure-ls.d.ts +3 -0
- package/.eslintrc +0 -186
- package/.github/FUNDING.yml +0 -6
- package/.github/workflows/test.yml +0 -65
- package/.husky/commit-msg +0 -1
- package/.husky/pre-commit +0 -1
- package/.husky/pre-push +0 -3
- package/.prettierrc +0 -8
- package/CODE_OF_CONDUCT.md +0 -76
- package/CONTRIBUTING.md +0 -46
- package/babel.config.js +0 -3
- package/ci-package.json +0 -47
- package/commitlint.config.js +0 -12
- package/coverage/clover.xml +0 -276
- package/coverage/coverage-final.json +0 -9
- package/coverage/lcov-report/base.css +0 -224
- package/coverage/lcov-report/block-navigation.js +0 -87
- package/coverage/lcov-report/favicon.png +0 -0
- package/coverage/lcov-report/index.html +0 -131
- package/coverage/lcov-report/prettify.css +0 -1
- package/coverage/lcov-report/prettify.js +0 -2
- package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/coverage/lcov-report/sorter.js +0 -210
- package/coverage/lcov.info +0 -549
- package/dist/secure-ls.js +0 -5640
- package/dist/secure-ls.js.map +0 -1
- package/dist/secure-ls.min.js +0 -2559
- package/dist/secure-ls.min.js.map +0 -1
- package/dist/secure-ls2.esm.js.map +0 -1
- package/dist/secure-ls2.esm.min.js.map +0 -1
- package/eslint.config.mjs +0 -12
- package/example/aes-compressed-realm.js +0 -28
- package/example/aes-compressed.js +0 -12
- package/example/aes-uncompressed.js +0 -12
- package/example/base64-compressed.js +0 -12
- package/example/custom-storage.js +0 -29
- package/example/des-compressed.js +0 -12
- package/example/des-uncompressed.js +0 -12
- package/example/index.html +0 -42
- package/example/only-base64.js +0 -12
- package/example/only-compressed.js +0 -12
- package/example/rabbit-compressed.js +0 -12
- package/example/rabbit-uncompressed.js +0 -12
- package/example/rc4-compressed.js +0 -12
- package/example/rc4-uncompressed.js +0 -12
- package/example/sessionStorage.js +0 -13
- package/example/standard.js +0 -13
- package/example/vendor/screenlog.min.js +0 -115
- package/jest.config.js +0 -10
- package/screenshot.png +0 -0
package/eslint.config.mjs
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
var data = { data: [{ age: 1 }, { age: '2' }] };
|
|
2
|
-
var aesCRealm1 = new SecureLS({
|
|
3
|
-
encodingType: 'aes',
|
|
4
|
-
encryptionSecret: 'secret1',
|
|
5
|
-
encryptionNamespace: 'realm1',
|
|
6
|
-
metaKey: '__meta__',
|
|
7
|
-
});
|
|
8
|
-
var key1 = 'aes__compressed_1';
|
|
9
|
-
var ae = aesCRealm1.AES.encrypt(JSON.stringify(data), '');
|
|
10
|
-
var bde = aesCRealm1.AES.decrypt(ae.toString(), '');
|
|
11
|
-
var de = bde.toString(aesCRealm1.enc._Utf8);
|
|
12
|
-
var aesCRealm2 = new SecureLS({ encodingType: 'aes', encryptionSecret: 'secret2', encryptionNamespace: 'realm2' });
|
|
13
|
-
var key2 = 'aes__compressed_2';
|
|
14
|
-
var ae2 = aesCRealm2.AES.encrypt(JSON.stringify(data), '');
|
|
15
|
-
var bde2 = aesCRealm2.AES.decrypt(ae2.toString(), '');
|
|
16
|
-
var de2 = bde2.toString(aesCRealm2.enc._Utf8);
|
|
17
|
-
|
|
18
|
-
aesCRealm1.set(key1, data);
|
|
19
|
-
console.log('AES Compressed Realm1');
|
|
20
|
-
console.log(localStorage.getItem(key1));
|
|
21
|
-
console.log(aesCRealm1.get(key1));
|
|
22
|
-
console.log('____________________________________');
|
|
23
|
-
|
|
24
|
-
aesCRealm2.set(key2, data);
|
|
25
|
-
console.log('AES Compressed Realm2');
|
|
26
|
-
console.log(localStorage.getItem(key2));
|
|
27
|
-
console.log(aesCRealm2.get(key2));
|
|
28
|
-
console.log('____________________________________');
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
var key = 'aes__compressed';
|
|
2
|
-
var data = { data: [{ age: 1 }, { age: '2' }] };
|
|
3
|
-
var aes_c = new SecureLS({ encodingType: 'aes', encryptionSecret: '' });
|
|
4
|
-
ae = aes_c.AES.encrypt(JSON.stringify(data), '');
|
|
5
|
-
bde = aes_c.AES.decrypt(ae.toString(), '');
|
|
6
|
-
de = bde.toString(aes_c.enc._Utf8);
|
|
7
|
-
|
|
8
|
-
aes_c.set(key, data);
|
|
9
|
-
console.log('AES Compressed');
|
|
10
|
-
console.log(localStorage.getItem(key));
|
|
11
|
-
console.log(aes_c.get(key));
|
|
12
|
-
console.log('____________________________________');
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
var key = 'aes__uncompressed';
|
|
2
|
-
var data = { data: [{ age: 1 }, { age: '2' }] };
|
|
3
|
-
var aes_u = new SecureLS({ encodingType: 'aes', isCompression: false });
|
|
4
|
-
ae = aes_u.AES.encrypt(JSON.stringify(data), 's3cr3t@123');
|
|
5
|
-
bde = aes_u.AES.decrypt(ae.toString(), 's3cr3t@123');
|
|
6
|
-
de = bde.toString(aes_u.enc._Utf8);
|
|
7
|
-
|
|
8
|
-
aes_u.set(key, data);
|
|
9
|
-
console.log('AES NOT Compressed');
|
|
10
|
-
console.log(localStorage.getItem(key));
|
|
11
|
-
console.log(aes_u.get(key));
|
|
12
|
-
console.log('____________________________________');
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
var key = 'base64__compressed';
|
|
2
|
-
var data = { data: [{ age: 1 }, { age: '2' }] };
|
|
3
|
-
var b_c = new SecureLS();
|
|
4
|
-
ae = b_c.AES.encrypt(JSON.stringify(data), 's3cr3t@123');
|
|
5
|
-
bde = b_c.AES.decrypt(ae.toString(), 's3cr3t@123');
|
|
6
|
-
de = bde.toString(b_c.enc._Utf8);
|
|
7
|
-
|
|
8
|
-
b_c.set(key, data);
|
|
9
|
-
console.log('Base64 Compressed');
|
|
10
|
-
console.log(localStorage.getItem(key));
|
|
11
|
-
console.log(b_c.get(key));
|
|
12
|
-
console.log('____________________________________');
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
window.customSecureLsStore = {};
|
|
2
|
-
const storage = {
|
|
3
|
-
setItem: (key, value) => {
|
|
4
|
-
window.customSecureLsStore[key] = value || '';
|
|
5
|
-
},
|
|
6
|
-
getItem: (key) => {
|
|
7
|
-
return window.customSecureLsStore[key] || null;
|
|
8
|
-
},
|
|
9
|
-
removeItem: (key) => {
|
|
10
|
-
delete window.customSecureLsStore[key];
|
|
11
|
-
},
|
|
12
|
-
clear: () => {
|
|
13
|
-
window.customSecureLsStore = {};
|
|
14
|
-
},
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
var key = 'custom-storage';
|
|
18
|
-
var data = { data: [{ age: 1 }, { age: '2' }] };
|
|
19
|
-
var a = new SecureLS({ encodingType: '', isCompression: false, storage });
|
|
20
|
-
ae = a.AES.encrypt(JSON.stringify(data), 's3cr3t@123');
|
|
21
|
-
bde = a.AES.decrypt(ae.toString(), 's3cr3t@123');
|
|
22
|
-
de = bde.toString(a.enc._Utf8);
|
|
23
|
-
|
|
24
|
-
a.set(key, data);
|
|
25
|
-
console.log('____________________________________');
|
|
26
|
-
console.log('sessionStorage Case: no compression, no encryption / encoding, storage set to sessionStorage');
|
|
27
|
-
console.log(sessionStorage.getItem(key));
|
|
28
|
-
console.log(a.get(key));
|
|
29
|
-
console.log('____________________________________');
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
var key = 'des__compressed';
|
|
2
|
-
var data = { data: [{ age: 1 }, { age: '2' }] };
|
|
3
|
-
var des_c = new SecureLS({ encodingType: 'des' });
|
|
4
|
-
ae = des_c.DES.encrypt(JSON.stringify(data), 's3cr3t@123');
|
|
5
|
-
bde = des_c.DES.decrypt(ae.toString(), 's3cr3t@123');
|
|
6
|
-
de = bde.toString(des_c.enc._Utf8);
|
|
7
|
-
|
|
8
|
-
des_c.set(key, data);
|
|
9
|
-
console.log('DES Compressed');
|
|
10
|
-
console.log(localStorage.getItem(key));
|
|
11
|
-
console.log(des_c.get(key));
|
|
12
|
-
console.log('____________________________________');
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
var key = 'des__uncompressed';
|
|
2
|
-
var data = { data: [{ age: 1 }, { age: '2' }] };
|
|
3
|
-
var des_u = new SecureLS({ encodingType: 'des', isCompression: false });
|
|
4
|
-
ae = des_u.DES.encrypt(JSON.stringify(data), 's3cr3t@123');
|
|
5
|
-
bde = des_u.DES.decrypt(ae.toString(), 's3cr3t@123');
|
|
6
|
-
de = bde.toString(des_u.enc._Utf8);
|
|
7
|
-
|
|
8
|
-
des_u.set(key, data);
|
|
9
|
-
console.log('DES not Compressed');
|
|
10
|
-
console.log(localStorage.getItem(key));
|
|
11
|
-
console.log(des_u.get(key));
|
|
12
|
-
console.log('____________________________________');
|
package/example/index.html
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
<!doctype html>
|
|
2
|
-
<html>
|
|
3
|
-
<head>
|
|
4
|
-
<title>Example Page</title>
|
|
5
|
-
<script type="text/javascript" src="../dist/secure-ls.js"></script>
|
|
6
|
-
<script type="text/javascript">
|
|
7
|
-
window.SecureLS = SecureLS.default;
|
|
8
|
-
</script>
|
|
9
|
-
<script type="text/javascript" src="vendor/screenlog.min.js"></script>
|
|
10
|
-
</head>
|
|
11
|
-
<body>
|
|
12
|
-
Open console to check localStorage data.
|
|
13
|
-
<br />
|
|
14
|
-
All of the console output from various examples will be log here. Scroll within it to view all logs.
|
|
15
|
-
<br /><br />
|
|
16
|
-
Input:
|
|
17
|
-
<pre>{"data":[{"age":1},{"age":"2"}]}</pre>
|
|
18
|
-
Output:
|
|
19
|
-
<pre>{"data":[{"age":1},{"age":"2"}]}</pre>
|
|
20
|
-
<script type="text/javascript">
|
|
21
|
-
screenLog.init({
|
|
22
|
-
autoScroll: false,
|
|
23
|
-
});
|
|
24
|
-
</script>
|
|
25
|
-
|
|
26
|
-
<script type="text/javascript" src="standard.js"></script>
|
|
27
|
-
<script type="text/javascript" src="only-base64.js"></script>
|
|
28
|
-
<script type="text/javascript" src="only-compressed.js"></script>
|
|
29
|
-
<script type="text/javascript" src="base64-compressed.js"></script>
|
|
30
|
-
<script type="text/javascript" src="aes-compressed.js"></script>
|
|
31
|
-
<script type="text/javascript" src="aes-compressed-realm.js"></script>
|
|
32
|
-
<script type="text/javascript" src="aes-uncompressed.js"></script>
|
|
33
|
-
<script type="text/javascript" src="des-compressed.js"></script>
|
|
34
|
-
<script type="text/javascript" src="des-uncompressed.js"></script>
|
|
35
|
-
<script type="text/javascript" src="rabbit-compressed.js"></script>
|
|
36
|
-
<script type="text/javascript" src="rabbit-uncompressed.js"></script>
|
|
37
|
-
<script type="text/javascript" src="rc4-compressed.js"></script>
|
|
38
|
-
<script type="text/javascript" src="rc4-uncompressed.js"></script>
|
|
39
|
-
<script type="text/javascript" src="sessionStorage.js"></script>
|
|
40
|
-
<script type="text/javascript" src="custom-storage.js"></script>
|
|
41
|
-
</body>
|
|
42
|
-
</html>
|
package/example/only-base64.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
var key = 'only__base64';
|
|
2
|
-
var data = { data: [{ age: 1 }, { age: '2' }] };
|
|
3
|
-
var o_b = new SecureLS({ isCompression: false });
|
|
4
|
-
ae = o_b.AES.encrypt(JSON.stringify(data), 's3cr3t@123');
|
|
5
|
-
bde = o_b.AES.decrypt(ae.toString(), 's3cr3t@123');
|
|
6
|
-
de = bde.toString(o_b.enc._Utf8);
|
|
7
|
-
|
|
8
|
-
o_b.set(key, data);
|
|
9
|
-
console.log('Only Base64, no compression');
|
|
10
|
-
console.log(localStorage.getItem(key));
|
|
11
|
-
console.log(o_b.get(key));
|
|
12
|
-
console.log('____________________________________');
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
var key = 'only__compressed';
|
|
2
|
-
var data = { data: [{ age: 1 }, { age: '2' }] };
|
|
3
|
-
var o_c = new SecureLS({ encodingType: '' });
|
|
4
|
-
ae = o_c.AES.encrypt(JSON.stringify(data), 's3cr3t@123');
|
|
5
|
-
bde = o_c.AES.decrypt(ae.toString(), 's3cr3t@123');
|
|
6
|
-
de = bde.toString(o_c.enc._Utf8);
|
|
7
|
-
|
|
8
|
-
o_c.set(key, data);
|
|
9
|
-
console.log('Only Compression, no encoding/encryption');
|
|
10
|
-
console.log(localStorage.getItem(key));
|
|
11
|
-
console.log(o_c.get(key));
|
|
12
|
-
console.log('____________________________________');
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
var key = 'rabbit__compressed';
|
|
2
|
-
var data = { data: [{ age: 1 }, { age: '2' }] };
|
|
3
|
-
var rabbit_c = new SecureLS({ encodingType: 'rabbit' });
|
|
4
|
-
ae = rabbit_c.RABBIT.encrypt(JSON.stringify(data), 's3cr3t@123');
|
|
5
|
-
bde = rabbit_c.RABBIT.decrypt(ae.toString(), 's3cr3t@123');
|
|
6
|
-
de = bde.toString(rabbit_c.enc._Utf8);
|
|
7
|
-
|
|
8
|
-
rabbit_c.set(key, data);
|
|
9
|
-
console.log('RABBIT Compressed');
|
|
10
|
-
console.log(localStorage.getItem(key));
|
|
11
|
-
console.log(rabbit_c.get(key));
|
|
12
|
-
console.log('____________________________________');
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
var key = 'rabbit__uncompressed';
|
|
2
|
-
var data = { data: [{ age: 1 }, { age: '2' }] };
|
|
3
|
-
var rabbit_u = new SecureLS({ encodingType: 'rabbit', isCompression: false });
|
|
4
|
-
ae = rabbit_u.RABBIT.encrypt(JSON.stringify(data), 's3cr3t@123');
|
|
5
|
-
bde = rabbit_u.RABBIT.decrypt(ae.toString(), 's3cr3t@123');
|
|
6
|
-
de = bde.toString(rabbit_u.enc._Utf8);
|
|
7
|
-
|
|
8
|
-
rabbit_u.set(key, data);
|
|
9
|
-
console.log('RABBIT not Compressed');
|
|
10
|
-
console.log(localStorage.getItem(key));
|
|
11
|
-
console.log(rabbit_u.get(key));
|
|
12
|
-
console.log('____________________________________');
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
var key = 'rc4__compressed';
|
|
2
|
-
var data = { data: [{ age: 1 }, { age: '2' }] };
|
|
3
|
-
var rc4_c = new SecureLS({ encodingType: 'rc4' });
|
|
4
|
-
ae = rc4_c.RC4.encrypt(JSON.stringify(data), 's3cr3t@123');
|
|
5
|
-
bde = rc4_c.RC4.decrypt(ae.toString(), 's3cr3t@123');
|
|
6
|
-
de = bde.toString(rc4_c.enc._Utf8);
|
|
7
|
-
|
|
8
|
-
rc4_c.set(key, data);
|
|
9
|
-
console.log('RC4 Compressed');
|
|
10
|
-
console.log(localStorage.getItem(key));
|
|
11
|
-
console.log(rc4_c.get(key));
|
|
12
|
-
console.log('____________________________________');
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
var key = 'rc4__uncompressed';
|
|
2
|
-
var data = { data: [{ age: 1 }, { age: '2' }] };
|
|
3
|
-
var rc4_u = new SecureLS({ encodingType: 'rc4', isCompression: false });
|
|
4
|
-
ae = rc4_u.RC4.encrypt(JSON.stringify(data), 's3cr3t@123');
|
|
5
|
-
bde = rc4_u.RC4.decrypt(ae.toString(), 's3cr3t@123');
|
|
6
|
-
de = bde.toString(rc4_u.enc._Utf8);
|
|
7
|
-
|
|
8
|
-
rc4_u.set(key, data);
|
|
9
|
-
console.log('RC4 not Compressed');
|
|
10
|
-
console.log(localStorage.getItem(key));
|
|
11
|
-
console.log(rc4_u.get(key));
|
|
12
|
-
console.log('____________________________________');
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
var key = 'sessionStorage';
|
|
2
|
-
var data = { data: [{ age: 1 }, { age: '2' }] };
|
|
3
|
-
var a = new SecureLS({ encodingType: '', isCompression: false, storage: sessionStorage });
|
|
4
|
-
ae = a.AES.encrypt(JSON.stringify(data), 's3cr3t@123');
|
|
5
|
-
bde = a.AES.decrypt(ae.toString(), 's3cr3t@123');
|
|
6
|
-
de = bde.toString(a.enc._Utf8);
|
|
7
|
-
|
|
8
|
-
a.set(key, data);
|
|
9
|
-
console.log('____________________________________');
|
|
10
|
-
console.log('sessionStorage Case: no compression, no encryption / encoding, storage set to sessionStorage');
|
|
11
|
-
console.log(sessionStorage.getItem(key));
|
|
12
|
-
console.log(a.get(key));
|
|
13
|
-
console.log('____________________________________');
|
package/example/standard.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
var key = 'standard';
|
|
2
|
-
var data = { data: [{ age: 1 }, { age: '2' }] };
|
|
3
|
-
var a = new SecureLS({ encodingType: '', isCompression: false });
|
|
4
|
-
ae = a.AES.encrypt(JSON.stringify(data), 's3cr3t@123');
|
|
5
|
-
bde = a.AES.decrypt(ae.toString(), 's3cr3t@123');
|
|
6
|
-
de = bde.toString(a.enc._Utf8);
|
|
7
|
-
|
|
8
|
-
a.set(key, data);
|
|
9
|
-
console.log('____________________________________');
|
|
10
|
-
console.log('Standard Case: no compression, no encryption / encoding');
|
|
11
|
-
console.log(localStorage.getItem(key));
|
|
12
|
-
console.log(a.get(key));
|
|
13
|
-
console.log('____________________________________');
|
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
/*! screenlog - v0.2.2 - 2016-07-11
|
|
2
|
-
* https://github.com/chinchang/screenlog.js
|
|
3
|
-
* Copyright (c) 2016 Kushagra Gour; Licensed */
|
|
4
|
-
|
|
5
|
-
!(function () {
|
|
6
|
-
function a(a, b) {
|
|
7
|
-
var c = document.createElement(a);
|
|
8
|
-
return ((c.style.cssText = b), c);
|
|
9
|
-
}
|
|
10
|
-
function b() {
|
|
11
|
-
var b = a(
|
|
12
|
-
'div',
|
|
13
|
-
'z-index:2147483647;font-family:Helvetica,Arial,sans-serif;font-size:12px;font-weight:bold;padding:10px;text-align:left;opacity:0.8;position:fixed;min-width:400px;max-height:70vh;overflow:auto;background:' +
|
|
14
|
-
_options.bgColor +
|
|
15
|
-
';' +
|
|
16
|
-
_options.css,
|
|
17
|
-
);
|
|
18
|
-
return b;
|
|
19
|
-
}
|
|
20
|
-
function c(b) {
|
|
21
|
-
return function () {
|
|
22
|
-
var c = a(
|
|
23
|
-
'div',
|
|
24
|
-
'line-height:18px;min-height:18px;background:' +
|
|
25
|
-
(o.children.length % 2 ? 'rgba(255,255,255,0.1)' : '') +
|
|
26
|
-
';color:' +
|
|
27
|
-
b,
|
|
28
|
-
),
|
|
29
|
-
d = [].slice.call(arguments).reduce(function (a, b) {
|
|
30
|
-
return a + ' ' + ('object' == typeof b ? JSON.stringify(b) : b);
|
|
31
|
-
}, '');
|
|
32
|
-
((c.textContent = d), o.appendChild(c), _options.autoScroll && (o.scrollTop = o.scrollHeight - o.clientHeight));
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
function d() {
|
|
36
|
-
o.innerHTML = '';
|
|
37
|
-
}
|
|
38
|
-
function e() {
|
|
39
|
-
return c(_options.logColor).apply(null, arguments);
|
|
40
|
-
}
|
|
41
|
-
function f() {
|
|
42
|
-
return c(_options.infoColor).apply(null, arguments);
|
|
43
|
-
}
|
|
44
|
-
function g() {
|
|
45
|
-
return c(_options.warnColor).apply(null, arguments);
|
|
46
|
-
}
|
|
47
|
-
function h() {
|
|
48
|
-
return c(_options.errorColor).apply(null, arguments);
|
|
49
|
-
}
|
|
50
|
-
function i(a) {
|
|
51
|
-
for (var b in a) a.hasOwnProperty(b) && _options.hasOwnProperty(b) && (_options[b] = a[b]);
|
|
52
|
-
}
|
|
53
|
-
function j(a) {
|
|
54
|
-
p ||
|
|
55
|
-
((p = !0),
|
|
56
|
-
a && i(a),
|
|
57
|
-
(o = b()),
|
|
58
|
-
document.body.appendChild(o),
|
|
59
|
-
_options.freeConsole ||
|
|
60
|
-
((q.log = console.log),
|
|
61
|
-
(q.clear = console.clear),
|
|
62
|
-
(q.info = console.info),
|
|
63
|
-
(q.warn = console.warn),
|
|
64
|
-
(q.error = console.error),
|
|
65
|
-
(console.log = n(e, 'log')),
|
|
66
|
-
(console.clear = n(d, 'clear')),
|
|
67
|
-
(console.info = n(f, 'info')),
|
|
68
|
-
(console.warn = n(g, 'warn')),
|
|
69
|
-
(console.error = n(h, 'error'))));
|
|
70
|
-
}
|
|
71
|
-
function k() {
|
|
72
|
-
((p = !1),
|
|
73
|
-
(console.log = q.log),
|
|
74
|
-
(console.clear = q.clear),
|
|
75
|
-
(console.info = q.info),
|
|
76
|
-
(console.warn = q.warn),
|
|
77
|
-
(console.error = q.error),
|
|
78
|
-
o.remove());
|
|
79
|
-
}
|
|
80
|
-
function l() {
|
|
81
|
-
if (!p) throw 'You need to call `screenLog.init()` first.';
|
|
82
|
-
}
|
|
83
|
-
function m(a) {
|
|
84
|
-
return function () {
|
|
85
|
-
return (l(), a.apply(this, arguments));
|
|
86
|
-
};
|
|
87
|
-
}
|
|
88
|
-
function n(a, b) {
|
|
89
|
-
return function () {
|
|
90
|
-
(a.apply(this, arguments), 'function' == typeof q[b] && q[b].apply(console, arguments));
|
|
91
|
-
};
|
|
92
|
-
}
|
|
93
|
-
var o,
|
|
94
|
-
p = !1,
|
|
95
|
-
q = {};
|
|
96
|
-
((_options = {
|
|
97
|
-
bgColor: 'black',
|
|
98
|
-
logColor: 'lightgreen',
|
|
99
|
-
infoColor: 'blue',
|
|
100
|
-
warnColor: 'orange',
|
|
101
|
-
errorColor: 'red',
|
|
102
|
-
freeConsole: !1,
|
|
103
|
-
css: '',
|
|
104
|
-
autoScroll: !0,
|
|
105
|
-
}),
|
|
106
|
-
(window.screenLog = {
|
|
107
|
-
init: j,
|
|
108
|
-
log: n(m(e), 'log'),
|
|
109
|
-
clear: n(m(d), 'clear'),
|
|
110
|
-
info: n(m(d), 'info'),
|
|
111
|
-
warn: n(m(g), 'warn'),
|
|
112
|
-
error: n(m(h), 'error'),
|
|
113
|
-
destroy: m(k),
|
|
114
|
-
}));
|
|
115
|
-
})();
|
package/jest.config.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
transform: {
|
|
3
|
-
'^.+\\.jsx?$': 'babel-jest',
|
|
4
|
-
},
|
|
5
|
-
// This is for handling extensions, if needed
|
|
6
|
-
moduleFileExtensions: ['js', 'jsx', 'json', 'node', 'mjs'],
|
|
7
|
-
// This might be required if you want to ignore some files
|
|
8
|
-
transformIgnorePatterns: ['/node_modules/'],
|
|
9
|
-
testEnvironment: 'jest-environment-jsdom',
|
|
10
|
-
};
|
package/screenshot.png
DELETED
|
Binary file
|