Skip to content

Commit

Permalink
fix: export SupportedEncodings from to-string and from-string (#40)
Browse files Browse the repository at this point in the history
Restore previous type export
  • Loading branch information
achingbrain authored Oct 12, 2022
1 parent 93b959b commit d3f1412
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
2 changes: 2 additions & 0 deletions src/from-string.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import bases, { SupportedEncodings } from './util/bases.js'
import { asUint8Array } from './util/as-uint8array.js'

export type { SupportedEncodings }

/**
* Create a `Uint8Array` from the passed string
*
Expand Down
2 changes: 2 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@ export {
toString,
xor
}

export type { SupportedEncodings } from './util/bases.js'
4 changes: 1 addition & 3 deletions src/to-string.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import bases, { SupportedEncodings } from './util/bases.js'

/**
* @typedef {import('./util/bases').SupportedEncodings} SupportedEncodings
*/
export type { SupportedEncodings }

/**
* Turns a `Uint8Array` into a string.
Expand Down
4 changes: 2 additions & 2 deletions test/from-string.spec.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/* eslint-env mocha */

import { expect } from 'aegir/chai'
import { fromString } from '../src/from-string.js'
import { fromString, SupportedEncodings } from '../src/from-string.js'
import { toString } from '../src/to-string.js'
import bases, { SupportedEncodings } from '../src/util/bases.js'
import bases from '../src/util/bases.js'

const supportedBases = Object.keys(bases) as SupportedEncodings[]

Expand Down

0 comments on commit d3f1412

Please sign in to comment.