-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
80 lines (76 loc) · 2.16 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
let count = 0;
const maxError = 100;
const separator = '-';
if (DS) {
// findKey(DS, 'AnimationTimeline');
printAllKey(DS);
}
function findKey(obj, keyName, parentName = '') {
// debugger
for (const key in obj) {
if (key === keyName) {
console.info(`${parentName} - ${key}`);
continue;
}
if (typeof obj[key] === 'object' && key !== '__proto__' && Object.keys(obj[key]).length > 0) {
findKey(obj[key], keyName, key);
}
if (typeof obj[key] === 'function' && typeof obj[key].prototype === 'object' && Object.keys(obj[key].prototype).length > 0) {
findKey(obj[key].prototype, keyName, key);
}
}
}
function printType(obj) {
if (typeof obj === "object") {
if ( Array.isArray(obj)) return 'array'
return 'object'
}
return typeof obj
}
function printAllKey(obj, parentKey = '', isPrototype) {
if (!obj) return;
Object.keys(obj).length > 0 && console.info(`🟠 index.js Line:26 ID:779455`, Object.keys(obj).join(' , '));
if (isPrototype) return;
one: for (const key in obj) {
if (count > maxError) break one;
count++;
const currentKey = parentKey ? parentKey + separator + key + `-${printType(obj[key])}` : key;
console.log(currentKey);
try {
const keyValue = obj?.[key];
// check, ko cho di tiep
const keyName = ['_', '_assets', ''];
if (keyName.includes(key)) continue one;
const check = [DS.Backbone.View, DS.Backbone.Collection, DS.Backbone.Model];
for (const element of check) {
if (keyValue instanceof element) {
console.info(`🟠 index.js Line:36 ID:07d22a`, keyValue);
continue one;
}
}
switch (typeof keyValue) {
case 'function':
printAllKey(keyValue?.prototype, currentKey, true);
break;
case 'object':
printAllKey(keyValue, currentKey);
break;
}
} catch (err) {
console.info(`🟠 index.js Line:51 ID:2b4904`, key);
}
}
}
/*
liệt kê toàn bộ key cấp 1 của object
sau khi liệt kê xong thì mới duyệt đến từng key để duyệt tiếp
truy cap key bi loi
audioContext\/onerror
audioContext\/sinkId
audioContext\/onsinkchange
audioContext\/destination
audioContext\/sampleRate
audioContext\/currentTime
audioContext\/listener
audioContext\/state
*/