Skip to content

Commit 4857ff6

Browse files
committed
Refactor charSet exports
1 parent 69c31db commit 4857ff6

File tree

1 file changed

+7
-24
lines changed

1 file changed

+7
-24
lines changed

lib/charSet.js

Lines changed: 7 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -80,29 +80,12 @@ const _ndxDiv = (chunk, slice, bytes, entropyPerChar) => {
8080
return ((bytes[chunk]<<(lShift*slice))&0xff)>>rShift
8181
}
8282

83-
const charSet64 =
84-
new CharSet("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_", _ndx64)
85-
const charSet32 =
86-
new CharSet("2346789bdfghjmnpqrtBDFGHJLMNPQRT", _ndx32)
87-
const charSet16 =
88-
new CharSet("0123456789abcdef", _ndx16)
89-
const charSet8 =
90-
new CharSet("01234567", _ndx8)
91-
const charSet4 =
92-
new CharSet("ATCG", _ndx4)
93-
const charSet2 =
94-
new CharSet("01", _ndx2)
95-
96-
const isValid = (charSet) => {
97-
return charSet instanceof CharSet
98-
}
99-
10083
export default {
101-
charSet64: charSet64,
102-
charSet32: charSet32,
103-
charSet16: charSet16,
104-
charSet8: charSet8,
105-
charSet4: charSet4,
106-
charSet2: charSet2,
107-
isValid: isValid
84+
charSet64: new CharSet('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_', _ndx64),
85+
charSet32: new CharSet('2346789bdfghjmnpqrtBDFGHJLMNPQRT', _ndx32),
86+
charSet16: new CharSet('0123456789abcdef', _ndx16),
87+
charSet8: new CharSet('01234567', _ndx8),
88+
charSet4: new CharSet('ATCG', _ndx4),
89+
charSet2: new CharSet('01', _ndx2),
90+
isValid: (charSet) => charSet instanceof CharSet
10891
}

0 commit comments

Comments
 (0)