index overview
Added in v0.1.0
Table of contents
constructors
Orcid
Signature
export declare function Orcid(orcid: string): Orcid
Example
import { Orcid } from 'orcid-id-ts'
const orcidId = Orcid('0000-0002-1825-0097')
assert.deepStrictEqual(orcidId, '0000-0002-1825-0097')
Added in v0.1.3
destructors
toUrl
Signature
export declare const toUrl: (orcid: Orcid) => URL
Example
import { Orcid, toUrl } from 'orcid-id-ts'
const url = toUrl('0000-0002-1825-0097' as Orcid)
assert.deepStrictEqual(url.href, 'https://orcid.org/0000-0002-1825-0097')
Added in v0.1.1
instances
Eq
Signature
export declare const Eq: E.Eq<Orcid>
Added in v0.1.1
model
Orcid (type alias)
Signature
export type Orcid = string & OrcidBrand
Added in v0.1.0
refinements
isOrcid
Signature
export declare const isOrcid: Refinement<unknown, Orcid>
Added in v0.1.0
utils
parse
Signature
export declare const parse: (s: string) => Option<Orcid>
Example
import * as O from 'fp-ts/Option'
import { Orcid, parse } from 'orcid-id-ts'
assert.deepStrictEqual(parse('https://orcid.org/0000-0002-1825-0097'), O.some('0000-0002-1825-0097' as Orcid))
assert.deepStrictEqual(parse('not an ORCID iD'), O.none)
Added in v0.1.2