@guardian/libs
Advanced tools
Comparing version 17.0.1 to 18.0.0
@@ -7,17 +7,15 @@ import { removeCookie } from '../cookies/removeCookie.js'; | ||
const removeData = (vendorData) => { | ||
if ("cookies" in vendorData) { | ||
vendorData.cookies?.forEach((name) => { | ||
removeCookie({ name }); | ||
}); | ||
const removeData = ({ | ||
cookies = [], | ||
localStorage = [], | ||
sessionStorage = [] | ||
}) => { | ||
for (const name of cookies) { | ||
removeCookie({ name }); | ||
} | ||
if ("localStorage" in vendorData) { | ||
vendorData.localStorage?.forEach((name) => { | ||
storage.local.remove(name); | ||
}); | ||
for (const name of localStorage) { | ||
storage.local.remove(name); | ||
} | ||
if ("sessionStorage" in vendorData) { | ||
vendorData.sessionStorage?.forEach((name) => { | ||
storage.session.remove(name); | ||
}); | ||
for (const name of sessionStorage) { | ||
storage.session.remove(name); | ||
} | ||
@@ -24,0 +22,0 @@ }; |
@@ -9,5 +9,5 @@ /** | ||
name: string; | ||
shouldMemoize?: boolean | undefined; | ||
shouldMemoize?: boolean; | ||
}) => string | null; | ||
export { getCookie }; |
@@ -9,5 +9,5 @@ /** | ||
name: string; | ||
currentDomainOnly?: boolean | undefined; | ||
currentDomainOnly?: boolean; | ||
}) => void; | ||
export { removeCookie }; |
@@ -12,6 +12,6 @@ /** | ||
value: string; | ||
daysToLive?: number | undefined; | ||
isCrossSubdomain?: boolean | undefined; | ||
daysToLive?: number; | ||
isCrossSubdomain?: boolean; | ||
}) => void; | ||
export { setCookie }; |
@@ -17,4 +17,4 @@ /** | ||
*/ | ||
declare const isOneOf: <Literals extends readonly (string | number)[]>(literals: Literals) => (value: string | number) => value is Literals[number]; | ||
declare const isOneOf: <Literals extends ReadonlyArray<string | number>>(literals: Literals) => (value: string | number) => value is Literals[number]; | ||
export { isOneOf }; |
@@ -11,4 +11,4 @@ /** | ||
*/ | ||
declare const loadScript: (src: string, props?: Omit<Partial<HTMLScriptElement>, 'src' | 'onload' | 'onerror'>) => Promise<Event | undefined>; | ||
declare const loadScript: (src: string, props?: Omit<Partial<HTMLScriptElement>, "src" | "onload" | "onerror">) => Promise<Event | undefined>; | ||
export { loadScript }; |
@@ -1,3 +0,3 @@ | ||
var version = "17.0.1"; | ||
var version = "18.0.0"; | ||
export { version }; |
{ | ||
"name": "@guardian/libs", | ||
"version": "17.0.1", | ||
"version": "18.0.0", | ||
"private": false, | ||
@@ -30,3 +30,3 @@ "description": "A collection of JavaScript libraries and TypeScript types for Guardian projects", | ||
"tsx": "4.15.6", | ||
"typescript": "5.3.3", | ||
"typescript": "5.5.2", | ||
"wcag-contrast": "3.0.0", | ||
@@ -37,3 +37,3 @@ "wireit": "0.14.4" | ||
"tslib": "^2.6.2", | ||
"typescript": "~5.3.3" | ||
"typescript": "~5.5.2" | ||
}, | ||
@@ -129,2 +129,5 @@ "peerDependenciesMeta": { | ||
"command": "tsc --pretty", | ||
"dependencies": [ | ||
"../identity-auth-frontend:build" | ||
], | ||
"files": [ | ||
@@ -131,0 +134,0 @@ "**", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
228005
7300