New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

oidc-jwt-client

Package Overview
Dependencies
Maintainers
4
Versions
94
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

oidc-jwt-client - npm Package Compare versions

Comparing version 4.0.5-develop.4 to 4.0.5-develop.5

dist/cjs/utils/getLocalStorageSize.js

18

dist/cjs/storage.js

@@ -5,5 +5,8 @@ 'use strict';

var getLocalStorageSize = require('./utils/getLocalStorageSize.js');
var isQuotaExceeded = require('./utils/isQuotaExceeded.js');
var isSSR = require('./utils/isSSR.js');
var parseJson = require('./utils/parseJson.js');
/* eslint-disable max-len */
var Storage = /** @class */ (function () {

@@ -21,3 +24,16 @@ function Storage() {

return;
return localStorage.setItem(key, JSON.stringify(value));
try {
return localStorage.setItem(key, JSON.stringify(value));
}
catch (error) {
var entries = Object.entries(localStorage).map(function (_a) {
var key = _a[0], value = _a[1];
return key + ":" + value.length;
});
var storageSize = getLocalStorageSize.getLocalStorageSize();
if (isQuotaExceeded.isQuotaExceeded(error)) {
throw new Error("LocalStorage full for key: \"" + key + "\" and value: \"" + JSON.stringify(value) + "\" - entries: " + JSON.stringify(entries) + " - error: " + error + " - size: " + storageSize);
}
throw new Error("LocalStorage failed for key: \"" + key + "\" and value: \"" + JSON.stringify(value) + "\" - entries: " + JSON.stringify(entries) + " - error: " + error);
}
};

@@ -24,0 +40,0 @@ Storage.unset = function (key) {

@@ -0,4 +1,7 @@

import { getLocalStorageSize } from './utils/getLocalStorageSize.js';
import { isQuotaExceeded } from './utils/isQuotaExceeded.js';
import { isSSR } from './utils/isSSR.js';
import { parseJson } from './utils/parseJson.js';
/* eslint-disable max-len */
var Storage = /** @class */ (function () {

@@ -16,3 +19,16 @@ function Storage() {

return;
return localStorage.setItem(key, JSON.stringify(value));
try {
return localStorage.setItem(key, JSON.stringify(value));
}
catch (error) {
var entries = Object.entries(localStorage).map(function (_a) {
var key = _a[0], value = _a[1];
return key + ":" + value.length;
});
var storageSize = getLocalStorageSize();
if (isQuotaExceeded(error)) {
throw new Error("LocalStorage full for key: \"" + key + "\" and value: \"" + JSON.stringify(value) + "\" - entries: " + JSON.stringify(entries) + " - error: " + error + " - size: " + storageSize);
}
throw new Error("LocalStorage failed for key: \"" + key + "\" and value: \"" + JSON.stringify(value) + "\" - entries: " + JSON.stringify(entries) + " - error: " + error);
}
};

@@ -19,0 +35,0 @@ Storage.unset = function (key) {

2

package.json
{
"name": "oidc-jwt-client",
"version": "4.0.5-develop.4",
"version": "4.0.5-develop.5",
"description": "Fetch JWTs for API access from oidc-jwt-provider",

@@ -5,0 +5,0 @@ "sideEffects": false,

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc