Skip to content

Commit 2b63093

Browse files
committed
(types): enable strict mode
- not many changes almost surprisingly - guess because I already resolved most implicit any warnings before
1 parent 2255b20 commit 2b63093

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/index.ts

+5-3
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export const persist: IArgs = (name, store, options = {}) => {
2222
const whitelistDict = arrToDict(whitelist)
2323
const blacklistDict = arrToDict(blacklist)
2424

25-
onSnapshot(store, (_snapshot) => {
25+
onSnapshot(store, (_snapshot: any) => {
2626
const snapshot = { ..._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-
function arrToDict (arr?: Array<string>): object {
49+
type StrToBoolMap = {[key: string]: boolean}
50+
51+
function arrToDict (arr?: Array<string>): StrToBoolMap {
5052
if (!arr) { return {} }
51-
return arr.reduce((dict, elem) => {
53+
return arr.reduce((dict: StrToBoolMap, elem) => {
5254
dict[elem] = true
5355
return dict
5456
}, {})

tsconfig.json

+1
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)