Skip to content

Commit 5c3b075

Browse files
committed
Prettier mods
1 parent 724b610 commit 5c3b075

File tree

12 files changed

+44
-29
lines changed

12 files changed

+44
-29
lines changed

.vscode/settings.json

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,25 @@
66
"typescript.enablePromptUseWorkspaceTsdk": true,
77
"cSpell.words": [
88
"abcdefghijklmnopqrstuv",
9+
"ABCDEFGHJKMNPQRSTVWXYZ",
910
"aeiou",
1011
"alphanum",
1112
"ATCG",
1213
"BDFGHJLMNPQRT",
1314
"bdfghjmnpqrt",
1415
"bitauth",
16+
"CAUTZITHN",
17+
"CFGHJMPQRVW",
1518
"codecov",
19+
"Crockford",
20+
"DÎÑG",
21+
"dîñgø",
1622
"dingodog",
1723
"dingosky",
1824
"dîngøsky",
1925
"dingoskyme",
26+
"Dyîdkø",
27+
"fbhhwlsikct",
2028
"FFTFTTFFTFTTFFTT",
2129
"GACGGTCG",
2230
"Hmmmm",
@@ -25,18 +33,26 @@
2533
"JMGP",
2634
"kiyooodd",
2735
"Knoxen",
36+
"ksyssdddgogoigydiskyndkysddddioggooyogdykdy",
2837
"lcov",
2938
"libauth",
39+
"Pbhh",
3040
"PQIB",
3141
"prng",
3242
"Puid",
3343
"QBHU",
3444
"qbhujm",
45+
"TJPNM",
3546
"TTACCCAC",
3647
"TTTTTFTTFFFFFTFF",
3748
"TWQZAA",
3849
"UFLYN",
39-
"ydkîsnsd"
50+
"Uzld",
51+
"Vnnb",
52+
"Xcfghjmpqrvwx",
53+
"ydkîsnsd",
54+
"Yklc",
55+
"Zrxx"
4056
],
4157
"files.exclude": {
4258
"**/.nyc_output": true

src/lib/encoder.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ import encoder from './encoder'
55

66
const chars_encoder = (t: ExecutionContext, chars: string) => {
77
const chars_encoder = encoder(chars)
8-
const codes = [...Array(chars.length).keys()].map(code => chars_encoder(code))
8+
const codes = [...Array(chars.length).keys()].map((code) => chars_encoder(code))
99
const encoded = String.fromCharCode(...codes)
1010
t.is(encoded, chars)
1111
}
1212

13-
test('alpha() encoder chars', (t) => chars_encoder(t, Chars.Alpha))
13+
test('alpha() encoder chars', (t) => chars_encoder(t, Chars.Alpha))
1414
test('alphaCase() encoder chars', (t) => chars_encoder(t, Chars.AlphaLower))
1515
test('alphaCase(true) encoder chars', (t) => chars_encoder(t, Chars.AlphaUpper))
1616
test('alphaNumEncoder() encoder chars', (t) => chars_encoder(t, Chars.AlphaNum))

src/lib/encoder.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,12 @@ export default (chars: string): PuidEncoder => {
2222
if (chars === Chars.Base32) return base32Encoder()
2323
if (chars === Chars.Base32Hex) return base32HexCaseEncoder()
2424
if (chars === Chars.Base32HexUpper) return base32HexCaseEncoder(true)
25-
if (chars === Chars.Decimal) return decimalEncoder()
25+
if (chars === Chars.Decimal) return decimalEncoder()
2626
if (chars === Chars.Hex) return hexCaseEncoder()
2727
if (chars === Chars.HexUpper) return hexCaseEncoder(true)
2828
if (chars === Chars.Safe32) return safe32Encoder()
2929
if (chars === Chars.Safe64) return safe64Encoder()
3030
if (chars === Chars.SafeAscii) return safeAsciiEncoder()
3131
if (chars === Chars.Symbol) return symbolEncoder()
32-
3332
return customEncoder(chars)
3433
}

src/lib/encoder/alpha.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { PuidEncoder } from "../../types/puid"
1+
import { PuidEncoder } from '../../types/puid'
22

33
export default (): PuidEncoder => {
44
const upper = 'A'.charCodeAt(0)

src/lib/encoder/alphaCase.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { PuidEncoder } from "../../types/puid"
1+
import { PuidEncoder } from '../../types/puid'
22

33
export default (uppercase = false): PuidEncoder => {
44
const alpha = (uppercase ? 'A' : 'a').charCodeAt(0)

src/lib/encoder/alphaNum.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { PuidEncoder } from "../../types/puid"
1+
import { PuidEncoder } from '../../types/puid'
22

33
export default (): PuidEncoder => {
44
const upper = 'A'.charCodeAt(0)

src/lib/encoder/alphaNumCase.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import { PuidEncoder } from "../../types/puid"
1+
import { PuidEncoder } from '../../types/puid'
22

33
export default (uppercase = false): PuidEncoder => {
44
const decimal = '0'.charCodeAt(0)
55
const alpha = (uppercase ? 'A' : 'a').charCodeAt(0) - 10
6-
6+
77
return (n: number) => {
88
if (n < 10) return n + decimal
99
return n + alpha

src/lib/encoder/base32HexCase.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { PuidEncoder } from "../../types/puid"
1+
import { PuidEncoder } from '../../types/puid'
22

33
export default (uppercase = false): PuidEncoder => {
44
const decimal = '0'.charCodeAt(0)

src/lib/encoder/custom.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { PuidEncoder } from "../../types/puid"
1+
import { PuidEncoder } from '../../types/puid'
22

33
export default (chars: string): PuidEncoder => {
44
const charCodes = chars.split('').map((c) => c.charCodeAt(0))

src/lib/encoder/decimal.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { PuidEncoder } from "../../types/puid"
1+
import { PuidEncoder } from '../../types/puid'
22

33
export default (): PuidEncoder => {
44
const decimal = '0'.charCodeAt(0)

0 commit comments

Comments
 (0)