a collection of lightweight TypeScript packages for AT Protocol, the protocol powering Bluesky
atproto bluesky typescript npm
101
fork

Configure Feed

Select the types of activity you want to include in your feed.

refactor(multibase): add explicit type declaration to the polyfill

Mary 2979cd8d bc54ef89

+50 -10
+10 -2
packages/utilities/multibase/lib/bases/base16-web-polyfill.ts
··· 2 2 3 3 const BASE16_CHARSET = '0123456789abcdef'; 4 4 5 - export const fromBase16 = /*#__PURE__*/ createRfc4648Decode(BASE16_CHARSET, 4, false); 6 - export const toBase16 = /*#__PURE__*/ createRfc4648Encode(BASE16_CHARSET, 4, false); 5 + export const fromBase16: (str: string) => Uint8Array = /*#__PURE__*/ createRfc4648Decode( 6 + BASE16_CHARSET, 7 + 4, 8 + false, 9 + ); 10 + export const toBase16: (bytes: Uint8Array) => string = /*#__PURE__*/ createRfc4648Encode( 11 + BASE16_CHARSET, 12 + 4, 13 + false, 14 + );
+40 -8
packages/utilities/multibase/lib/bases/base64-web-polyfill.ts
··· 4 4 const BASE64URL_CHARSET = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_'; 5 5 6 6 // #region base64 7 - export const fromBase64 = /*#__PURE__*/ createRfc4648Decode(BASE64_CHARSET, 6, false); 8 - export const toBase64 = /*#__PURE__*/ createRfc4648Encode(BASE64_CHARSET, 6, false); 7 + export const fromBase64: (str: string) => Uint8Array = /*#__PURE__*/ createRfc4648Decode( 8 + BASE64_CHARSET, 9 + 6, 10 + false, 11 + ); 12 + export const toBase64: (bytes: Uint8Array) => string = /*#__PURE__*/ createRfc4648Encode( 13 + BASE64_CHARSET, 14 + 6, 15 + false, 16 + ); 9 17 // #endregion 10 18 11 19 // #region base64pad 12 - export const fromBase64Pad = /*#__PURE__*/ createRfc4648Decode(BASE64_CHARSET, 6, true); 13 - export const toBase64Pad = /*#__PURE__*/ createRfc4648Encode(BASE64_CHARSET, 6, true); 20 + export const fromBase64Pad: (str: string) => Uint8Array = /*#__PURE__*/ createRfc4648Decode( 21 + BASE64_CHARSET, 22 + 6, 23 + true, 24 + ); 25 + export const toBase64Pad: (bytes: Uint8Array) => string = /*#__PURE__*/ createRfc4648Encode( 26 + BASE64_CHARSET, 27 + 6, 28 + true, 29 + ); 14 30 // #endregion 15 31 16 32 // #region base64url 17 - export const fromBase64Url = /*#__PURE__*/ createRfc4648Decode(BASE64URL_CHARSET, 6, false); 18 - export const toBase64Url = /*#__PURE__*/ createRfc4648Encode(BASE64URL_CHARSET, 6, false); 33 + export const fromBase64Url: (str: string) => Uint8Array = /*#__PURE__*/ createRfc4648Decode( 34 + BASE64URL_CHARSET, 35 + 6, 36 + false, 37 + ); 38 + export const toBase64Url: (bytes: Uint8Array) => string = /*#__PURE__*/ createRfc4648Encode( 39 + BASE64URL_CHARSET, 40 + 6, 41 + false, 42 + ); 19 43 // #endregion 20 44 21 45 // #region base64urlpad 22 - export const fromBase64UrlPad = /*#__PURE__*/ createRfc4648Decode(BASE64URL_CHARSET, 6, true); 23 - export const toBase64UrlPad = /*#__PURE__*/ createRfc4648Encode(BASE64URL_CHARSET, 6, true); 46 + export const fromBase64UrlPad: (str: string) => Uint8Array = /*#__PURE__*/ createRfc4648Decode( 47 + BASE64URL_CHARSET, 48 + 6, 49 + true, 50 + ); 51 + export const toBase64UrlPad: (bytes: Uint8Array) => string = /*#__PURE__*/ createRfc4648Encode( 52 + BASE64URL_CHARSET, 53 + 6, 54 + true, 55 + ); 24 56 // #endregion