UNPKG
localforage
Version:
latest (1.10.0)
1.10.0
1.9.0
1.8.1
1.8.0
1.7.4
1.7.3
1.7.2
1.7.1
1.7.0
1.6.0
1.5.7
1.5.6
1.5.5
1.5.4
1.5.3
1.5.2
1.5.1
1.5.0
1.4.3
1.4.2
1.4.1
1.4.0
1.3.3
1.3.2
1.3.1
1.3.0
1.2.10
1.2.9
1.2.8
1.2.7
1.2.6
1.2.4
1.2.3
1.2.2
1.2.1
1.2.0
1.1.1
1.1.0
1.0.4
1.0.3
1.0.2
1.0.1
1.0.0
0.9.3
0.9.2
0.9.1
0.9.0
0.8.1
0.8.0
0.7.0
0.6.2
0.6.1
0.6.0
0.4.3
0.4.1
0.4.0
0.3.1
0.3.0
0.2.0
0.1.1
0.1.0
0.0.1
Offline storage, improved.
github.com/localForage/localForage
localForage/localForage
localforage
/
src
/
utils
/
normalizeKey.js
10 lines
(8 loc)
•
270 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
export
default
function
normalizeKey
(
key
) {
// Cast the key to a string, as that's all we can set as a key.
if
(
typeof
key !==
'string'
) {
console
.
warn
(
`
${key}
used as a key, but it is not a string.`
); key =
String
(key); }
return
key; }