cordova.define("cordova-plugin-nativestorage.LocalStorageHandle",function(require,exports,module){var NativeStorageError=require("./NativeStorageError");module.exports=function(success,error,intent,operation,args){var reference=args[0],variable=args[1];if(operation.startsWith("put")||operation.startsWith("set"))try{var varAsString=JSON.stringify(variable);if(null===reference)return void error(NativeStorageError.NULL_REFERENCE);localStorage.setItem(reference,varAsString),success(variable)}catch(err){error(NativeStorageError.JSON_ERROR)}else if(operation.startsWith("get")){var item;if(null===(item=localStorage.getItem(reference)))return void error(NativeStorageError.ITEM_NOT_FOUND);try{success(JSON.parse(item))}catch(err){error(NativeStorageError.JSON_ERROR)}}else if("keys"===operation){for(var keys=[],i=0;i<localStorage.length;i++)keys.push(localStorage.key(i));success(keys)}}});