@toruslabs/openlogin-utils
Advanced tools
Comparing version 2.1.0 to 2.13.0
@@ -70,3 +70,29 @@ /******/ (() => { // webpackBootstrap | ||
const randomId = () => external_randombytes_default()(32).toString("hex"); | ||
var randomId = function randomId() { | ||
return external_randombytes_default()(32).toString("hex"); | ||
}; | ||
;// CONCATENATED MODULE: external "@babel/runtime/helpers/classCallCheck" | ||
const classCallCheck_namespaceObject = require("@babel/runtime/helpers/classCallCheck"); | ||
var classCallCheck_default = /*#__PURE__*/__webpack_require__.n(classCallCheck_namespaceObject); | ||
;// CONCATENATED MODULE: external "@babel/runtime/helpers/createClass" | ||
const createClass_namespaceObject = require("@babel/runtime/helpers/createClass"); | ||
var createClass_default = /*#__PURE__*/__webpack_require__.n(createClass_namespaceObject); | ||
;// CONCATENATED MODULE: external "@babel/runtime/helpers/assertThisInitialized" | ||
const assertThisInitialized_namespaceObject = require("@babel/runtime/helpers/assertThisInitialized"); | ||
var assertThisInitialized_default = /*#__PURE__*/__webpack_require__.n(assertThisInitialized_namespaceObject); | ||
;// CONCATENATED MODULE: external "@babel/runtime/helpers/get" | ||
const get_namespaceObject = require("@babel/runtime/helpers/get"); | ||
var get_default = /*#__PURE__*/__webpack_require__.n(get_namespaceObject); | ||
;// CONCATENATED MODULE: external "@babel/runtime/helpers/inherits" | ||
const inherits_namespaceObject = require("@babel/runtime/helpers/inherits"); | ||
var inherits_default = /*#__PURE__*/__webpack_require__.n(inherits_namespaceObject); | ||
;// CONCATENATED MODULE: external "@babel/runtime/helpers/possibleConstructorReturn" | ||
const possibleConstructorReturn_namespaceObject = require("@babel/runtime/helpers/possibleConstructorReturn"); | ||
var possibleConstructorReturn_default = /*#__PURE__*/__webpack_require__.n(possibleConstructorReturn_namespaceObject); | ||
;// CONCATENATED MODULE: external "@babel/runtime/helpers/getPrototypeOf" | ||
const getPrototypeOf_namespaceObject = require("@babel/runtime/helpers/getPrototypeOf"); | ||
var getPrototypeOf_default = /*#__PURE__*/__webpack_require__.n(getPrototypeOf_namespaceObject); | ||
;// CONCATENATED MODULE: external "@babel/runtime/helpers/wrapNativeSuper" | ||
const wrapNativeSuper_namespaceObject = require("@babel/runtime/helpers/wrapNativeSuper"); | ||
var wrapNativeSuper_default = /*#__PURE__*/__webpack_require__.n(wrapNativeSuper_namespaceObject); | ||
;// CONCATENATED MODULE: external "@babel/runtime/helpers/defineProperty" | ||
@@ -77,15 +103,34 @@ const defineProperty_namespaceObject = require("@babel/runtime/helpers/defineProperty"); | ||
class URLWithHashParams extends URL { | ||
constructor() { | ||
super(...arguments); | ||
defineProperty_default()(this, "hashParams", new URLSearchParams()); | ||
} | ||
toString() { | ||
this.hash = this.hashParams.toString(); | ||
return super.toString.call(this); | ||
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = getPrototypeOf_default()(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = getPrototypeOf_default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return possibleConstructorReturn_default()(this, result); }; } | ||
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } | ||
var URLWithHashParams = /*#__PURE__*/function (_URL) { | ||
inherits_default()(URLWithHashParams, _URL); | ||
var _super = _createSuper(URLWithHashParams); | ||
function URLWithHashParams() { | ||
var _this; | ||
classCallCheck_default()(this, URLWithHashParams); | ||
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { | ||
args[_key] = arguments[_key]; | ||
} | ||
_this = _super.call.apply(_super, [this].concat(args)); | ||
defineProperty_default()(assertThisInitialized_default()(_this), "hashParams", new URLSearchParams()); | ||
return _this; | ||
} | ||
} | ||
createClass_default()(URLWithHashParams, [{ | ||
key: "toString", | ||
value: function toString() { | ||
this.hash = this.hashParams.toString(); | ||
return get_default()(getPrototypeOf_default()(URLWithHashParams.prototype), "toString", this).call(this); | ||
} | ||
}]); | ||
return URLWithHashParams; | ||
}( /*#__PURE__*/wrapNativeSuper_default()(URL)); | ||
;// CONCATENATED MODULE: external "base64url" | ||
@@ -100,3 +145,3 @@ const external_base64url_namespaceObject = require("base64url"); | ||
const base64url = (external_base64url_default()); | ||
var base64url = (external_base64url_default()); | ||
function safebtoa(str) { | ||
@@ -109,3 +154,3 @@ return base64url.encode(str); | ||
} | ||
const keccak = (external_keccak_default()); | ||
var keccak = (external_keccak_default()); | ||
function base64toJSON(b64str) { | ||
@@ -118,9 +163,7 @@ return JSON.parse(base64url.decode(b64str)); | ||
function keccak256(str) { | ||
let input = str; | ||
var input = str; | ||
if (typeof str === "string" && str.slice(0, 2) === "0x" && str.length === 66) { | ||
input = Buffer.from(str.slice(2), "hex"); | ||
} | ||
const data = "0x".concat(keccak("keccak256").update(input).digest("hex").padStart(64, "0")); | ||
var data = "0x".concat(keccak("keccak256").update(input).digest("hex").padStart(64, "0")); | ||
return data; | ||
@@ -127,0 +170,0 @@ } |
import randombytes from 'randombytes'; | ||
import _classCallCheck from '@babel/runtime/helpers/classCallCheck'; | ||
import _createClass from '@babel/runtime/helpers/createClass'; | ||
import _assertThisInitialized from '@babel/runtime/helpers/assertThisInitialized'; | ||
import _get from '@babel/runtime/helpers/get'; | ||
import _inherits from '@babel/runtime/helpers/inherits'; | ||
import _possibleConstructorReturn from '@babel/runtime/helpers/possibleConstructorReturn'; | ||
import _getPrototypeOf from '@babel/runtime/helpers/getPrototypeOf'; | ||
import _wrapNativeSuper from '@babel/runtime/helpers/wrapNativeSuper'; | ||
import _defineProperty from '@babel/runtime/helpers/defineProperty'; | ||
@@ -6,19 +14,32 @@ import base64urlLib from 'base64url'; | ||
const randomId = () => randombytes(32).toString("hex"); | ||
var randomId = function randomId() { | ||
return randombytes(32).toString("hex"); | ||
}; | ||
class URLWithHashParams extends URL { | ||
constructor() { | ||
super(...arguments); | ||
_defineProperty(this, "hashParams", new URLSearchParams()); | ||
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } | ||
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } | ||
var URLWithHashParams = /*#__PURE__*/function (_URL) { | ||
_inherits(URLWithHashParams, _URL); | ||
var _super = _createSuper(URLWithHashParams); | ||
function URLWithHashParams() { | ||
var _this; | ||
_classCallCheck(this, URLWithHashParams); | ||
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { | ||
args[_key] = arguments[_key]; | ||
} | ||
_this = _super.call.apply(_super, [this].concat(args)); | ||
_defineProperty(_assertThisInitialized(_this), "hashParams", new URLSearchParams()); | ||
return _this; | ||
} | ||
_createClass(URLWithHashParams, [{ | ||
key: "toString", | ||
value: function toString() { | ||
this.hash = this.hashParams.toString(); | ||
return _get(_getPrototypeOf(URLWithHashParams.prototype), "toString", this).call(this); | ||
} | ||
}]); | ||
return URLWithHashParams; | ||
}( /*#__PURE__*/_wrapNativeSuper(URL)); | ||
toString() { | ||
this.hash = this.hashParams.toString(); | ||
return super.toString.call(this); | ||
} | ||
} | ||
const base64url = base64urlLib; | ||
var base64url = base64urlLib; | ||
function safebtoa(str) { | ||
@@ -31,3 +52,3 @@ return base64url.encode(str); | ||
} | ||
const keccak = keccakLib; | ||
var keccak = keccakLib; | ||
function base64toJSON(b64str) { | ||
@@ -40,9 +61,7 @@ return JSON.parse(base64url.decode(b64str)); | ||
function keccak256(str) { | ||
let input = str; | ||
var input = str; | ||
if (typeof str === "string" && str.slice(0, 2) === "0x" && str.length === 66) { | ||
input = Buffer.from(str.slice(2), "hex"); | ||
} | ||
const data = "0x".concat(keccak("keccak256").update(input).digest("hex").padStart(64, "0")); | ||
var data = "0x".concat(keccak("keccak256").update(input).digest("hex").padStart(64, "0")); | ||
return data; | ||
@@ -49,0 +68,0 @@ } |
@@ -6,3 +6,3 @@ import keccakLib from "keccak"; | ||
export declare const keccak: typeof keccakLib; | ||
export declare type BufferEncoding = "ascii" | "utf8" | "utf-8" | "utf16le" | "ucs2" | "ucs-2" | "base64" | "latin1" | "binary" | "hex"; | ||
export type BufferEncoding = "ascii" | "utf8" | "utf-8" | "utf16le" | "ucs2" | "ucs-2" | "base64" | "latin1" | "binary" | "hex"; | ||
export declare function base64toJSON(b64str: string): Record<string, unknown>; | ||
@@ -9,0 +9,0 @@ export declare function jsonToBase64(json: Record<string, unknown>): string; |
{ | ||
"name": "@toruslabs/openlogin-utils", | ||
"version": "2.1.0", | ||
"version": "2.13.0", | ||
"homepage": "https://github.com/torusresearch/OpenLoginSdk#readme", | ||
@@ -24,3 +24,3 @@ "license": "ISC", | ||
"base64url": "^3.0.1", | ||
"keccak": "^3.0.2", | ||
"keccak": "^3.0.3", | ||
"randombytes": "^2.1.0" | ||
@@ -56,3 +56,3 @@ }, | ||
}, | ||
"gitHead": "49e7d748e15601a8e032cce52e7609ccca9d5df7" | ||
"gitHead": "9b71d0d86fbb98734cd08e91c1b0491e055f91e4" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
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
811
490078
19
Updatedkeccak@^3.0.3