bnewbold bd3966555f
@atproto/syntax: merge of @atproto/identifier, uri, and nsid ()
* move nsid package in to identifier

* move uri package in to identifier

* update packages to pull from identifier, not nsid or uri

* rename @atproto/identifier to @atproto/syntax

* update all refs from @atproto/identifer to @atproto/syntax
2023-08-25 10:18:10 -05:00
..
2023-03-20 10:28:11 -04:00

Identifier

Validation logic for AT identifiers - DIDs & Handles

Usage

import * as identifier from '@atproto/identifier'

isValidHandle('alice.test') // returns true
ensureValidHandle('alice.test') // returns void

isValidHandle('al!ce.test') // returns false
ensureValidHandle('al!ce.test') // throws

ensureValidDid('did:method:val') // returns void
ensureValidDid(':did:method:val') // throws

License

MIT