UNPKG

@foal/core

Version:

Full-featured Node.js framework, with no complexity

17 lines (16 loc) 489 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.convertBase64ToBase64url = convertBase64ToBase64url; /** * Converts a base64-encoded string into a base64url-encoded string with no equals. * * @export * @param {string} str The base64-encoded string. * @returns {string} The base64url-encoded string. */ function convertBase64ToBase64url(str) { return str .replace(/\+/g, '-') .replace(/\//g, '_') .replace(/=/g, ''); }