File: 1001_fix_types.patch

package info (click to toggle)
node-base64url 3.0.1-8
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 316 kB
  • sloc: javascript: 62; makefile: 13; sh: 6
file content (25 lines) | stat: -rw-r--r-- 976 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
Description: Fix adjust type string -> BufferEncoding
 Seemingly related code change:
 <https://github.com/DefinitelyTyped/DefinitelyTyped/commit/ff1b97f>
Author: Jonas Smedegaard <dr@jones.dk>
Last-Update: 2020-02-26
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/src/base64url.ts
+++ b/src/base64url.ts
@@ -1,13 +1,13 @@
 import padString from "./pad-string";
 
-function encode(input: string | Buffer, encoding: string = "utf8"): string {
+function encode(input: string | Buffer, encoding: BufferEncoding = "utf8"): string {
     if (Buffer.isBuffer(input)) {
         return fromBase64(input.toString("base64"));
     }
     return fromBase64(Buffer.from(input as string, encoding).toString("base64"));
 };
 
-function decode(base64url: string, encoding: string = "utf8"): string {
+function decode(base64url: string, encoding: BufferEncoding = "utf8"): string {
     return Buffer.from(toBase64(base64url), "base64").toString(encoding);
 }