Skip to content

Commit d3f1412

Browse files
authored
fix: export SupportedEncodings from to-string and from-string (#40)
Restore previous type export
1 parent 93b959b commit d3f1412

File tree

4 files changed

+7
-5
lines changed

4 files changed

+7
-5
lines changed

src/from-string.ts

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import bases, { SupportedEncodings } from './util/bases.js'
22
import { asUint8Array } from './util/as-uint8array.js'
33

4+
export type { SupportedEncodings }
5+
46
/**
57
* Create a `Uint8Array` from the passed string
68
*

src/index.ts

+2
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,5 @@ export {
1313
toString,
1414
xor
1515
}
16+
17+
export type { SupportedEncodings } from './util/bases.js'

src/to-string.ts

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import bases, { SupportedEncodings } from './util/bases.js'
22

3-
/**
4-
* @typedef {import('./util/bases').SupportedEncodings} SupportedEncodings
5-
*/
3+
export type { SupportedEncodings }
64

75
/**
86
* Turns a `Uint8Array` into a string.

test/from-string.spec.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
/* eslint-env mocha */
22

33
import { expect } from 'aegir/chai'
4-
import { fromString } from '../src/from-string.js'
4+
import { fromString, SupportedEncodings } from '../src/from-string.js'
55
import { toString } from '../src/to-string.js'
6-
import bases, { SupportedEncodings } from '../src/util/bases.js'
6+
import bases from '../src/util/bases.js'
77

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

0 commit comments

Comments
 (0)