@the-libs/base-shared
Advanced tools
Comparing version 1.2.24 to 1.2.25
18
index.js
@@ -57,19 +57,2 @@ // libs/base-shared/src/exceptions/base.ts | ||
var guessValueType = (item) => typeof item === "boolean" || item === void 0 ? item ? "Yes" : "No" : typeof item === "string" ? doesLooksLikeDate(item) && !isNaN(Date.parse(item)) && new Date(item).getFullYear() !== 2001 ? new Date(item).toString() : formatTextNicely(item) : item instanceof Date ? item.toLocaleDateString() : typeof item === "object" && item !== null ? JSON.stringify(item) : formatTextNicely(String(item)); | ||
var handleSubscribeClick = (pubkey, cb) => { | ||
navigator.serviceWorker.ready.then((registration) => { | ||
const padding = "=".repeat((4 - pubkey?.length % 4) % 4); | ||
const base64 = (pubkey + padding).replace(/-/g, "+").replace(/_/g, "/"); | ||
const rawData = window.atob(base64); | ||
const outputArray = new Uint8Array(rawData?.length); | ||
for (let i = 0; i < rawData?.length; ++i) { | ||
outputArray[i] = rawData.charCodeAt(i); | ||
} | ||
registration.pushManager.subscribe({ | ||
userVisibleOnly: true, | ||
applicationServerKey: outputArray | ||
}).then((pushSubscription) => cb(pushSubscription)).catch((error) => { | ||
console.log("Error during getSubscription()", error); | ||
}); | ||
}); | ||
}; | ||
var stringifyIfNeeded = (o) => { | ||
@@ -91,5 +74,4 @@ try { | ||
guessValueType, | ||
handleSubscribeClick, | ||
parseJSONWithType, | ||
stringifyIfNeeded | ||
}; |
{ | ||
"name": "@the-libs/base-shared", | ||
"version": "1.2.24", | ||
"version": "1.2.25", | ||
"dependencies": {}, | ||
@@ -5,0 +5,0 @@ "type": "module", |
@@ -7,4 +7,3 @@ export * from './format-text'; | ||
export declare const guessValueType: (item: TODO) => string; | ||
export declare const handleSubscribeClick: (pubkey: string, cb: (pushSubscription: TODO) => void) => void; | ||
export declare const stringifyIfNeeded: (o: TODO) => any; | ||
//# sourceMappingURL=index.d.ts.map |
Sorry, the diff of this file is not supported yet
7920
129