Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@twilio/replay-event-emitter

Package Overview
Dependencies
Maintainers
1
Versions
63
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@twilio/replay-event-emitter - npm Package Compare versions

Comparing version 0.2.3 to 0.2.4-rc.0

204

builds/browser.js

@@ -16,166 +16,24 @@ /*

function _arrayLikeToArray(arr, len) {
if (len == null || len > arr.length) len = arr.length;
var _toConsumableArray = require('@babel/runtime/helpers/toConsumableArray');
var _classCallCheck = require('@babel/runtime/helpers/classCallCheck');
var _createClass = require('@babel/runtime/helpers/createClass');
var _assertThisInitialized = require('@babel/runtime/helpers/assertThisInitialized');
var _get = require('@babel/runtime/helpers/get');
var _inherits = require('@babel/runtime/helpers/inherits');
var _possibleConstructorReturn = require('@babel/runtime/helpers/possibleConstructorReturn');
var _getPrototypeOf = require('@babel/runtime/helpers/getPrototypeOf');
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
for (var i = 0, arr2 = new Array(len); i < len; i++) {
arr2[i] = arr[i];
}
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
return arr2;
}
var _toConsumableArray__default = /*#__PURE__*/_interopDefaultLegacy(_toConsumableArray);
var _classCallCheck__default = /*#__PURE__*/_interopDefaultLegacy(_classCallCheck);
var _createClass__default = /*#__PURE__*/_interopDefaultLegacy(_createClass);
var _assertThisInitialized__default = /*#__PURE__*/_interopDefaultLegacy(_assertThisInitialized);
var _get__default = /*#__PURE__*/_interopDefaultLegacy(_get);
var _inherits__default = /*#__PURE__*/_interopDefaultLegacy(_inherits);
var _possibleConstructorReturn__default = /*#__PURE__*/_interopDefaultLegacy(_possibleConstructorReturn);
var _getPrototypeOf__default = /*#__PURE__*/_interopDefaultLegacy(_getPrototypeOf);
var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
function _arrayWithoutHoles(arr) {
if (Array.isArray(arr)) return _arrayLikeToArray(arr);
}
function _iterableToArray(iter) {
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
}
function _unsupportedIterableToArray(o, minLen) {
if (!o) return;
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
var n = Object.prototype.toString.call(o).slice(8, -1);
if (n === "Object" && o.constructor) n = o.constructor.name;
if (n === "Map" || n === "Set") return Array.from(o);
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
}
function _nonIterableSpread() {
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _toConsumableArray(arr) {
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
}
function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
}
function _defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || false;
descriptor.configurable = true;
if ("value" in descriptor) descriptor.writable = true;
Object.defineProperty(target, descriptor.key, descriptor);
}
}
function _createClass(Constructor, protoProps, staticProps) {
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
if (staticProps) _defineProperties(Constructor, staticProps);
return Constructor;
}
function _assertThisInitialized(self) {
if (self === void 0) {
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
}
return self;
}
function _getPrototypeOf(o) {
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
return o.__proto__ || Object.getPrototypeOf(o);
};
return _getPrototypeOf(o);
}
function _superPropBase(object, property) {
while (!Object.prototype.hasOwnProperty.call(object, property)) {
object = _getPrototypeOf(object);
if (object === null) break;
}
return object;
}
function _get(target, property, receiver) {
if (typeof Reflect !== "undefined" && Reflect.get) {
_get = Reflect.get;
} else {
_get = function _get(target, property, receiver) {
var base = _superPropBase(target, property);
if (!base) return;
var desc = Object.getOwnPropertyDescriptor(base, property);
if (desc.get) {
return desc.get.call(receiver);
}
return desc.value;
};
}
return _get(target, property, receiver || target);
}
function _setPrototypeOf(o, p) {
_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
o.__proto__ = p;
return o;
};
return _setPrototypeOf(o, p);
}
function _inherits(subClass, superClass) {
if (typeof superClass !== "function" && superClass !== null) {
throw new TypeError("Super expression must either be null or a function");
}
subClass.prototype = Object.create(superClass && superClass.prototype, {
constructor: {
value: subClass,
writable: true,
configurable: true
}
});
if (superClass) _setPrototypeOf(subClass, superClass);
}
function _typeof(obj) {
"@babel/helpers - typeof";
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
_typeof = function _typeof(obj) {
return typeof obj;
};
} else {
_typeof = function _typeof(obj) {
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
};
}
return _typeof(obj);
}
function _possibleConstructorReturn(self, call) {
if (call && (_typeof(call) === "object" || typeof call === "function")) {
return call;
}
return _assertThisInitialized(self);
}
function _defineProperty(obj, key, value) {
if (key in obj) {
Object.defineProperty(obj, key, {
value: value,
enumerable: true,
configurable: true,
writable: true
});
} else {
obj[key] = value;
}
return obj;
}
var domain;

