base64url-universal
Advanced tools
Comparing version 1.1.0 to 2.0.0
/*! | ||
* Copyright (c) 2018-2019 Digital Bazaar, Inc. All rights reserved. | ||
* Copyright (c) 2018-2022 Digital Bazaar, Inc. All rights reserved. | ||
*/ | ||
'use strict'; | ||
/** | ||
@@ -10,2 +8,3 @@ * Encode/Decode input according to the "Base64url Encoding" format as specified | ||
* trailing '=', line breaks, whitespace, and other characters are omitted. | ||
* | ||
* @module base64url-universal | ||
@@ -33,7 +32,7 @@ */ | ||
* @alias module:base64url-universal | ||
* @param {(Uint8Array | string)} input the data to encode. | ||
* @param {(Uint8Array | string)} input - The data to encode. | ||
* | ||
* @return {string} the encoded value. | ||
* @returns {string} The encoded value. | ||
*/ | ||
function encode(input) { | ||
export function encode(input) { | ||
if(!((input instanceof Uint8Array) || (typeof input === 'string'))) { | ||
@@ -47,3 +46,5 @@ throw new TypeError('"input" be a string or Uint8Array.'); | ||
let output = ''; | ||
let chr1, chr2, chr3; | ||
let chr1; | ||
let chr2; | ||
let chr3; | ||
let i = 0; | ||
@@ -74,7 +75,7 @@ while(i < input.byteLength) { | ||
* @alias module:base64url-universal | ||
* @param {string} input the data to decode. | ||
* @param {string} input - The data to decode. | ||
* | ||
* @return {Uint8Array} the decoded value. | ||
* @returns {Uint8Array} The decoded value. | ||
*/ | ||
function decode(input) { | ||
export function decode(input) { | ||
let length = input.length; | ||
@@ -93,4 +94,8 @@ const mod4 = length % 4; | ||
let enc1, enc2, enc3, enc4; | ||
let i = 0, j = 0; | ||
let enc1; | ||
let enc2; | ||
let enc3; | ||
let enc4; | ||
let i = 0; | ||
let j = 0; | ||
@@ -116,3 +121,1 @@ while(i < length) { | ||
} | ||
module.exports = {decode, encode}; |
/*! | ||
* Copyright (c) 2018-2019 Digital Bazaar, Inc. All rights reserved. | ||
* Copyright (c) 2018-2022 Digital Bazaar, Inc. All rights reserved. | ||
*/ | ||
'use strict'; | ||
const api = {}; | ||
module.exports = api; | ||
const base64url = require('./base64url'); | ||
api.encode = base64url.encode; | ||
api.decode = base64url.decode; | ||
export {encode, decode} from './base64url.js'; |
/*! | ||
* Copyright (c) 2018-2019 Digital Bazaar, Inc. All rights reserved. | ||
* Copyright (c) 2018-2022 Digital Bazaar, Inc. All rights reserved. | ||
*/ | ||
'use strict'; | ||
import base64url from 'base64url'; | ||
const api = {}; | ||
module.exports = api; | ||
const base64url = require('base64url'); | ||
api.encode = base64url.encode; | ||
api.decode = base64url.toBuffer; | ||
export const encode = base64url.encode; | ||
export const decode = base64url.toBuffer; |
{ | ||
"name": "base64url-universal", | ||
"version": "1.1.0", | ||
"version": "2.0.0", | ||
"description": "Encode/decode \"Base64url Encoding\" format of JSON Web Signature (JWS) RFC7517.", | ||
@@ -20,57 +20,41 @@ "homepage": "https://github.com/digitalbazaar/base64url-universal", | ||
"license": "BSD-3-Clause", | ||
"main": "lib", | ||
"type": "module", | ||
"exports": "./lib/index.js", | ||
"browser": { | ||
"./lib/index.js": "./lib/browser.js" | ||
}, | ||
"files": [ | ||
"dist/*.js", | ||
"dist/*.js.map", | ||
"lib/*.js" | ||
"lib/**/*.js" | ||
], | ||
"dependencies": { | ||
"base64url": "^3.0.0" | ||
"base64url": "^3.0.1" | ||
}, | ||
"devDependencies": { | ||
"@babel/core": "^7.4.5", | ||
"@babel/plugin-transform-modules-commonjs": "^7.4.4", | ||
"@babel/plugin-transform-runtime": "^7.4.4", | ||
"@babel/preset-env": "^7.4.5", | ||
"@babel/runtime": "^7.4.5", | ||
"babel-loader": "^8.0.6", | ||
"benchmark": "^2.1.4", | ||
"chai": "^4.1.2", | ||
"c8": "^7.11.3", | ||
"chai": "^4.3.6", | ||
"chai-bytes": "^0.1.2", | ||
"core-js": "^3.1.4", | ||
"cross-env": "^5.1.3", | ||
"eslint": "^6.0.1", | ||
"eslint-config-digitalbazaar": "^2.0.0", | ||
"karma": "^4.1.0", | ||
"karma-babel-preprocessor": "^8.0.0", | ||
"karma-chrome-launcher": "^2.2.0", | ||
"karma-edge-launcher": "^0.4.2", | ||
"karma-firefox-launcher": "^1.1.0", | ||
"karma-ie-launcher": "^1.0.0", | ||
"karma-mocha": "^1.3.0", | ||
"cross-env": "^7.0.3", | ||
"eslint": "^8.16.0", | ||
"eslint-config-digitalbazaar": "^3.0.0", | ||
"eslint-plugin-jsdoc": "^39.3.2", | ||
"eslint-plugin-unicorn": "^42.0.0", | ||
"karma": "^6.3.20", | ||
"karma-chrome-launcher": "^3.1.1", | ||
"karma-mocha": "^2.0.1", | ||
"karma-mocha-reporter": "^2.2.5", | ||
"karma-safari-launcher": "^1.0.0", | ||
"karma-sourcemap-loader": "^0.3.7", | ||
"karma-tap-reporter": "0.0.6", | ||
"karma-webpack": "^4.0.2", | ||
"mocha": "^6.1.4", | ||
"karma-sourcemap-loader": "^0.3.8", | ||
"karma-webpack": "^5.0.0", | ||
"mocha": "^10.0.0", | ||
"mocha-lcov-reporter": "^1.3.0", | ||
"nyc": "^14.1.1", | ||
"webpack": "^4.35.2", | ||
"webpack-cli": "^3.3.6" | ||
"webpack": "^5.72.1" | ||
}, | ||
"nyc": { | ||
"exclude": [ | ||
"tests" | ||
], | ||
"c8": { | ||
"reporter": [ | ||
"html", | ||
"text-summary" | ||
"lcov", | ||
"text-summary", | ||
"text" | ||
] | ||
}, | ||
"browser": { | ||
"./lib/index.js": "./lib/browser.js" | ||
}, | ||
"engines": { | ||
"node": ">=8.3.0" | ||
"node": ">=14" | ||
}, | ||
@@ -80,9 +64,7 @@ "scripts": { | ||
"test-node": "cross-env NODE_ENV=test mocha --preserve-symlinks -t 30000 -A -R ${REPORTER:-spec} tests/*.spec.js", | ||
"test-karma": "karma start", | ||
"benchmark": "node benchmark/benchmark.js", | ||
"coverage": "cross-env NODE_ENV=test nyc --reporter=lcov --reporter=text-summary npm run test-node", | ||
"coverage-report": "nyc report", | ||
"lint": "eslint lib tests", | ||
"prepublish": "npm run build", | ||
"build": "webpack" | ||
"test-karma": "karma start karma.conf.cjs", | ||
"coverage": "cross-env NODE_ENV=test c8 npm run test-node", | ||
"coverage-ci": "cross-env NODE_ENV=test c8 --reporter=lcovonly --reporter=text-summary --reporter=text npm run test-node", | ||
"coverage-report": "c8 report", | ||
"lint": "eslint ." | ||
}, | ||
@@ -89,0 +71,0 @@ "keywords": [ |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
17
0
Yes
9453
6
116
Updatedbase64url@^3.0.1