globalpayments-lib
Advanced tools
Comparing version 1.8.4 to 1.8.5
@@ -0,13 +1,16 @@ | ||
"use strict"; | ||
/// see https://gist.github.com/mudge/5830382 | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.EventEmitter = void 0; | ||
/* Polyfill indexOf. */ | ||
let indexOf; | ||
var indexOf; | ||
if (typeof Array.prototype.indexOf === "function") { | ||
indexOf = (haystack, needle) => haystack.indexOf(needle); | ||
indexOf = function (haystack, needle) { return haystack.indexOf(needle); }; | ||
} | ||
else { | ||
indexOf = (haystack, needle) => { | ||
const length = haystack.length; | ||
let i = 0; | ||
let idx = -1; | ||
let found = false; | ||
indexOf = function (haystack, needle) { | ||
var length = haystack.length; | ||
var i = 0; | ||
var idx = -1; | ||
var found = false; | ||
while (i < length && !found) { | ||
@@ -23,7 +26,7 @@ if (haystack[i] === needle) { | ||
} | ||
export class EventEmitter { | ||
constructor() { | ||
var EventEmitter = /** @class */ (function () { | ||
function EventEmitter() { | ||
this.events = {}; | ||
} | ||
on(event, listener) { | ||
EventEmitter.prototype.on = function (event, listener) { | ||
if (typeof this.events[event] !== "object") { | ||
@@ -33,5 +36,5 @@ this.events[event] = []; | ||
this.events[event].push(listener); | ||
} | ||
off(event, listener) { | ||
let idx; | ||
}; | ||
EventEmitter.prototype.off = function (event, listener) { | ||
var idx; | ||
if (typeof this.events[event] === "object") { | ||
@@ -43,7 +46,11 @@ idx = indexOf(this.events[event], listener); | ||
} | ||
} | ||
emit(event, ...args) { | ||
let i; | ||
let listeners; | ||
let length; | ||
}; | ||
EventEmitter.prototype.emit = function (event) { | ||
var args = []; | ||
for (var _i = 1; _i < arguments.length; _i++) { | ||
args[_i - 1] = arguments[_i]; | ||
} | ||
var i; | ||
var listeners; | ||
var length; | ||
if (typeof this.events[event] === "object") { | ||
@@ -56,5 +63,5 @@ listeners = this.events[event].slice(); | ||
} | ||
} | ||
once(event, listener) { | ||
const that = this; | ||
}; | ||
EventEmitter.prototype.once = function (event, listener) { | ||
var that = this; | ||
// tslint:disable-next-line:only-arrow-functions | ||
@@ -65,4 +72,6 @@ this.on(event, function g() { | ||
}); | ||
} | ||
} | ||
}; | ||
return EventEmitter; | ||
}()); | ||
exports.EventEmitter = EventEmitter; | ||
//# sourceMappingURL=event-emitter.js.map |
@@ -1,8 +0,12 @@ | ||
export function generateGuid() { | ||
const S4 = () => { | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.generateGuid = void 0; | ||
function generateGuid() { | ||
var S4 = function () { | ||
// tslint:disable-next-line:no-bitwise | ||
return (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1); | ||
}; | ||
return `${S4()}${S4()}-${S4()}-${S4()}-${S4()}-${S4()}${S4()}${S4()}`; | ||
return "" + S4() + S4() + "-" + S4() + "-" + S4() + "-" + S4() + "-" + S4() + S4() + S4(); | ||
} | ||
exports.generateGuid = generateGuid; | ||
//# sourceMappingURL=generate-guid.js.map |
@@ -1,3 +0,15 @@ | ||
export * from "./event-emitter"; | ||
export * from "./generate-guid"; | ||
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __exportStar = (this && this.__exportStar) || function(m, exports) { | ||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
__exportStar(require("./event-emitter"), exports); | ||
__exportStar(require("./generate-guid"), exports); | ||
//# sourceMappingURL=index.js.map |
"use strict"; | ||
if (!Array.prototype.forEach) { | ||
Array.prototype.forEach = function (fn) { | ||
for (let i = 0; i < this.length; i++) { | ||
for (var i = 0; i < this.length; i++) { | ||
fn(this[i], i, this); | ||
@@ -6,0 +6,0 @@ } |
@@ -1,17 +0,21 @@ | ||
import { fromByteArray, toByteArray } from "base64-js"; | ||
export function base64encode(text) { | ||
let i; | ||
const len = text.length; | ||
const Arr = typeof Uint8Array !== "undefined" ? Uint8Array : Array; | ||
const u8array = new Arr(len); | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.base64decode = exports.base64encode = void 0; | ||
var base64_js_1 = require("base64-js"); | ||
function base64encode(text) { | ||
var i; | ||
var len = text.length; | ||
var Arr = typeof Uint8Array !== "undefined" ? Uint8Array : Array; | ||
var u8array = new Arr(len); | ||
for (i = 0; i < len; i++) { | ||
u8array[i] = text.charCodeAt(i); | ||
} | ||
return fromByteArray(u8array); | ||
return base64_js_1.fromByteArray(u8array); | ||
} | ||
export function base64decode(text) { | ||
const u8Array = toByteArray(text); | ||
let i; | ||
const len = u8Array.length; | ||
let bStr = ""; | ||
exports.base64encode = base64encode; | ||
function base64decode(text) { | ||
var u8Array = base64_js_1.toByteArray(text); | ||
var i; | ||
var len = u8Array.length; | ||
var bStr = ""; | ||
for (i = 0; i < len; i++) { | ||
@@ -22,4 +26,5 @@ bStr += String.fromCharCode(u8Array[i]); | ||
} | ||
exports.base64decode = base64decode; | ||
window.btoa = window.btoa || base64encode; | ||
window.atob = window.atob || base64decode; | ||
//# sourceMappingURL=base64.js.map |
@@ -1,10 +0,12 @@ | ||
import "unfetch/polyfill"; | ||
import "./array-foreach"; | ||
import "./base64"; | ||
import "./json"; | ||
import "./object-freeze"; | ||
import "./object-getownpropertynames"; | ||
import "./parentnode-prepend"; | ||
import "./promise"; | ||
import "./string-repeat"; | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
require("unfetch/polyfill"); | ||
require("./array-foreach"); | ||
require("./base64"); | ||
require("./json"); | ||
require("./object-freeze"); | ||
require("./object-getownpropertynames"); | ||
require("./parentnode-prepend"); | ||
require("./promise"); | ||
require("./string-repeat"); | ||
//# sourceMappingURL=index.js.map |
@@ -1,3 +0,5 @@ | ||
import { JSON } from "./json2"; | ||
window.JSON = window.JSON || JSON; | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var json2_1 = require("./json2"); | ||
window.JSON = window.JSON || json2_1.JSON; | ||
//# sourceMappingURL=json.js.map |
@@ -0,1 +1,2 @@ | ||
"use strict"; | ||
/* ----------------------------------------------------------------------------- | ||
@@ -12,2 +13,4 @@ This file is based on or incorporates material from the projects listed below | ||
----------------------------------------------------------------------------- */ | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.JSON = void 0; | ||
/* | ||
@@ -164,4 +167,4 @@ json2.js | ||
// methods in a closure to avoid creating global variables. | ||
export let JSON = {}; | ||
(() => { | ||
exports.JSON = {}; | ||
(function () { | ||
"use strict"; | ||
@@ -189,4 +192,4 @@ function f(n) { | ||
}; | ||
const strProto = String.prototype; | ||
const numProto = Number.prototype; | ||
var strProto = String.prototype; | ||
var numProto = Number.prototype; | ||
numProto.JSON = strProto.JSON = Boolean.prototype.toJSON = function (_KEY) { | ||
@@ -196,8 +199,8 @@ return this.valueOf(); | ||
} | ||
const cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g; | ||
var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g; | ||
// tslint:disable-next-line | ||
const esc = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g; | ||
let gap; | ||
let indent; | ||
const meta = { | ||
var esc = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g; | ||
var gap; | ||
var indent; | ||
var meta = { | ||
// table of character substitutions | ||
@@ -212,3 +215,3 @@ "\b": "\\b", | ||
}; | ||
let rep; | ||
var rep; | ||
function quote(quoteStr) { | ||
@@ -222,4 +225,4 @@ // if the string contains no control characters, no quote characters, and no | ||
? '"' + | ||
quoteStr.replace(esc, (a) => { | ||
const c = meta[a]; | ||
quoteStr.replace(esc, function (a) { | ||
var c = meta[a]; | ||
return typeof c === "string" | ||
@@ -234,9 +237,9 @@ ? c | ||
// produce a string from holder[key]. | ||
let i; // the loop counter. | ||
let k; // the member key. | ||
let v; // the member value. | ||
let length; | ||
const mind = gap; | ||
let partial; | ||
let value = holder[key]; | ||
var i; // the loop counter. | ||
var k; // the member key. | ||
var v; // the member value. | ||
var length; | ||
var mind = gap; | ||
var partial; | ||
var value = holder[key]; | ||
// if the value has a toJSON method, call it to obtain a replacement value. | ||
@@ -336,4 +339,4 @@ if (value && | ||
// if the JSON object does not yet have a stringify method, give it one. | ||
if (typeof JSON.stringify !== "function") { | ||
JSON.stringify = (value, replacer, space) => { | ||
if (typeof exports.JSON.stringify !== "function") { | ||
exports.JSON.stringify = function (value, replacer, space) { | ||
// the stringify method takes a value and an optional replacer, and an optional | ||
@@ -344,3 +347,3 @@ // space parameter, and returns a JSON text. The replacer can be a function | ||
// produce text that is more easily readable. | ||
let i; | ||
var i; | ||
gap = ""; | ||
@@ -373,13 +376,13 @@ indent = ""; | ||
// if the JSON object does not yet have a parse method, give it one. | ||
if (typeof JSON.parse !== "function") { | ||
JSON.parse = (text, reviver) => { | ||
if (typeof exports.JSON.parse !== "function") { | ||
exports.JSON.parse = function (text, reviver) { | ||
// the parse method takes a text and an optional reviver function, and returns | ||
// a JavaScript value if the text is a valid JSON text. | ||
let j; | ||
var j; | ||
function walk(holder, key) { | ||
// the walk method is used to recursively walk the resulting structure so | ||
// that modifications can be made. | ||
let k; | ||
let v; | ||
const value = holder[key]; | ||
var k; | ||
var v; | ||
var value = holder[key]; | ||
if (value && typeof value === "object") { | ||
@@ -401,3 +404,3 @@ for (k in value) { | ||
if (cx.test(text)) { | ||
text = text.replace(cx, (a) => { | ||
text = text.replace(cx, function (a) { | ||
return "\\u" + ("0000" + a.charCodeAt(0).toString(16)).slice(-4); | ||
@@ -404,0 +407,0 @@ }); |
@@ -5,3 +5,3 @@ "use strict"; | ||
if (!Object.freeze) { | ||
Object.freeze = (object) => { | ||
Object.freeze = function (object) { | ||
if (Object(object) !== object) { | ||
@@ -18,7 +18,7 @@ throw new TypeError("Object.freeze can only be called on Objects."); | ||
try { | ||
Object.freeze(() => undefined); | ||
Object.freeze(function () { return undefined; }); | ||
} | ||
catch (exception) { | ||
Object.freeze = ((freezeObject) => { | ||
return (object) => { | ||
Object.freeze = (function (freezeObject) { | ||
return function (object) { | ||
if (typeof object === "function") { | ||
@@ -25,0 +25,0 @@ return object; |
@@ -8,5 +8,5 @@ "use strict"; | ||
if (!Object.getOwnPropertyNames) { | ||
Object.getOwnPropertyNames = (obj) => { | ||
const keys = []; | ||
for (const key in obj) { | ||
Object.getOwnPropertyNames = function (obj) { | ||
var keys = []; | ||
for (var key in obj) { | ||
if (typeof obj.hasOwnProperty !== "undefined" && | ||
@@ -13,0 +13,0 @@ obj.hasOwnProperty(key)) { |
"use strict"; | ||
// Source: https://developer.mozilla.org/en-US/docs/Web/API/ParentNode/prepend | ||
((arr) => { | ||
arr.forEach((item) => { | ||
(function (arr) { | ||
arr.forEach(function (item) { | ||
if (item.hasOwnProperty('prepend')) { | ||
@@ -13,6 +13,6 @@ return; | ||
value: function prepend() { | ||
const argArr = Array.prototype.slice.call(arguments); | ||
const docFrag = document.createDocumentFragment(); | ||
argArr.forEach((argItem) => { | ||
const isNode = argItem instanceof Node; | ||
var argArr = Array.prototype.slice.call(arguments); | ||
var docFrag = document.createDocumentFragment(); | ||
argArr.forEach(function (argItem) { | ||
var isNode = argItem instanceof Node; | ||
docFrag.appendChild(isNode ? argItem : document.createTextNode(String(argItem))); | ||
@@ -19,0 +19,0 @@ }); |
@@ -1,4 +0,6 @@ | ||
import * as Promise from "promise-polyfill"; | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var Promise = require("promise-polyfill"); | ||
window.Promise = | ||
window.Promise || Promise.default || Promise; | ||
//# sourceMappingURL=promise.js.map |
"use strict"; | ||
if (!String.prototype.repeat) { | ||
String.prototype.repeat = function (length) { | ||
let result = ""; | ||
for (let i = 0; i < length; i++) { | ||
var result = ""; | ||
for (var i = 0; i < length; i++) { | ||
result += this; | ||
@@ -7,0 +7,0 @@ } |
{ | ||
"name": "globalpayments-lib", | ||
"version": "1.8.4", | ||
"version": "1.8.5", | ||
"description": "Helper library for Global Payments JavaScript libraries", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
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 not supported yet
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 not supported yet
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 not supported yet
Sorry, the diff of this file is not supported yet
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
60115
660