Compare commits

...

2 Commits

Author SHA1 Message Date
semantic-release-bot
3f126fe471 chore(release): 1.7.1 [CI SKIP] 2022-08-17 18:52:21 +00:00
AAGaming
e644de35d7 fix(utils): better method to wrap react classes 2022-08-17 14:51:24 -04:00
4 changed files with 17 additions and 3 deletions

View File

@@ -1,3 +1,10 @@
## [1.7.1](https://github.com/SteamDeckHomebrew/decky-frontend-lib/compare/v1.7.0...v1.7.1) (2022-08-17)
### Bug Fixes
* **utils:** better method to wrap react classes ([e644de3](https://github.com/SteamDeckHomebrew/decky-frontend-lib/commit/e644de35d70680d17d70e89cc9b929a5aae08b48))
# [1.7.0](https://github.com/SteamDeckHomebrew/decky-frontend-lib/compare/v1.6.2...v1.7.0) (2022-08-17)

4
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{
"name": "decky-frontend-lib",
"version": "1.7.0",
"version": "1.7.1",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "decky-frontend-lib",
"version": "1.7.0",
"version": "1.7.1",
"license": "GPL-2.0-or-later",
"dependencies": {
"minimist": "^1.2.6"

View File

@@ -1,6 +1,6 @@
{
"name": "decky-frontend-lib",
"version": "1.7.0",
"version": "1.7.1",
"description": "A library for building decky plugins",
"main": "dist/index.js",
"types": "dist/index.d.ts",

View File

@@ -89,6 +89,13 @@ export function wrapReactType(node: any, prop?: any) {
export function wrapReactClass(node: any, prop?: any) {
const cls = node[prop || "type"];
const wrappedCls = class extends cls {};
Object.getOwnPropertyNames(cls.prototype).forEach((prop: any) => {
wrappedCls.prototype[prop] = cls.prototype[prop]
});
Object.getOwnPropertyNames(cls).forEach((prop: any) => {
if (prop != "prototype") wrappedCls[prop] = cls[prop]
});
wrappedCls.prototype.__proto__ = cls.prototype.__proto__;
return node[prop || "type"] = wrappedCls;
}