-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
perf(speeding up more): simplified for the sake of performance
- Loading branch information
1 parent
a8edb04
commit 93c28f4
Showing
6 changed files
with
17 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,4 +38,4 @@ | |
"path": "./node_modules/cz-conventional-changelog" | ||
} | ||
} | ||
} | ||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,5 @@ | ||
<!DOCTYPE html> | ||
|
||
<html> | ||
<script id="payload"> | ||
const types = [Object, String, Number, Array, Function, Boolean]; | ||
|
||
const prototypesPropertiesReducer = (acc, type) => ({ | ||
...acc, | ||
[type.name]: Object.getOwnPropertyNames(type.prototype), | ||
}); | ||
|
||
const prototypePropertyNames = () => types.reduce(prototypesPropertiesReducer, {}); | ||
|
||
const probe = () => | ||
Object.keys(prototypePropertyNames()).reduce((acc, key) => { | ||
for (let propKey of prototypePropertyNames()[key]) { | ||
const payload = `${key}.prototype.${propKey}`; | ||
try { | ||
const propValue = eval(payload); | ||
|
||
if (typeof propValue === 'function' && !propValue.toString().includes('[native code]')) { | ||
// Check if property is user defined and not native | ||
acc.push(payload); | ||
} | ||
} catch (e) { | ||
// Nothing to catch now. | ||
} | ||
} | ||
return acc; | ||
}, []); | ||
</script> | ||
<script id="target" src="LIBRARY"></script> | ||
|
||
</html> | ||
<script id="target" src="LIBRARY"></script> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,4 +22,4 @@ const probe = () => | |
} | ||
} | ||
return acc; | ||
}, []); | ||
}, []); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters