Skip to content

Commit

Permalink
Fix store 0 bug (#38)
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon Lammer authored Feb 24, 2019
1 parent 4152405 commit 7107e73
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ install:
- wget https://dl.google.com/closure-compiler/compiler-latest.zip -O closure-compiler.zip
- unzip closure-compiler.zip -d closure-compiler
script:
- printf "// $VERSION - $GH_SCRIPT_URL\n$(cat script.js)" > script.js
- printf "// $VERSION - $GH_SCRIPT_URL\n$(cat script.js)\n" > script.js
- cat script.js
- 'curl -X POST -s --data-urlencode "input@script.js" https://javascript-minifier.com/raw > minified.js'
- printf "$(head -n 1 script.js)\n$(cat minified.js)" > minified.js
- printf "$(head -n 1 script.js)\n$(cat minified.js)\n" > minified.js
- cat minified.js
- npm test
before_deploy:
Expand All @@ -37,4 +37,4 @@ deploy:
condition: $(git describe --tags --abbrev=0) != $VERSION
cache:
directories:
- node_modules
- node_modules
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "anki-persistence",
"version": "0.5.2",
"version": "0.5.3",
"description": "Persist data between both sides of an anki flashcard.",
"main": "script.js",
"directories": {
Expand Down
4 changes: 2 additions & 2 deletions script.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ if (typeof(window.Persistence) === 'undefined') {
if (key == undefined) {
key = _defaultKey;
}
return obj[_persistenceKey][key] || null;
return obj[_persistenceKey][key] == undefined ? null : obj[_persistenceKey][key];
};
this.removeItem = function(key) {
if (key == undefined) {
Expand Down Expand Up @@ -99,4 +99,4 @@ if (typeof(window.Persistence) === 'undefined') {
window.Persistence = new Persistence_windowKey("qt"); // linux, mac (2.1)
}
}
}
}

0 comments on commit 7107e73

Please sign in to comment.