Skip to content

Commit

Permalink
add startFrom to opts interface (#30)
Browse files Browse the repository at this point in the history
* add startFrom to opts interface

* adding startFrom option to example
  • Loading branch information
yonathan06 authored Feb 21, 2022
1 parent 2af5abd commit 8317add
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ declare namespace hyperid {
interface Options {
urlSafe?: boolean
fixedLength?: boolean
startFrom?: number
}

interface Instance {
Expand Down
3 changes: 3 additions & 0 deletions test/example.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@ import * as hyperid from '..'

const urlSafeInstance = hyperid({ fixedLength: false, urlSafe: true })
const fixedLengthInstance = hyperid(true)
const startFromInstance = hyperid({ startFrom: 9 })

const urlSafeId = urlSafeInstance()
const fixedLengthId = fixedLengthInstance()
const startFromId = startFromInstance()

// decode
console.log(hyperid.decode(urlSafeId))
console.log(fixedLengthInstance.decode(fixedLengthId))
console.log(startFromInstance.decode(startFromId))

0 comments on commit 8317add

Please sign in to comment.