Skip to content

Commit

Permalink
added some newlines and braces
Browse files Browse the repository at this point in the history
  • Loading branch information
Foivos committed Dec 13, 2024
1 parent fe7e3a5 commit 6422090
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions src/common/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,21 @@ export function signMessage(privKeys: string[], messageToSign: Uint8Array) {
export function isString(parameter: SuiMoveNormalizedType): boolean {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
let asAny = parameter as any;
if (asAny.MutableReference) parameter = asAny.MutableReference;
if (asAny.Reference) asAny = asAny.Reference;

if (asAny.MutableReference) {
parameter = asAny.MutableReference;
}

if (asAny.Reference) {
asAny = asAny.Reference;
}

asAny = asAny.Struct;
if (!asAny) return false;

if (!asAny) {
return false;
}

const isAsciiString = asAny.address === STD_PACKAGE_ID && asAny.module === 'ascii' && asAny.name === 'String';
const isStringString = asAny.address === STD_PACKAGE_ID && asAny.module === 'string' && asAny.name === 'String';
return isAsciiString || isStringString;
Expand Down

0 comments on commit 6422090

Please sign in to comment.