Skip to content

Commit

Permalink
fixed types
Browse files Browse the repository at this point in the history
  • Loading branch information
nialexsan committed Nov 2, 2023
1 parent 79a34d5 commit b73afdf
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 9 deletions.
7 changes: 7 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions packages/sdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"devDependencies": {
"@onflow/fcl-bundle": "^1.4.0-typescript.0",
"@onflow/typedefs": "^1.2.0-typescript.0",
"@types/uuid": "^9.0.6",
"eslint": "^8.35.0",
"eslint-plugin-jsdoc": "^40.0.1",
"jest": "^29.5.0",
Expand Down
12 changes: 6 additions & 6 deletions packages/sdk/src/interaction/interaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,11 @@ export const interaction = () => {
return initInteraction()
}

export const isNumber = d => typeof d === "number"
export const isArray = d => Array.isArray(d)
export const isObj = d => d !== null && typeof d === "object"
export const isNull = d => d == null
export const isFn = d => typeof d === "function"
export const isNumber = (d: any): d is number => typeof d === "number"
export const isArray = (d: any): d is any[] => Array.isArray(d)
export const isObj = (d: any): d is Record<string, any> => d !== null && typeof d === "object"
export const isNull = (d: any): d is null => d == null
export const isFn = (d: any): d is Function => typeof d === "function"

export const isInteraction = (ix: IIx) => {
if (!isObj(ix) || isNull(ix) || isNumber(ix)) return false
Expand Down Expand Up @@ -198,7 +198,7 @@ export const prepAccount = (acct: IAcct | IAcctFn, opts: IPrepAccountOpts = {})
return ix
}

export const makeArgument = arg => ix => {
export const makeArgument = (arg: Record<string, any>) => (ix: IIx) => {
let tempId = uuidv4()
ix.message.arguments.push(tempId)

Expand Down
6 changes: 3 additions & 3 deletions packages/sdk/src/test-utils/authz-fn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ interface IAuthzResolveMany {
}

export function authzResolveMany(opts: IAuthzResolveMany = {authorizations: []}) {
return function (account: IAcct) {
return function (account: IAcct): IAcct {
const tempId = opts.tempId || "AUTHZ_RESOLVE_MANY"
return {
...account,
Expand All @@ -79,8 +79,8 @@ export function authzResolveMany(opts: IAuthzResolveMany = {authorizations: []})
}
}

export function authzDeepResolveMany(opts = {}, depth = 1) {
return function (account) {
export function authzDeepResolveMany(opts: IAuthzResolveMany = {authorizations: []}, depth = 1) {
return function (account: IAcct): IAcct {
const tempId = opts.tempId || "AUTHZ_DEEP_RESOLVE_MANY"
return {
...account,
Expand Down

0 comments on commit b73afdf

Please sign in to comment.