@better-auth/utils
Advanced tools
+2
-2
@@ -78,3 +78,3 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); | ||
| * Encodes data into a Base32 string. | ||
| * @param data - The data to encode (ArrayBuffer, TypedArray, or string). | ||
| * @param data - The data to encode (ArrayBuffer, number-based TypedArray, or string). | ||
| * @param options - Encoding options. | ||
@@ -104,3 +104,3 @@ * @returns The Base32 encoded string. | ||
| * Encodes data into a Base32hex string. | ||
| * @param data - The data to encode (ArrayBuffer, TypedArray, or string). | ||
| * @param data - The data to encode (ArrayBuffer, number-based TypedArray, or string). | ||
| * @param options - Encoding options. | ||
@@ -107,0 +107,0 @@ * @returns The Base32hex encoded string. |
@@ -1,2 +0,2 @@ | ||
| import { TypedArray, Uint8Array_ } from "./type.cjs"; | ||
| import { NumberTypedArray, TypedArray, Uint8Array_ } from "./type.cjs"; | ||
| //#region src/base32.d.ts | ||
@@ -9,7 +9,7 @@ /** | ||
| * Encodes data into a Base32 string. | ||
| * @param data - The data to encode (ArrayBuffer, TypedArray, or string). | ||
| * @param data - The data to encode (ArrayBuffer, number-based TypedArray, or string). | ||
| * @param options - Encoding options. | ||
| * @returns The Base32 encoded string. | ||
| */ | ||
| encode(data: ArrayBuffer | TypedArray | string, options?: { | ||
| encode(data: ArrayBuffer | NumberTypedArray | string, options?: { | ||
| padding?: boolean; | ||
@@ -30,7 +30,7 @@ }): string; | ||
| * Encodes data into a Base32hex string. | ||
| * @param data - The data to encode (ArrayBuffer, TypedArray, or string). | ||
| * @param data - The data to encode (ArrayBuffer, number-based TypedArray, or string). | ||
| * @param options - Encoding options. | ||
| * @returns The Base32hex encoded string. | ||
| */ | ||
| encode(data: ArrayBuffer | TypedArray | string, options?: { | ||
| encode(data: ArrayBuffer | NumberTypedArray | string, options?: { | ||
| padding?: boolean; | ||
@@ -37,0 +37,0 @@ }): string; |
@@ -1,2 +0,2 @@ | ||
| import { TypedArray, Uint8Array_ } from "./type.mjs"; | ||
| import { NumberTypedArray, TypedArray, Uint8Array_ } from "./type.mjs"; | ||
| //#region src/base32.d.ts | ||
@@ -9,7 +9,7 @@ /** | ||
| * Encodes data into a Base32 string. | ||
| * @param data - The data to encode (ArrayBuffer, TypedArray, or string). | ||
| * @param data - The data to encode (ArrayBuffer, number-based TypedArray, or string). | ||
| * @param options - Encoding options. | ||
| * @returns The Base32 encoded string. | ||
| */ | ||
| encode(data: ArrayBuffer | TypedArray | string, options?: { | ||
| encode(data: ArrayBuffer | NumberTypedArray | string, options?: { | ||
| padding?: boolean; | ||
@@ -30,7 +30,7 @@ }): string; | ||
| * Encodes data into a Base32hex string. | ||
| * @param data - The data to encode (ArrayBuffer, TypedArray, or string). | ||
| * @param data - The data to encode (ArrayBuffer, number-based TypedArray, or string). | ||
| * @param options - Encoding options. | ||
| * @returns The Base32hex encoded string. | ||
| */ | ||
| encode(data: ArrayBuffer | TypedArray | string, options?: { | ||
| encode(data: ArrayBuffer | NumberTypedArray | string, options?: { | ||
| padding?: boolean; | ||
@@ -37,0 +37,0 @@ }): string; |
+2
-2
@@ -77,3 +77,3 @@ import { toUint8Array } from "./bytes.mjs"; | ||
| * Encodes data into a Base32 string. | ||
| * @param data - The data to encode (ArrayBuffer, TypedArray, or string). | ||
| * @param data - The data to encode (ArrayBuffer, number-based TypedArray, or string). | ||
| * @param options - Encoding options. | ||
@@ -103,3 +103,3 @@ * @returns The Base32 encoded string. | ||
| * Encodes data into a Base32hex string. | ||
| * @param data - The data to encode (ArrayBuffer, TypedArray, or string). | ||
| * @param data - The data to encode (ArrayBuffer, number-based TypedArray, or string). | ||
| * @param options - Encoding options. | ||
@@ -106,0 +106,0 @@ * @returns The Base32hex encoded string. |
@@ -1,5 +0,5 @@ | ||
| import { TypedArray } from "./type.cjs"; | ||
| import { NumberTypedArray, TypedArray } from "./type.cjs"; | ||
| //#region src/base64.d.ts | ||
| declare const base64: { | ||
| encode(data: ArrayBuffer | TypedArray | string, options?: { | ||
| encode(data: ArrayBuffer | NumberTypedArray | string, options?: { | ||
| padding?: boolean; | ||
@@ -10,3 +10,3 @@ }): string; | ||
| declare const base64Url: { | ||
| encode(data: ArrayBuffer | TypedArray | string, options?: { | ||
| encode(data: ArrayBuffer | NumberTypedArray | string, options?: { | ||
| padding?: boolean; | ||
@@ -13,0 +13,0 @@ }): string; |
@@ -1,5 +0,5 @@ | ||
| import { TypedArray } from "./type.mjs"; | ||
| import { NumberTypedArray, TypedArray } from "./type.mjs"; | ||
| //#region src/base64.d.ts | ||
| declare const base64: { | ||
| encode(data: ArrayBuffer | TypedArray | string, options?: { | ||
| encode(data: ArrayBuffer | NumberTypedArray | string, options?: { | ||
| padding?: boolean; | ||
@@ -10,3 +10,3 @@ }): string; | ||
| declare const base64Url: { | ||
| encode(data: ArrayBuffer | TypedArray | string, options?: { | ||
| encode(data: ArrayBuffer | NumberTypedArray | string, options?: { | ||
| padding?: boolean; | ||
@@ -13,0 +13,0 @@ }): string; |
+2
-2
@@ -11,4 +11,4 @@ //#region src/bytes.ts | ||
| * | ||
| * `ArrayBuffer` inputs share memory with the returned view, while `TypedArray` | ||
| * inputs are copied according to native constructor semantics. | ||
| * `ArrayBuffer` inputs share memory with the returned view, while number-based | ||
| * `TypedArray` inputs are copied according to native constructor semantics. | ||
| * | ||
@@ -15,0 +15,0 @@ * @see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#buffer | ArrayBuffer constructor behavior} |
+2
-2
@@ -11,4 +11,4 @@ //#region src/bytes.ts | ||
| * | ||
| * `ArrayBuffer` inputs share memory with the returned view, while `TypedArray` | ||
| * inputs are copied according to native constructor semantics. | ||
| * `ArrayBuffer` inputs share memory with the returned view, while number-based | ||
| * `TypedArray` inputs are copied according to native constructor semantics. | ||
| * | ||
@@ -15,0 +15,0 @@ * @see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#buffer | ArrayBuffer constructor behavior} |
+2
-2
@@ -1,5 +0,5 @@ | ||
| import { TypedArray, Uint8Array_ } from "./type.cjs"; | ||
| import { NumberTypedArray, TypedArray, Uint8Array_ } from "./type.cjs"; | ||
| //#region src/hex.d.ts | ||
| declare const hex: { | ||
| encode: (data: string | ArrayBuffer | TypedArray) => string; | ||
| encode: (data: string | ArrayBuffer | NumberTypedArray) => string; | ||
| decode: (data: string | ArrayBuffer | TypedArray) => string; | ||
@@ -6,0 +6,0 @@ toBytes: (data: string) => Uint8Array_; |
+2
-2
@@ -1,5 +0,5 @@ | ||
| import { TypedArray, Uint8Array_ } from "./type.mjs"; | ||
| import { NumberTypedArray, TypedArray, Uint8Array_ } from "./type.mjs"; | ||
| //#region src/hex.d.ts | ||
| declare const hex: { | ||
| encode: (data: string | ArrayBuffer | TypedArray) => string; | ||
| encode: (data: string | ArrayBuffer | NumberTypedArray) => string; | ||
| decode: (data: string | ArrayBuffer | TypedArray) => string; | ||
@@ -6,0 +6,0 @@ toBytes: (data: string) => Uint8Array_; |
+3
-2
| //#region src/type.d.ts | ||
| type TypedArray = Uint8Array | Int8Array | Uint16Array | Int16Array | Uint32Array | Int32Array | Float32Array | Float64Array | BigInt64Array | BigUint64Array; | ||
| type NumberTypedArray = Uint8Array | Uint8ClampedArray | Int8Array | Uint16Array | Int16Array | Uint32Array | Int32Array | Float32Array | Float64Array; | ||
| type TypedArray = NumberTypedArray | BigInt64Array | BigUint64Array; | ||
| /** | ||
@@ -23,2 +24,2 @@ * Equivalent to `Uint8Array` before TypeScript 5.7, and `Uint8Array<ArrayBuffer>` in TypeScript 5.7 | ||
| //#endregion | ||
| export { ECDSACurve, EncodingFormat, ExportKeyFormat, SHAFamily, TypedArray, Uint8Array_ }; | ||
| export { ECDSACurve, EncodingFormat, ExportKeyFormat, NumberTypedArray, SHAFamily, TypedArray, Uint8Array_ }; |
+3
-2
| //#region src/type.d.ts | ||
| type TypedArray = Uint8Array | Int8Array | Uint16Array | Int16Array | Uint32Array | Int32Array | Float32Array | Float64Array | BigInt64Array | BigUint64Array; | ||
| type NumberTypedArray = Uint8Array | Uint8ClampedArray | Int8Array | Uint16Array | Int16Array | Uint32Array | Int32Array | Float32Array | Float64Array; | ||
| type TypedArray = NumberTypedArray | BigInt64Array | BigUint64Array; | ||
| /** | ||
@@ -23,2 +24,2 @@ * Equivalent to `Uint8Array` before TypeScript 5.7, and `Uint8Array<ArrayBuffer>` in TypeScript 5.7 | ||
| //#endregion | ||
| export { ECDSACurve, EncodingFormat, ExportKeyFormat, SHAFamily, TypedArray, Uint8Array_ }; | ||
| export { ECDSACurve, EncodingFormat, ExportKeyFormat, NumberTypedArray, SHAFamily, TypedArray, Uint8Array_ }; |
+2
-1
| { | ||
| "name": "@better-auth/utils", | ||
| "version": "0.4.3", | ||
| "version": "0.5.0", | ||
| "license": "MIT", | ||
@@ -25,2 +25,3 @@ "description": "A collection of utilities for better-auth", | ||
| "happy-dom": "^15.11.7", | ||
| "lefthook": "^2.1.4", | ||
| "tsdown": "0.22.9", | ||
@@ -27,0 +28,0 @@ "typescript": "^6.0.3", |
+2
-2
@@ -305,3 +305,3 @@ # Better Auth Utils | ||
| Encode data in base64 format. Input can be a string, `ArrayBuffer`, or `TypedArray`. | ||
| Encode data in base64 format. Input can be a string, `ArrayBuffer`, or number-based `TypedArray`. BigInt typed arrays are not supported. | ||
@@ -347,3 +347,3 @@ ```ts | ||
| Encode data in hexadecimal format. Input can be a string, `ArrayBuffer`, or `TypedArray`. | ||
| Encode data in hexadecimal format. Input can be a string, `ArrayBuffer`, or number-based `TypedArray`. BigInt typed arrays are not supported. | ||
@@ -350,0 +350,0 @@ ```ts |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
70076
0.85%0
-100%8
14.29%