diff --git a/.travis.yml b/.travis.yml index 64c48eb..08cbf00 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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: @@ -37,4 +37,4 @@ deploy: condition: $(git describe --tags --abbrev=0) != $VERSION cache: directories: - - node_modules \ No newline at end of file + - node_modules diff --git a/package.json b/package.json index a28441e..40c3d6f 100644 --- a/package.json +++ b/package.json @@ -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": { diff --git a/script.js b/script.js index 6f7d887..b00ccd8 100644 --- a/script.js +++ b/script.js @@ -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) { @@ -99,4 +99,4 @@ if (typeof(window.Persistence) === 'undefined') { window.Persistence = new Persistence_windowKey("qt"); // linux, mac (2.1) } } -} \ No newline at end of file +}