@@ -653,7 +511,7 @@

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 _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf__default['default'](Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf__default['default'](this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn__default['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 ReplayEventEmitter = /*#__PURE__*/function (_EventEmitter) {
_inherits(ReplayEventEmitter, _EventEmitter);
_inherits__default['default'](ReplayEventEmitter, _EventEmitter);

@@ -665,7 +523,7 @@ var _super = _createSuper(ReplayEventEmitter);

_classCallCheck(this, ReplayEventEmitter);
_classCallCheck__default['default'](this, ReplayEventEmitter);
_this = _super.call(this);
_defineProperty(_assertThisInitialized(_this), "eventHistory", new Map());
_defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "eventHistory", new Map());

@@ -675,6 +533,6 @@ return _this;

_createClass(ReplayEventEmitter, [{
_createClass__default['default'](ReplayEventEmitter, [{
key: "on",
value: function on(event, listener) {
return _get(_getPrototypeOf(ReplayEventEmitter.prototype), "on", this).call(this, event, listener);
return _get__default['default'](_getPrototypeOf__default['default'](ReplayEventEmitter.prototype), "on", this).call(this, event, listener);
}

@@ -684,3 +542,3 @@ }, {

value: function once(event, listener) {
return _get(_getPrototypeOf(ReplayEventEmitter.prototype), "once", this).call(this, event, listener);
return _get__default['default'](_getPrototypeOf__default['default'](ReplayEventEmitter.prototype), "once", this).call(this, event, listener);
}

@@ -690,3 +548,3 @@ }, {

value: function off(event, listener) {
return _get(_getPrototypeOf(ReplayEventEmitter.prototype), "off", this).call(this, event, listener);
return _get__default['default'](_getPrototypeOf__default['default'](ReplayEventEmitter.prototype), "off", this).call(this, event, listener);
}

@@ -703,3 +561,3 @@ }, {

this.eventHistory.set(event, args);
return (_get2 = _get(_getPrototypeOf(ReplayEventEmitter.prototype), "emit", this)).call.apply(_get2, [this, event].concat(args));
return (_get2 = _get__default['default'](_getPrototypeOf__default['default'](ReplayEventEmitter.prototype), "emit", this)).call.apply(_get2, [this, event].concat(args));
}

@@ -709,3 +567,3 @@ }, {

value: function addListener(event, listener) {
return _get(_getPrototypeOf(ReplayEventEmitter.prototype), "addListener", this).call(this, event, listener);
return _get__default['default'](_getPrototypeOf__default['default'](ReplayEventEmitter.prototype), "addListener", this).call(this, event, listener);
}

@@ -715,3 +573,3 @@ }, {

value: function removeListener(event, listener) {
return _get(_getPrototypeOf(ReplayEventEmitter.prototype), "removeListener", this).call(this, event, listener);
return _get__default['default'](_getPrototypeOf__default['default'](ReplayEventEmitter.prototype), "removeListener", this).call(this, event, listener);
}

@@ -724,3 +582,3 @@ }, {

if (historyEntry !== undefined) {
listener.apply(void 0, _toConsumableArray(historyEntry));
listener.apply(void 0, _toConsumableArray__default['default'](historyEntry));
}

@@ -727,0 +585,0 @@

@@ -16,173 +16,30 @@ /*

var _toConsumableArray = require('@babel/runtime/helpers/toConsumableArray');
var _classCallCheck = require('@babel/runtime/helpers/classCallCheck');
var _createClass = require('@babel/runtime/helpers/createClass');
var _assertThisInitialized = require('@babel/runtime/helpers/assertThisInitialized');
var _get = require('@babel/runtime/helpers/get');
var _inherits = require('@babel/runtime/helpers/inherits');
var _possibleConstructorReturn = require('@babel/runtime/helpers/possibleConstructorReturn');
var _getPrototypeOf = require('@babel/runtime/helpers/getPrototypeOf');
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
var events = require('events');
function _arrayLikeToArray(arr, len) {
if (len == null || len > arr.length) len = arr.length;
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
for (var i = 0, arr2 = new Array(len); i < len; i++) {
arr2[i] = arr[i];
}
var _toConsumableArray__default = /*#__PURE__*/_interopDefaultLegacy(_toConsumableArray);
var _classCallCheck__default = /*#__PURE__*/_interopDefaultLegacy(_classCallCheck);
var _createClass__default = /*#__PURE__*/_interopDefaultLegacy(_createClass);
var _assertThisInitialized__default = /*#__PURE__*/_interopDefaultLegacy(_assertThisInitialized);
var _get__default = /*#__PURE__*/_interopDefaultLegacy(_get);
var _inherits__default = /*#__PURE__*/_interopDefaultLegacy(_inherits);
var _possibleConstructorReturn__default = /*#__PURE__*/_interopDefaultLegacy(_possibleConstructorReturn);
var _getPrototypeOf__default = /*#__PURE__*/_interopDefaultLegacy(_getPrototypeOf);
var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
return arr2;
}
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf__default['default'](Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf__default['default'](this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn__default['default'](this, result); }; }
function _arrayWithoutHoles(arr) {
if (Array.isArray(arr)) return _arrayLikeToArray(arr);
}
function _iterableToArray(iter) {
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
}
function _unsupportedIterableToArray(o, minLen) {
if (!o) return;
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
var n = Object.prototype.toString.call(o).slice(8, -1);
if (n === "Object" && o.constructor) n = o.constructor.name;
if (n === "Map" || n === "Set") return Array.from(o);
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
}
function _nonIterableSpread() {
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _toConsumableArray(arr) {
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
}
function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
}
function _defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || false;
descriptor.configurable = true;
if ("value" in descriptor) descriptor.writable = true;
Object.defineProperty(target, descriptor.key, descriptor);
}
}
function _createClass(Constructor, protoProps, staticProps) {
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
if (staticProps) _defineProperties(Constructor, staticProps);
return Constructor;
}
function _assertThisInitialized(self) {
if (self === void 0) {
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
}
return self;
}
function _getPrototypeOf(o) {
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
return o.__proto__ || Object.getPrototypeOf(o);
};
return _getPrototypeOf(o);
}
function _superPropBase(object, property) {
while (!Object.prototype.hasOwnProperty.call(object, property)) {
object = _getPrototypeOf(object);
if (object === null) break;
}
return object;
}
function _get(target, property, receiver) {
if (typeof Reflect !== "undefined" && Reflect.get) {
_get = Reflect.get;
} else {
_get = function _get(target, property, receiver) {
var base = _superPropBase(target, property);
if (!base) return;
var desc = Object.getOwnPropertyDescriptor(base, property);
if (desc.get) {
return desc.get.call(receiver);
}
return desc.value;
};
}
return _get(target, property, receiver || target);
}
function _setPrototypeOf(o, p) {
_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
o.__proto__ = p;
return o;
};
return _setPrototypeOf(o, p);
}
function _inherits(subClass, superClass) {
if (typeof superClass !== "function" && superClass !== null) {
throw new TypeError("Super expression must either be null or a function");
}
subClass.prototype = Object.create(superClass && superClass.prototype, {
constructor: {
value: subClass,
writable: true,
configurable: true
}
});
if (superClass) _setPrototypeOf(subClass, superClass);
}
function _typeof(obj) {
"@babel/helpers - typeof";
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
_typeof = function _typeof(obj) {
return typeof obj;
};
} else {
_typeof = function _typeof(obj) {
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
};
}
return _typeof(obj);
}
function _possibleConstructorReturn(self, call) {
if (call && (_typeof(call) === "object" || typeof call === "function")) {
return call;
}
return _assertThisInitialized(self);
}
function _defineProperty(obj, key, value) {
if (key in obj) {
Object.defineProperty(obj, key, {
value: value,
enumerable: true,
configurable: true,
writable: true
});
} else {
obj[key] = value;
}
return obj;
}
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 ReplayEventEmitter = /*#__PURE__*/function (_EventEmitter) {
_inherits(ReplayEventEmitter, _EventEmitter);
_inherits__default['default'](ReplayEventEmitter, _EventEmitter);

@@ -194,7 +51,7 @@ var _super = _createSuper(ReplayEventEmitter);

_classCallCheck(this, ReplayEventEmitter);
_classCallCheck__default['default'](this, ReplayEventEmitter);
_this = _super.call(this);
_defineProperty(_assertThisInitialized(_this), "eventHistory", new Map());
_defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "eventHistory", new Map());

@@ -204,6 +61,6 @@ return _this;

_createClass(ReplayEventEmitter, [{
_createClass__default['default'](ReplayEventEmitter, [{
key: "on",
value: function on(event, listener) {
return _get(_getPrototypeOf(ReplayEventEmitter.prototype), "on", this).call(this, event, listener);
return _get__default['default'](_getPrototypeOf__default['default'](ReplayEventEmitter.prototype), "on", this).call(this, event, listener);
}

@@ -213,3 +70,3 @@ }, {

value: function once(event, listener) {
return _get(_getPrototypeOf(ReplayEventEmitter.prototype), "once", this).call(this, event, listener);
return _get__default['default'](_getPrototypeOf__default['default'](ReplayEventEmitter.prototype), "once", this).call(this, event, listener);
}

@@ -219,3 +76,3 @@ }, {

value: function off(event, listener) {
return _get(_getPrototypeOf(ReplayEventEmitter.prototype), "off", this).call(this, event, listener);
return _get__default['default'](_getPrototypeOf__default['default'](ReplayEventEmitter.prototype), "off", this).call(this, event, listener);
}

@@ -232,3 +89,3 @@ }, {

this.eventHistory.set(event, args);
return (_get2 = _get(_getPrototypeOf(ReplayEventEmitter.prototype), "emit", this)).call.apply(_get2, [this, event].concat(args));
return (_get2 = _get__default['default'](_getPrototypeOf__default['default'](ReplayEventEmitter.prototype), "emit", this)).call.apply(_get2, [this, event].concat(args));
}

@@ -238,3 +95,3 @@ }, {

value: function addListener(event, listener) {
return _get(_getPrototypeOf(ReplayEventEmitter.prototype), "addListener", this).call(this, event, listener);
return _get__default['default'](_getPrototypeOf__default['default'](ReplayEventEmitter.prototype), "addListener", this).call(this, event, listener);
}

@@ -244,3 +101,3 @@ }, {

value: function removeListener(event, listener) {
return _get(_getPrototypeOf(ReplayEventEmitter.prototype), "removeListener", this).call(this, event, listener);
return _get__default['default'](_getPrototypeOf__default['default'](ReplayEventEmitter.prototype), "removeListener", this).call(this, event, listener);
}

@@ -253,3 +110,3 @@ }, {

if (historyEntry !== undefined) {
listener.apply(void 0, _toConsumableArray(historyEntry));
listener.apply(void 0, _toConsumableArray__default['default'](historyEntry));
}

@@ -256,0 +113,0 @@

8

CHANGELOG.md

@@ -6,2 +6,10 @@ # Change Log

### [0.2.4-rc.0](https://github.com/twilio/rtd-sdk-monorepo-js/compare/@twilio/replay-event-emitter@0.2.3...@twilio/replay-event-emitter@0.2.4-rc.0) (2022-01-28)
**Note:** Version bump only for package @twilio/replay-event-emitter
### [0.2.3](https://github.com/twilio/rtd-sdk-monorepo-js/compare/@twilio/replay-event-emitter@0.2.3-rc.4...@twilio/replay-event-emitter@0.2.3) (2021-11-25)

@@ -8,0 +16,0 @@

{
"name": "@twilio/replay-event-emitter",
"version": "0.2.3",
"version": "0.2.4-rc.0",
"description": "An extension to Node's EventEmitter that supports event replay.",

@@ -20,3 +20,3 @@ "main": "./builds/lib.js",

"clean": "rm -rf ./dist ./builds ./docs",
"lint": "npx eslint . --ext .ts",
"lint": "npx eslint src --ext .ts",
"test:unit": "jest",

@@ -30,2 +30,6 @@ "test:integration": "echo OK",

"license": "MIT",
"dependencies": {
"@babel/runtime": "^7.14.5",
"core-js": "^3.17.3"
},
"devDependencies": {

@@ -32,0 +36,0 @@ "@rollup/plugin-node-resolve": "^13.0.0",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc