Comparing version 3.0.0 to 3.0.1
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const pad_string_1 = require("./pad-string"); | ||
function encode(input, encoding = "utf8") { | ||
var pad_string_1 = require("./pad-string"); | ||
function encode(input, encoding) { | ||
if (encoding === void 0) { encoding = "utf8"; } | ||
if (Buffer.isBuffer(input)) { | ||
@@ -11,3 +12,4 @@ return fromBase64(input.toString("base64")); | ||
; | ||
function decode(base64url, encoding = "utf8") { | ||
function decode(base64url, encoding) { | ||
if (encoding === void 0) { encoding = "utf8"; } | ||
return Buffer.from(toBase64(base64url), "base64").toString(encoding); | ||
@@ -30,3 +32,3 @@ } | ||
} | ||
let base64url = encode; | ||
var base64url = encode; | ||
base64url.encode = encode; | ||
@@ -33,0 +35,0 @@ base64url.decode = decode; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
function padString(input) { | ||
let segmentLength = 4; | ||
let stringLength = input.length; | ||
let diff = stringLength % segmentLength; | ||
var segmentLength = 4; | ||
var stringLength = input.length; | ||
var diff = stringLength % segmentLength; | ||
if (!diff) { | ||
return input; | ||
} | ||
let position = stringLength; | ||
let padLength = segmentLength - diff; | ||
let paddedStringLength = stringLength + padLength; | ||
let buffer = Buffer.alloc(paddedStringLength); | ||
var position = stringLength; | ||
var padLength = segmentLength - diff; | ||
var paddedStringLength = stringLength + padLength; | ||
var buffer = Buffer.alloc(paddedStringLength); | ||
buffer.write(input); | ||
@@ -15,0 +15,0 @@ while (padLength--) { |
{ | ||
"name": "base64url", | ||
"version": "3.0.0", | ||
"version": "3.0.1", | ||
"description": "For encoding to/from base64urls", | ||
"main": "index.js", | ||
"types": "./dist/base64url.d.ts", | ||
"files": [ | ||
@@ -27,6 +28,9 @@ "dist/", | ||
"readmeFilename": "README.md", | ||
"engines": { | ||
"node": ">=6.0.0" | ||
}, | ||
"devDependencies": { | ||
"@types/node": "^10.0.0", | ||
"tap": "6.1.1" | ||
"tap": "^12.1.0" | ||
} | ||
} |
@@ -97,2 +97,7 @@ # base64url [![Build Status](https://secure.travis-ci.org/brianloveswords/base64url.png)](http://travis-ci.org/brianloveswords/base64url) | ||
# Supported Node.js versions | ||
This library should be used with current versions of the Node.js runtime's long-term stable (LTS) | ||
schedule. More information can be found [at the Node.js Release Working Group](https://github.com/nodejs/Release) repo. | ||
# License | ||
@@ -99,0 +104,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
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.
Found 1 instance in 1 package
7548
71
128
0