Add support for 0x prefix in hexadecimal

This commit is contained in:
Kevin Kandlbinder 2022-05-03 16:37:44 +02:00
parent 1a3c739061
commit ca0a6cf102
3 changed files with 3 additions and 5 deletions

View file

@ -1,6 +1,6 @@
{ {
"name": "kevins-data-toolbox", "name": "kevins-data-toolbox",
"version": "2.2.2", "version": "2.2.3",
"private": true, "private": true,
"dependencies": { "dependencies": {
"@loadable/component": "^5.15.0", "@loadable/component": "^5.15.0",

View file

@ -10,12 +10,10 @@
import { clientsClaim } from 'workbox-core'; import { clientsClaim } from 'workbox-core';
import { ExpirationPlugin } from 'workbox-expiration'; import { ExpirationPlugin } from 'workbox-expiration';
import {CacheableResponsePlugin} from 'workbox-cacheable-response';
import { precacheAndRoute, createHandlerBoundToURL } from 'workbox-precaching'; import { precacheAndRoute, createHandlerBoundToURL } from 'workbox-precaching';
import { registerRoute } from 'workbox-routing'; import { registerRoute } from 'workbox-routing';
import { StaleWhileRevalidate, CacheFirst } from 'workbox-strategies'; import { StaleWhileRevalidate } from 'workbox-strategies';
import {setCacheNameDetails} from 'workbox-core'; import {setCacheNameDetails} from 'workbox-core';
import {BackgroundSyncPlugin} from 'workbox-background-sync';
declare const self: ServiceWorkerGlobalScope; declare const self: ServiceWorkerGlobalScope;

View file

@ -26,7 +26,7 @@ const NumberBaseTool = () => {
num = parseInt(input.replaceAll(" ", ""), 10) num = parseInt(input.replaceAll(" ", ""), 10)
break break
case "hex": case "hex":
num = parseInt(input.replaceAll(" ", ""), 16) num = parseInt(input.replaceAll(" ", "").replace(/^(0x)/,''), 16)
break break
case "oct": case "oct":
num = parseInt(input.replaceAll(" ", ""), 8) num = parseInt(input.replaceAll(" ", ""), 8)