@openfeature/web-sdk
Advanced tools
Comparing version 0.3.0-experimental to 0.3.1-experimental
@@ -97,11 +97,11 @@ "use strict"; | ||
}; | ||
function EventEmitter2() { | ||
EventEmitter2.init.call(this); | ||
function EventEmitter() { | ||
EventEmitter.init.call(this); | ||
} | ||
module2.exports = EventEmitter2; | ||
module2.exports = EventEmitter; | ||
module2.exports.once = once; | ||
EventEmitter2.EventEmitter = EventEmitter2; | ||
EventEmitter2.prototype._events = void 0; | ||
EventEmitter2.prototype._eventsCount = 0; | ||
EventEmitter2.prototype._maxListeners = void 0; | ||
EventEmitter.EventEmitter = EventEmitter; | ||
EventEmitter.prototype._events = void 0; | ||
EventEmitter.prototype._eventsCount = 0; | ||
EventEmitter.prototype._maxListeners = void 0; | ||
var defaultMaxListeners = 10; | ||
@@ -113,3 +113,3 @@ function checkListener(listener) { | ||
} | ||
Object.defineProperty(EventEmitter2, "defaultMaxListeners", { | ||
Object.defineProperty(EventEmitter, "defaultMaxListeners", { | ||
enumerable: true, | ||
@@ -126,3 +126,3 @@ get: function() { | ||
}); | ||
EventEmitter2.init = function() { | ||
EventEmitter.init = function() { | ||
if (this._events === void 0 || this._events === Object.getPrototypeOf(this)._events) { | ||
@@ -134,3 +134,3 @@ this._events = /* @__PURE__ */ Object.create(null); | ||
}; | ||
EventEmitter2.prototype.setMaxListeners = function setMaxListeners(n) { | ||
EventEmitter.prototype.setMaxListeners = function setMaxListeners(n) { | ||
if (typeof n !== "number" || n < 0 || NumberIsNaN(n)) { | ||
@@ -144,9 +144,9 @@ throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received ' + n + "."); | ||
if (that._maxListeners === void 0) | ||
return EventEmitter2.defaultMaxListeners; | ||
return EventEmitter.defaultMaxListeners; | ||
return that._maxListeners; | ||
} | ||
EventEmitter2.prototype.getMaxListeners = function getMaxListeners() { | ||
EventEmitter.prototype.getMaxListeners = function getMaxListeners() { | ||
return _getMaxListeners(this); | ||
}; | ||
EventEmitter2.prototype.emit = function emit(type) { | ||
EventEmitter.prototype.emit = function emit(type) { | ||
var args = []; | ||
@@ -229,7 +229,7 @@ for (var i = 1; i < arguments.length; i++) | ||
} | ||
EventEmitter2.prototype.addListener = function addListener(type, listener) { | ||
EventEmitter.prototype.addListener = function addListener(type, listener) { | ||
return _addListener(this, type, listener, false); | ||
}; | ||
EventEmitter2.prototype.on = EventEmitter2.prototype.addListener; | ||
EventEmitter2.prototype.prependListener = function prependListener(type, listener) { | ||
EventEmitter.prototype.on = EventEmitter.prototype.addListener; | ||
EventEmitter.prototype.prependListener = function prependListener(type, listener) { | ||
return _addListener(this, type, listener, true); | ||
@@ -253,3 +253,3 @@ }; | ||
} | ||
EventEmitter2.prototype.once = function once2(type, listener) { | ||
EventEmitter.prototype.once = function once2(type, listener) { | ||
checkListener(listener); | ||
@@ -259,3 +259,3 @@ this.on(type, _onceWrap(this, type, listener)); | ||
}; | ||
EventEmitter2.prototype.prependOnceListener = function prependOnceListener(type, listener) { | ||
EventEmitter.prototype.prependOnceListener = function prependOnceListener(type, listener) { | ||
checkListener(listener); | ||
@@ -265,3 +265,3 @@ this.prependListener(type, _onceWrap(this, type, listener)); | ||
}; | ||
EventEmitter2.prototype.removeListener = function removeListener(type, listener) { | ||
EventEmitter.prototype.removeListener = function removeListener(type, listener) { | ||
var list, events, position, i, originalListener; | ||
@@ -306,4 +306,4 @@ checkListener(listener); | ||
}; | ||
EventEmitter2.prototype.off = EventEmitter2.prototype.removeListener; | ||
EventEmitter2.prototype.removeAllListeners = function removeAllListeners(type) { | ||
EventEmitter.prototype.off = EventEmitter.prototype.removeListener; | ||
EventEmitter.prototype.removeAllListeners = function removeAllListeners(type) { | ||
var listeners, events, i; | ||
@@ -360,9 +360,9 @@ events = this._events; | ||
} | ||
EventEmitter2.prototype.listeners = function listeners(type) { | ||
EventEmitter.prototype.listeners = function listeners(type) { | ||
return _listeners(this, type, true); | ||
}; | ||
EventEmitter2.prototype.rawListeners = function rawListeners(type) { | ||
EventEmitter.prototype.rawListeners = function rawListeners(type) { | ||
return _listeners(this, type, false); | ||
}; | ||
EventEmitter2.listenerCount = function(emitter, type) { | ||
EventEmitter.listenerCount = function(emitter, type) { | ||
if (typeof emitter.listenerCount === "function") { | ||
@@ -374,3 +374,3 @@ return emitter.listenerCount(type); | ||
}; | ||
EventEmitter2.prototype.listenerCount = listenerCount; | ||
EventEmitter.prototype.listenerCount = listenerCount; | ||
function listenerCount(type) { | ||
@@ -388,3 +388,3 @@ var events = this._events; | ||
} | ||
EventEmitter2.prototype.eventNames = function eventNames() { | ||
EventEmitter.prototype.eventNames = function eventNames() { | ||
return this._eventsCount > 0 ? ReflectOwnKeys(this._events) : []; | ||
@@ -480,3 +480,2 @@ }; | ||
module.exports = __toCommonJS(src_exports); | ||
var import_events = __toESM(require_events()); | ||
@@ -738,2 +737,5 @@ // ../shared/src/types.ts | ||
// src/types.ts | ||
var import_events = __toESM(require_events()); | ||
// src/open-feature.ts | ||
@@ -740,0 +742,0 @@ var GLOBAL_OPENFEATURE_API_KEY = Symbol.for("@openfeature/js.api"); |
@@ -91,11 +91,11 @@ var __create = Object.create; | ||
}; | ||
function EventEmitter2() { | ||
EventEmitter2.init.call(this); | ||
function EventEmitter() { | ||
EventEmitter.init.call(this); | ||
} | ||
module.exports = EventEmitter2; | ||
module.exports = EventEmitter; | ||
module.exports.once = once; | ||
EventEmitter2.EventEmitter = EventEmitter2; | ||
EventEmitter2.prototype._events = void 0; | ||
EventEmitter2.prototype._eventsCount = 0; | ||
EventEmitter2.prototype._maxListeners = void 0; | ||
EventEmitter.EventEmitter = EventEmitter; | ||
EventEmitter.prototype._events = void 0; | ||
EventEmitter.prototype._eventsCount = 0; | ||
EventEmitter.prototype._maxListeners = void 0; | ||
var defaultMaxListeners = 10; | ||
@@ -107,3 +107,3 @@ function checkListener(listener) { | ||
} | ||
Object.defineProperty(EventEmitter2, "defaultMaxListeners", { | ||
Object.defineProperty(EventEmitter, "defaultMaxListeners", { | ||
enumerable: true, | ||
@@ -120,3 +120,3 @@ get: function() { | ||
}); | ||
EventEmitter2.init = function() { | ||
EventEmitter.init = function() { | ||
if (this._events === void 0 || this._events === Object.getPrototypeOf(this)._events) { | ||
@@ -128,3 +128,3 @@ this._events = /* @__PURE__ */ Object.create(null); | ||
}; | ||
EventEmitter2.prototype.setMaxListeners = function setMaxListeners(n) { | ||
EventEmitter.prototype.setMaxListeners = function setMaxListeners(n) { | ||
if (typeof n !== "number" || n < 0 || NumberIsNaN(n)) { | ||
@@ -138,9 +138,9 @@ throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received ' + n + "."); | ||
if (that._maxListeners === void 0) | ||
return EventEmitter2.defaultMaxListeners; | ||
return EventEmitter.defaultMaxListeners; | ||
return that._maxListeners; | ||
} | ||
EventEmitter2.prototype.getMaxListeners = function getMaxListeners() { | ||
EventEmitter.prototype.getMaxListeners = function getMaxListeners() { | ||
return _getMaxListeners(this); | ||
}; | ||
EventEmitter2.prototype.emit = function emit(type) { | ||
EventEmitter.prototype.emit = function emit(type) { | ||
var args = []; | ||
@@ -223,7 +223,7 @@ for (var i = 1; i < arguments.length; i++) | ||
} | ||
EventEmitter2.prototype.addListener = function addListener(type, listener) { | ||
EventEmitter.prototype.addListener = function addListener(type, listener) { | ||
return _addListener(this, type, listener, false); | ||
}; | ||
EventEmitter2.prototype.on = EventEmitter2.prototype.addListener; | ||
EventEmitter2.prototype.prependListener = function prependListener(type, listener) { | ||
EventEmitter.prototype.on = EventEmitter.prototype.addListener; | ||
EventEmitter.prototype.prependListener = function prependListener(type, listener) { | ||
return _addListener(this, type, listener, true); | ||
@@ -247,3 +247,3 @@ }; | ||
} | ||
EventEmitter2.prototype.once = function once2(type, listener) { | ||
EventEmitter.prototype.once = function once2(type, listener) { | ||
checkListener(listener); | ||
@@ -253,3 +253,3 @@ this.on(type, _onceWrap(this, type, listener)); | ||
}; | ||
EventEmitter2.prototype.prependOnceListener = function prependOnceListener(type, listener) { | ||
EventEmitter.prototype.prependOnceListener = function prependOnceListener(type, listener) { | ||
checkListener(listener); | ||
@@ -259,3 +259,3 @@ this.prependListener(type, _onceWrap(this, type, listener)); | ||
}; | ||
EventEmitter2.prototype.removeListener = function removeListener(type, listener) { | ||
EventEmitter.prototype.removeListener = function removeListener(type, listener) { | ||
var list, events, position, i, originalListener; | ||
@@ -300,4 +300,4 @@ checkListener(listener); | ||
}; | ||
EventEmitter2.prototype.off = EventEmitter2.prototype.removeListener; | ||
EventEmitter2.prototype.removeAllListeners = function removeAllListeners(type) { | ||
EventEmitter.prototype.off = EventEmitter.prototype.removeListener; | ||
EventEmitter.prototype.removeAllListeners = function removeAllListeners(type) { | ||
var listeners, events, i; | ||
@@ -354,9 +354,9 @@ events = this._events; | ||
} | ||
EventEmitter2.prototype.listeners = function listeners(type) { | ||
EventEmitter.prototype.listeners = function listeners(type) { | ||
return _listeners(this, type, true); | ||
}; | ||
EventEmitter2.prototype.rawListeners = function rawListeners(type) { | ||
EventEmitter.prototype.rawListeners = function rawListeners(type) { | ||
return _listeners(this, type, false); | ||
}; | ||
EventEmitter2.listenerCount = function(emitter, type) { | ||
EventEmitter.listenerCount = function(emitter, type) { | ||
if (typeof emitter.listenerCount === "function") { | ||
@@ -368,3 +368,3 @@ return emitter.listenerCount(type); | ||
}; | ||
EventEmitter2.prototype.listenerCount = listenerCount; | ||
EventEmitter.prototype.listenerCount = listenerCount; | ||
function listenerCount(type) { | ||
@@ -382,3 +382,3 @@ var events = this._events; | ||
} | ||
EventEmitter2.prototype.eventNames = function eventNames() { | ||
EventEmitter.prototype.eventNames = function eventNames() { | ||
return this._eventsCount > 0 ? ReflectOwnKeys(this._events) : []; | ||
@@ -449,5 +449,2 @@ }; | ||
// src/index.ts | ||
var import_events = __toESM(require_events()); | ||
// ../shared/src/types.ts | ||
@@ -708,2 +705,5 @@ var ProviderEvents = /* @__PURE__ */ ((ProviderEvents2) => { | ||
// src/types.ts | ||
var import_events = __toESM(require_events()); | ||
// src/open-feature.ts | ||
@@ -710,0 +710,0 @@ var GLOBAL_OPENFEATURE_API_KEY = Symbol.for("@openfeature/js.api"); |
@@ -1,30 +0,1 @@ | ||
// Type definitions for events 3.0 | ||
// Project: https://github.com/Gozala/events | ||
// Definitions by: Yasunori Ohoka <https://github.com/yasupeke> | ||
// Shenwei Wang <https://github.com/weareoutman> | ||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped | ||
type Listener = (...args: any[]) => void; | ||
declare class EventEmitter { | ||
static listenerCount(emitter: EventEmitter, type: string | number): number; | ||
static defaultMaxListeners: number; | ||
eventNames(): Array<string | number>; | ||
setMaxListeners(n: number): this; | ||
getMaxListeners(): number; | ||
emit(type: string | number, ...args: any[]): boolean; | ||
addListener(type: string | number, listener: Listener): this; | ||
on(type: string | number, listener: Listener): this; | ||
once(type: string | number, listener: Listener): this; | ||
prependListener(type: string | number, listener: Listener): this; | ||
prependOnceListener(type: string | number, listener: Listener): this; | ||
removeListener(type: string | number, listener: Listener): this; | ||
off(type: string | number, listener: Listener): this; | ||
removeAllListeners(type?: string | number): this; | ||
listeners(type: string | number): Listener[]; | ||
listenerCount(type: string | number): number; | ||
rawListeners(type: string | number): Listener[]; | ||
} | ||
type PrimitiveValue = null | boolean | string | number; | ||
@@ -351,2 +322,31 @@ declare enum ProviderEvents { | ||
// Type definitions for events 3.0 | ||
// Project: https://github.com/Gozala/events | ||
// Definitions by: Yasunori Ohoka <https://github.com/yasupeke> | ||
// Shenwei Wang <https://github.com/weareoutman> | ||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped | ||
type Listener = (...args: any[]) => void; | ||
declare class EventEmitter { | ||
static listenerCount(emitter: EventEmitter, type: string | number): number; | ||
static defaultMaxListeners: number; | ||
eventNames(): Array<string | number>; | ||
setMaxListeners(n: number): this; | ||
getMaxListeners(): number; | ||
emit(type: string | number, ...args: any[]): boolean; | ||
addListener(type: string | number, listener: Listener): this; | ||
on(type: string | number, listener: Listener): this; | ||
once(type: string | number, listener: Listener): this; | ||
prependListener(type: string | number, listener: Listener): this; | ||
prependOnceListener(type: string | number, listener: Listener): this; | ||
removeListener(type: string | number, listener: Listener): this; | ||
off(type: string | number, listener: Listener): this; | ||
removeAllListeners(type?: string | number): this; | ||
listeners(type: string | number): Listener[]; | ||
listenerCount(type: string | number): number; | ||
rawListeners(type: string | number): Listener[]; | ||
} | ||
/** | ||
@@ -353,0 +353,0 @@ * Interface that providers must implement to resolve flag values for their particular |
{ | ||
"name": "@openfeature/web-sdk", | ||
"version": "0.3.0-experimental", | ||
"version": "0.3.1-experimental", | ||
"description": "OpenFeature SDK for Web", | ||
@@ -50,3 +50,7 @@ "main": "./dist/cjs/index.js", | ||
"@openfeature/shared": "0.0.2" | ||
}, | ||
"typedoc": { | ||
"displayName": "OpenFeature Web SDK", | ||
"entryPoint": "./src/index.ts" | ||
} | ||
} |
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
262893
2634