@jitsi/js-utils
Advanced tools
Comparing version 2.0.0 to 2.0.3
@@ -10,3 +10,3 @@ import md5 from 'js-md5'; | ||
*/ | ||
export function getGravatarURL(key, baseURL = 'https://seccdn.libravatar.org/avatar/') { | ||
export function getGravatarURL(key, baseURL = 'https://www.gravatar.com/avatar/') { | ||
const urlSuffix = '?d=404&size=200'; | ||
@@ -13,0 +13,0 @@ |
@@ -82,6 +82,17 @@ import EventEmitter from 'events'; | ||
* | ||
* @param {Array<string>} ignore - Array with keys from the local storage to be ignored. | ||
* @returns {string} - The serialized content. | ||
*/ | ||
serialize() { | ||
return JSON.stringify(this._storage); | ||
serialize(ignore = []) { | ||
if (ignore.length === 0) { | ||
return JSON.stringify(this._storage); | ||
} | ||
const storageCopy = { ...this._storage }; | ||
ignore.forEach(key => { | ||
delete storageCopy[key]; | ||
}); | ||
return JSON.stringify(storageCopy); | ||
} | ||
@@ -192,7 +203,8 @@ } | ||
* | ||
* @param {Array<string>} ignore - Array with keys from the local storage to be ignored. | ||
* @returns {string} - The serialized content. | ||
*/ | ||
serialize() { | ||
serialize(ignore = []) { | ||
if (this.isLocalStorageDisabled()) { | ||
return this._storage.serialize(); | ||
return this._storage.serialize(ignore); | ||
} | ||
@@ -206,3 +218,5 @@ | ||
localStorageContent[key] = this._storage.getItem(key); | ||
if (!ignore.includes(key)) { | ||
localStorageContent[key] = this._storage.getItem(key); | ||
} | ||
} | ||
@@ -209,0 +223,0 @@ |
{ | ||
"name": "@jitsi/js-utils", | ||
"version": "2.0.0", | ||
"version": "2.0.3", | ||
"description": "Utilities for Jitsi JS projects", | ||
@@ -5,0 +5,0 @@ "repository": { |
# js-utils | ||
Collection of utilities for Jitsi JS projects. | ||
Collection of utilities for Jitsi JavaScript projects. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
134512
2689
4