dist/angular-webstorage.js
function (key, storageType) {

            // Get storage type
            var isStorageType = typeof storageType === 'undefined' ? false : true,
                item;

            // Set web storage
            if (isStorageType) {
                webStorage = $window[storageType];
                item = webStorage ? webStorage.getItem(key) : null;
            } else {
                webStorage = $window.sessionStorage;
                item = webStorage ? webStorage.getItem(key) : null;
                if (!item || item === 'null') {
                    webStorage = $window.localStorage;
                    item = webStorage ? webStorage.getItem(key) : null;
                }
            }

            if (!item || item === 'null') {
                return null;
            }

            if (item.charAt(0) === "{" || item.charAt(0) === "[") {
                return angular.fromJson(item);
            }

            return item;
        }
function (key, storageType) {

            // Get storage type
            var isStorageType = typeof storageType === 'undefined' ? false : true,
                item;

            // Set web storage
            if (isStorageType) {
                webStorage = $window[storageType];
                item = webStorage ? webStorage.getItem(key) : null;
            } else {
                webStorage = $window.sessionStorage;
                item = webStorage ? webStorage.getItem(key) : null;
                if (!item || item === 'null') {
                    webStorage = $window.localStorage;
                    item = webStorage ? webStorage.getItem(key) : null;
                }
            }

            if (!item || item === 'null') {
                return null;
            }

            if (item.charAt(0) === "{" || item.charAt(0) === "[") {
                return angular.fromJson(item);
            }

            return item;
        }
/*
Return a value from storage
- key
- storageType: *optional* localStorage or sessionStorage