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

Commit2b63093

Browse files
committed
(types): enable strict mode
- not many changes almost surprisingly - guess because I already resolved most implicit any warnings before
1 parent2255b20 commit2b63093

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

‎src/index.ts‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export const persist: IArgs = (name, store, options = {}) => {
2222
constwhitelistDict=arrToDict(whitelist)
2323
constblacklistDict=arrToDict(blacklist)
2424

25-
onSnapshot(store,(_snapshot)=>{
25+
onSnapshot(store,(_snapshot:any)=>{
2626
constsnapshot={ ..._snapshot}
2727
Object.keys(snapshot).forEach((key)=>{
2828
if(whitelist&&!whitelistDict[key]){
@@ -46,9 +46,11 @@ export const persist: IArgs = (name, store, options = {}) => {
4646
})
4747
}
4848

49-
functionarrToDict(arr?:Array<string>):object{
49+
typeStrToBoolMap={[key:string]:boolean}
50+
51+
functionarrToDict(arr?:Array<string>):StrToBoolMap{
5052
if(!arr){return{}}
51-
returnarr.reduce((dict,elem)=>{
53+
returnarr.reduce((dict:StrToBoolMap,elem)=>{
5254
dict[elem]=true
5355
returndict
5456
},{})

‎tsconfig.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
"declaration":true,
99
"sourceMap":true,
1010
"rootDir":"./",
11+
"strict":true,
1112
"noUnusedLocals":true,
1213
"noUnusedParameters":true,
1314
"noImplicitReturns":true,

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp