Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Dec 26, 2024. It is now read-only.
/etherscan-apiPublic archive

Commit85d817c

Browse files
committed
A first attempt at a entity
1 parent0f5fe5e commit85d817c

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

‎src/entities/Apikey.ts‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@
22
import{Entity}from'../interfaces/Entity'
33

44
exportclassApiKeyimplementsEntity{
5+
privateapiKey
56
constructor(apiKey:string){
6-
7+
this.apiKey=apiKey
78
}
89

910
validate():void{
1011

1112
}
1213

13-
1414
valid():boolean{
15-
returntrue
15+
returnthis.apiKey.length!==33
1616
}
1717
}

‎test/entities/ApikeyTest.ts‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,10 @@ test('Instantiated', (t)=> {
77
consta=newApiKey(apiKey)
88
t.truthy(a)
99
})
10+
11+
test('is valid',(t)=>{
12+
constapiKey='TRU5Z5MNWIEYP4F6DPH2T53IJWZIZ5GT1W'
13+
consta=newApiKey(apiKey)
14+
t.truthy(a.valid())
15+
})
16+

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp