Skip to content

Commit 0f5fe5e

Browse files
committed
Starting to introduce entities
1 parent e47340b commit 0f5fe5e

File tree

5 files changed

+30
-14
lines changed

5 files changed

+30
-14
lines changed

.idea/vcs.xml

Lines changed: 0 additions & 6 deletions
This file was deleted.

.snyk

Lines changed: 0 additions & 8 deletions
This file was deleted.

src/entities/Apikey.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
2+
import { Entity } from '../interfaces/Entity'
3+
4+
export class ApiKey implements Entity {
5+
constructor(apiKey: string) {
6+
7+
}
8+
9+
validate(): void {
10+
11+
}
12+
13+
14+
valid(): boolean {
15+
return true
16+
}
17+
}

src/interfaces/Entity.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
export interface Entity {
2+
validate(): void
3+
valid(): boolean
4+
}

test/entities/ApikeyTest.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import test from 'ava'
2+
3+
import { ApiKey } from '../../src/entities/Apikey'
4+
5+
test('Instantiated', (t)=> {
6+
const apiKey = 'TRU5Z5MNWIEYP4F6DPH2T53IJWZIZ5GT1W'
7+
const a = new ApiKey(apiKey)
8+
t.truthy(a)
9+
})

0 commit comments

Comments
 (0)