Skip to content

Commit

Permalink
Add additional identity helpers
Browse files Browse the repository at this point in the history
  • Loading branch information
JoelBCarter committed Apr 9, 2024
1 parent 19b372a commit 4dd5ee2
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { isPayloadOfSchemaType, Payload } from '@xyo-network/payload-model'
import { isPayloadOfSchemaType, isPayloadOfSchemaTypeWithMeta, isPayloadOfSchemaTypeWithSources, Payload } from '@xyo-network/payload-model'

export type DomainSchema = 'network.xyo.ns.domain'
export const DomainSchema: DomainSchema = 'network.xyo.ns.domain'
Expand Down Expand Up @@ -32,3 +32,13 @@ export type Domain = Payload<DomainFields, DomainSchema>
* Identity function for Domain payload
*/
export const isDomain = isPayloadOfSchemaType<Domain>(DomainSchema)

/**
* Identity function for Domain payload with sources
*/
export const isDomainWithSources = isPayloadOfSchemaTypeWithSources<Domain>(DomainSchema)

/**
* Identity function for Domain payload with meta
*/
export const isDomainWithMeta = isPayloadOfSchemaTypeWithMeta<Domain>(DomainSchema)
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { isPayloadOfSchemaType, Payload } from '@xyo-network/payload-model'
import { isPayloadOfSchemaType, isPayloadOfSchemaTypeWithMeta, isPayloadOfSchemaTypeWithSources, Payload } from '@xyo-network/payload-model'

import { DurationFields } from '../Duration'
import { DomainFields } from './Domain'
Expand All @@ -20,3 +20,13 @@ export type DomainLease = Payload<DomainLeaseFields, DomainLeaseSchema>
* Identity function for DomainLease payload
*/
export const isDomainLease = isPayloadOfSchemaType<DomainLease>(DomainLeaseSchema)

/**
* Identity function for DomainLease payload with sources
*/
export const isDomainLeaseWithSources = isPayloadOfSchemaTypeWithSources<DomainLease>(DomainLeaseSchema)

/**
* Identity function for DomainLease payload with meta
*/
export const isDomainLeaseWithMeta = isPayloadOfSchemaTypeWithMeta<DomainLease>(DomainLeaseSchema)
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Address } from '@xylabs/hex'
import { isPayloadOfSchemaType, Payload } from '@xyo-network/payload-model'
import { isPayloadOfSchemaType, isPayloadOfSchemaTypeWithMeta, isPayloadOfSchemaTypeWithSources, Payload } from '@xyo-network/payload-model'

import { DomainFields, DomainSchema } from '../Domain'

Expand All @@ -26,3 +26,13 @@ export type DomainRegistration = Payload<DomainRegistrationFields, DomainRegistr
* Identity function for DomainRegistration payload
*/
export const isDomainRegistration = isPayloadOfSchemaType<DomainRegistration>(DomainRegistrationSchema)

/**
* Identity function for DomainRegistration payload with sources
*/
export const isDomainRegistrationWithSources = isPayloadOfSchemaTypeWithSources<DomainRegistration>(DomainRegistrationSchema)

/**
* Identity function for DomainRegistration payload with meta
*/
export const isDomainRegistrationWithMeta = isPayloadOfSchemaTypeWithMeta<DomainRegistration>(DomainRegistrationSchema)
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { isPayloadOfSchemaType, Payload } from '@xyo-network/payload-model'
import { isPayloadOfSchemaType, isPayloadOfSchemaTypeWithMeta, isPayloadOfSchemaTypeWithSources, Payload } from '@xyo-network/payload-model'

import { DurationFields } from '../Duration'
import { DomainRegistrationFields, DomainRegistrationSchema } from './DomainRegistration'
Expand All @@ -17,3 +17,13 @@ export type DomainRegistrationLease = Payload<DomainRegistrationLeaseFields, Dom
* Identity function for DomainRegistrationLease payload
*/
export const isDomainRegistrationLease = isPayloadOfSchemaType<DomainRegistrationLease>(DomainRegistrationLeaseSchema)

/**
* Identity function for DomainRegistrationLease payload with sources
*/
export const isDomainRegistrationLeaseSources = isPayloadOfSchemaTypeWithSources<DomainRegistrationLease>(DomainRegistrationLeaseSchema)

/**
* Identity function for DomainRegistrationLease payload with meta
*/
export const isDomainRegistrationLeaseMeta = isPayloadOfSchemaTypeWithMeta<DomainRegistrationLease>(DomainRegistrationLeaseSchema)

0 comments on commit 4dd5ee2

Please sign in to comment.