@thednp/shorty 2.0.10 → 2.0.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -5,9 +5,6 @@
5
5
  [![NPM Version](https://img.shields.io/npm/v/@thednp/shorty.svg)](https://www.npmjs.com/package/@thednp/shorty)
6
6
  [![NPM Downloads](https://img.shields.io/npm/dm/@thednp/shorty.svg)](http://npm-stat.com/charts.html?package=@thednp/shorty)
7
7
  [![jsDelivr hits (npm)](https://img.shields.io/jsdelivr/npm/hw/@thednp/shorty)](https://www.jsdelivr.com/package/npm/@thednp/shorty)
8
- [![typescript version](https://img.shields.io/badge/typescript-5.7.2-brightgreen)](https://www.typescriptlang.org/)
9
- [![vitest version](https://img.shields.io/badge/vitest-2.1.6-brightgreen)](https://vitest.dev/)
10
- [![vite version](https://img.shields.io/badge/vite-5.4.11-brightgreen)](https://github.com/vitejs)
11
8
 
12
9
 
13
10
  A small TypeScript library with various tools for increasing your productivity while helping you to create lighter libraries or web components. If there is anything that is consistently repeating itself, **shorty** can help you save up to 50% of the code required, with little to no performance cost.
@@ -0,0 +1,26 @@
1
+ /*!
2
+ * @thednp/shorty ESM v2.0.12 (https://github.com/thednp/shorty)
3
+ * Copyright 2026 © thednp
4
+ * Licensed under MIT (https://github.com/thednp/shorty/blob/master/LICENSE)
5
+ */
6
+ "use strict";
7
+
8
+ import { createRequire } from "node:module";
9
+ (() => {
10
+ var table = new Uint8Array(128);
11
+ for (var i = 0; i < 64; i++) table[i < 26 ? i + 65 : i < 52 ? i + 71 : i < 62 ? i - 4 : i * 4 - 205] = i;
12
+ return (base64) => {
13
+ var n = base64.length, bytes = new Uint8Array((n - (base64[n - 1] == "=") - (base64[n - 2] == "=")) * 3 / 4 | 0);
14
+ for (var i = 0, j = 0; i < n;) {
15
+ var c0 = table[base64.charCodeAt(i++)], c1 = table[base64.charCodeAt(i++)];
16
+ var c2 = table[base64.charCodeAt(i++)], c3 = table[base64.charCodeAt(i++)];
17
+ bytes[j++] = c0 << 2 | c1 >> 4;
18
+ bytes[j++] = c1 << 4 | c2 >> 2;
19
+ bytes[j++] = c2 << 6 | c3;
20
+ }
21
+ return bytes;
22
+ };
23
+ })();
24
+ createRequire(import.meta.url);
25
+ //#endregion
26
+ export {};