Skip to content

fix: revert custom instanceof check #58

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ngraveio/bc-ur",
"version": "2.0.0-beta.8",
"version": "2.0.0-beta.9",
"author": "Irfan Bilaloğlu <irfanbilaloglu@gmail.com>, Pieter Uyttersprot <pieter.uyttersprot@ngrave.io>, Antonis Poulakis <antwnic4@gmail.com>",
"description": "A JS implementation of the Uniform Resources (UR) specification from Blockchain Commons",
"license": "MIT",
Expand Down
10 changes: 0 additions & 10 deletions src/classes/RegistryItem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,11 +135,6 @@ export abstract class RegistryItemBase {
public encodeKeys = encodeKeys;
public decodeKeys = decodeKeys;

/** Property for instanceof checks */
static [Symbol.hasInstance](instance: any) {
return instance && instance[registryItemSymbol] === true;
}

// Custom inspection method for Node.js
public [Symbol.for("nodejs.util.inspect.custom")](
_depth: number,
Expand Down Expand Up @@ -212,10 +207,6 @@ export function registryItemFactory<T extends RegistryItemBase>(input: IRegistry
return new this(data);
}

/** Property for instanceof checks */
static [Symbol.hasInstance](instance: any) {
return instance && instance[registryItemSymbol] === true;
}
} as RegistryItemClass<T>;
}

Expand All @@ -231,7 +222,6 @@ export type RegistryItemClass<T extends RegistryItemBase = RegistryItemBase> = {
fromCBORData(val: any, allowKeysNotInMap?: boolean, tagged?: any): T;
fromUr(ur: UR | string): T;
fromHex(hex: string): T;
[Symbol.hasInstance](instance: any): boolean;
};
export type RegistryItem = InstanceType<RegistryItemClass>;

Expand Down
Loading