mirror of
https://github.com/hanzoai/python-sdk.git
synced 2026-10-27 04:20:09 +00:00
- Remove TODO comment in unified_backend.py (stub pattern detected) - Replace bare except clauses with specific exception types: - OSError, FileNotFoundError for command availability checks - OSError, ImportError, ValueError, KeyError for TOML parsing - OSError, json.JSONDecodeError, KeyError for JSON config reading - OSError, PermissionError for file stat checks - Fix blind exception assertion (Exception -> TypeError) in test - Apply ruff format and import sorting fixes All 14 anti-stub and CI tests now pass.
46 lines
1.5 KiB
JavaScript
46 lines
1.5 KiB
JavaScript
"use strict";
|
|
/**
|
|
* Copyright (c) 2019, Microsoft Corporation (MIT License).
|
|
*/
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
var EventEmitter2 = /** @class */ (function () {
|
|
function EventEmitter2() {
|
|
this._listeners = [];
|
|
}
|
|
Object.defineProperty(EventEmitter2.prototype, "event", {
|
|
get: function () {
|
|
var _this = this;
|
|
if (!this._event) {
|
|
this._event = function (listener) {
|
|
_this._listeners.push(listener);
|
|
var disposable = {
|
|
dispose: function () {
|
|
for (var i = 0; i < _this._listeners.length; i++) {
|
|
if (_this._listeners[i] === listener) {
|
|
_this._listeners.splice(i, 1);
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
};
|
|
return disposable;
|
|
};
|
|
}
|
|
return this._event;
|
|
},
|
|
enumerable: true,
|
|
configurable: true
|
|
});
|
|
EventEmitter2.prototype.fire = function (data) {
|
|
var queue = [];
|
|
for (var i = 0; i < this._listeners.length; i++) {
|
|
queue.push(this._listeners[i]);
|
|
}
|
|
for (var i = 0; i < queue.length; i++) {
|
|
queue[i].call(undefined, data);
|
|
}
|
|
};
|
|
return EventEmitter2;
|
|
}());
|
|
exports.EventEmitter2 = EventEmitter2;
|
|
//# sourceMappingURL=eventEmitter2.js.map
|