@rg-dev/stdlib
Advanced tools
@@ -25,2 +25,3 @@ "use strict"; | ||
| copyToClipboard: () => copyToClipboard, | ||
| getBaseHref: () => getBaseHref, | ||
| parseFileInput: () => parseFileInput, | ||
@@ -35,2 +36,10 @@ parseFormData: () => parseFormData | ||
| // src/browser-env.ts | ||
| function getBaseHref() { | ||
| var _a; | ||
| const base = ((_a = document.querySelector("base")) == null ? void 0 : _a.getAttribute("href")) || ""; | ||
| if (!base) { | ||
| console.warn(`no base address, please add <base> to the html`); | ||
| } | ||
| return base; | ||
| } | ||
| function parseFileInput(e) { | ||
@@ -37,0 +46,0 @@ if (e instanceof HTMLInputElement) { |
| export { VERSION } from './index.cjs'; | ||
| declare function getBaseHref(): string; | ||
| declare function parseFileInput(e: Event | HTMLInputElement): File[]; | ||
@@ -9,2 +10,2 @@ declare function parseFormData<T = Record<string, string>>(e: Event | FormData | HTMLFormElement): T; | ||
| export { copyToClipboard, parseFileInput, parseFormData }; | ||
| export { copyToClipboard, getBaseHref, parseFileInput, parseFormData }; |
| export { VERSION } from './index.js'; | ||
| declare function getBaseHref(): string; | ||
| declare function parseFileInput(e: Event | HTMLInputElement): File[]; | ||
@@ -9,2 +10,2 @@ declare function parseFormData<T = Record<string, string>>(e: Event | FormData | HTMLFormElement): T; | ||
| export { copyToClipboard, parseFileInput, parseFormData }; | ||
| export { copyToClipboard, getBaseHref, parseFileInput, parseFormData }; |
@@ -5,2 +5,10 @@ // src/index.ts | ||
| // src/browser-env.ts | ||
| function getBaseHref() { | ||
| var _a; | ||
| const base = ((_a = document.querySelector("base")) == null ? void 0 : _a.getAttribute("href")) || ""; | ||
| if (!base) { | ||
| console.warn(`no base address, please add <base> to the html`); | ||
| } | ||
| return base; | ||
| } | ||
| function parseFileInput(e) { | ||
@@ -91,4 +99,5 @@ if (e instanceof HTMLInputElement) { | ||
| copyToClipboard, | ||
| getBaseHref, | ||
| parseFileInput, | ||
| parseFormData | ||
| }; |
+1
-1
| { | ||
| "name": "@rg-dev/stdlib", | ||
| "version": "1.0.66", | ||
| "version": "1.0.67", | ||
| "description": "", | ||
@@ -5,0 +5,0 @@ "scripts": { |
620835
0.1%15621
0.12%