mirror of
https://github.com/SteamDeckHomebrew/decky-frontend-lib.git
synced 2026-05-25 04:18:48 +02:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0a4ef14239 | ||
|
|
a592883a2e | ||
|
|
3f126fe471 | ||
|
|
e644de35d7 |
14
CHANGELOG.md
14
CHANGELOG.md
@@ -1,3 +1,17 @@
|
|||||||
|
## [1.7.2](https://github.com/SteamDeckHomebrew/decky-frontend-lib/compare/v1.7.1...v1.7.2) (2022-08-17)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **utils:** allow prop reassigns to fail ([a592883](https://github.com/SteamDeckHomebrew/decky-frontend-lib/commit/a592883a2eba52ba18876989acf939d12fa61fd3))
|
||||||
|
|
||||||
|
## [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)
|
# [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
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "decky-frontend-lib",
|
"name": "decky-frontend-lib",
|
||||||
"version": "1.7.0",
|
"version": "1.7.2",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "decky-frontend-lib",
|
"name": "decky-frontend-lib",
|
||||||
"version": "1.7.0",
|
"version": "1.7.2",
|
||||||
"license": "GPL-2.0-or-later",
|
"license": "GPL-2.0-or-later",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"minimist": "^1.2.6"
|
"minimist": "^1.2.6"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "decky-frontend-lib",
|
"name": "decky-frontend-lib",
|
||||||
"version": "1.7.0",
|
"version": "1.7.2",
|
||||||
"description": "A library for building decky plugins",
|
"description": "A library for building decky plugins",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"types": "dist/index.d.ts",
|
"types": "dist/index.d.ts",
|
||||||
|
|||||||
11
src/utils.ts
11
src/utils.ts
@@ -89,6 +89,17 @@ export function wrapReactType(node: any, prop?: any) {
|
|||||||
export function wrapReactClass(node: any, prop?: any) {
|
export function wrapReactClass(node: any, prop?: any) {
|
||||||
const cls = node[prop || "type"];
|
const cls = node[prop || "type"];
|
||||||
const wrappedCls = class extends cls {};
|
const wrappedCls = class extends cls {};
|
||||||
|
Object.getOwnPropertyNames(cls.prototype).forEach((prop: any) => {
|
||||||
|
try {
|
||||||
|
wrappedCls.prototype[prop] = cls.prototype[prop]
|
||||||
|
} catch (e) {}
|
||||||
|
});
|
||||||
|
Object.getOwnPropertyNames(cls).forEach((prop: any) => {
|
||||||
|
try {
|
||||||
|
if (prop != "prototype") wrappedCls[prop] = cls[prop]
|
||||||
|
} catch (e) {}
|
||||||
|
});
|
||||||
|
wrappedCls.prototype.__proto__ = cls.prototype.__proto__;
|
||||||
return node[prop || "type"] = wrappedCls;
|
return node[prop || "type"] = wrappedCls;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user