Skip to content

Commit

Permalink
- prototype-edt
Browse files Browse the repository at this point in the history
  • Loading branch information
eddow committed Nov 3, 2024
1 parent a907d78 commit 4bcb641
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 59 deletions.
21 changes: 0 additions & 21 deletions src/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,24 +25,3 @@ export function instanceOf(obj: any, ctor: Ctor) {
if (base === ctor || base.prototype instanceof ctor) return true
return false
}

type Method<Class extends Ctor, Args extends any[], Return> = (
this: InstanceType<Class>,
...args: Args
) => Return

/**
*
* @param target
* @param factory
* @deprecated Not deprecated but incomplete - just pushed away with other changes : *unreliable!*
*/
export function overrideMethods<Class extends Ctor, Args extends any[], Return>(
target: Class,
factory: (source: InstanceType<Class>) => Record<PropertyKey, Method<Class, Args, Return>>
) {
Object.defineProperties(
target.prototype,
Object.getOwnPropertyDescriptors(factory(Object.getPrototypeOf(target.prototype)))
)
}
38 changes: 0 additions & 38 deletions test/utils.test.ts

This file was deleted.

0 comments on commit 4bcb641

Please sign in to comment.