We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0f5fe5e commit 85d817cCopy full SHA for 85d817c
src/entities/Apikey.ts
@@ -2,16 +2,16 @@
2
import { Entity } from '../interfaces/Entity'
3
4
export class ApiKey implements Entity {
5
+ private apiKey
6
constructor(apiKey: string) {
-
7
+ this.apiKey = apiKey
8
}
9
10
validate(): void {
11
12
13
14
valid(): boolean {
15
- return true
+ return this.apiKey.length !== 33
16
17
test/entities/ApikeyTest.ts
@@ -7,3 +7,10 @@ test('Instantiated', (t)=> {
const a = new ApiKey(apiKey)
t.truthy(a)
})
+
+test('is valid', (t)=> {
+ const apiKey = 'TRU5Z5MNWIEYP4F6DPH2T53IJWZIZ5GT1W'
+ const a = new ApiKey(apiKey)
+ t.truthy(a.valid())
+})
0 commit comments