atma-utils
Advanced tools
Comparing version 0.2.49 to 0.2.50
@@ -200,2 +200,7 @@ // Generated by dts-bundle v0.7.3 | ||
export class class_EventEmitter<TEvents extends Record<keyof TEvents, (...args: any) => any> = any> { | ||
_listeners: { | ||
[event: string]: (Function & { | ||
_once?: boolean; | ||
})[]; | ||
}; | ||
on<TKey extends keyof TEvents>(event: TKey, fn: TEvents[TKey]): this; | ||
@@ -202,0 +207,0 @@ once<TKey extends keyof TEvents>(event: TKey, fn: TEvents[TKey]): this; |
@@ -1400,2 +1400,3 @@ var _Array_slice, | ||
var PROTO = "__proto__"; | ||
var _getProtoOf = Object.getPrototypeOf; | ||
var _toString = Object.prototype.toString; | ||
@@ -1435,13 +1436,20 @@ var _isArguments = function (args) { | ||
return; | ||
if (typeof proto === "function") | ||
if (typeof proto === "function") { | ||
proto = proto.prototype; | ||
if (typeof source === "function") | ||
} | ||
if (typeof source === "function") { | ||
source = source.prototype; | ||
var key, val; | ||
for (key in source) { | ||
if (key === "constructor") | ||
} | ||
if (_getProtoOf != null) { | ||
/** ES6 Classes: methods are not enumarable, which is needed in `inherit_` method: so convert prototype to hash */ | ||
source = fillProtoHash(source, obj_create(null)); | ||
} | ||
for (var key in source) { | ||
if (key === "constructor") { | ||
continue; | ||
val = source[key]; | ||
if (val != null) | ||
} | ||
var val = source[key]; | ||
if (val != null) { | ||
proto[key] = val; | ||
} | ||
} | ||
@@ -1466,13 +1474,14 @@ } | ||
function inherit(_class, _base, _extends, original) { | ||
var prototype = original, proto = original; | ||
var prototype = original; | ||
var protoCursor = original; | ||
prototype.constructor = _class.prototype.constructor; | ||
if (_extends != null) { | ||
proto[PROTO] = {}; | ||
protoCursor[PROTO] = {}; | ||
arr_each(_extends, function (x) { | ||
proto_extend(proto[PROTO], x); | ||
proto_extend(protoCursor[PROTO], x); | ||
}); | ||
proto = proto[PROTO]; | ||
protoCursor = protoCursor[PROTO]; | ||
} | ||
if (_base != null) | ||
proto[PROTO] = _base.prototype; | ||
protoCursor[PROTO] = _base.prototype; | ||
_class.prototype = prototype; | ||
@@ -1519,2 +1528,17 @@ } | ||
} | ||
function fillProtoHash(proto, target) { | ||
var keys = Object.getOwnPropertyNames(proto); | ||
for (var i = 0; i < keys.length; i++) { | ||
var key = keys[i]; | ||
if (target[key] != null) { | ||
continue; | ||
} | ||
target[key] = proto[key]; | ||
} | ||
var next = Object.getPrototypeOf(proto); | ||
if (next == null || next === Object.prototype) { | ||
return target; | ||
} | ||
return fillProtoHash(next, target); | ||
} | ||
@@ -1521,0 +1545,0 @@ }()); |
@@ -1305,2 +1305,3 @@ (function(factory){ | ||
var PROTO = "__proto__"; | ||
var _getProtoOf = Object.getPrototypeOf; | ||
var _toString = Object.prototype.toString; | ||
@@ -1340,13 +1341,20 @@ var _isArguments = function (args) { | ||
return; | ||
if (typeof proto === "function") | ||
if (typeof proto === "function") { | ||
proto = proto.prototype; | ||
if (typeof source === "function") | ||
} | ||
if (typeof source === "function") { | ||
source = source.prototype; | ||
var key, val; | ||
for (key in source) { | ||
if (key === "constructor") | ||
} | ||
if (_getProtoOf != null) { | ||
/** ES6 Classes: methods are not enumarable, which is needed in `inherit_` method: so convert prototype to hash */ | ||
source = fillProtoHash(source, obj_create(null)); | ||
} | ||
for (var key in source) { | ||
if (key === "constructor") { | ||
continue; | ||
val = source[key]; | ||
if (val != null) | ||
} | ||
var val = source[key]; | ||
if (val != null) { | ||
proto[key] = val; | ||
} | ||
} | ||
@@ -1371,13 +1379,14 @@ } | ||
function inherit(_class, _base, _extends, original) { | ||
var prototype = original, proto = original; | ||
var prototype = original; | ||
var protoCursor = original; | ||
prototype.constructor = _class.prototype.constructor; | ||
if (_extends != null) { | ||
proto[PROTO] = {}; | ||
protoCursor[PROTO] = {}; | ||
arr_each(_extends, function (x) { | ||
proto_extend(proto[PROTO], x); | ||
proto_extend(protoCursor[PROTO], x); | ||
}); | ||
proto = proto[PROTO]; | ||
protoCursor = protoCursor[PROTO]; | ||
} | ||
if (_base != null) | ||
proto[PROTO] = _base.prototype; | ||
protoCursor[PROTO] = _base.prototype; | ||
_class.prototype = prototype; | ||
@@ -1424,2 +1433,17 @@ } | ||
} | ||
function fillProtoHash(proto, target) { | ||
var keys = Object.getOwnPropertyNames(proto); | ||
for (var i = 0; i < keys.length; i++) { | ||
var key = keys[i]; | ||
if (target[key] != null) { | ||
continue; | ||
} | ||
target[key] = proto[key]; | ||
} | ||
var next = Object.getPrototypeOf(proto); | ||
if (next == null || next === Object.prototype) { | ||
return target; | ||
} | ||
return fillProtoHash(next, target); | ||
} | ||
@@ -1426,0 +1450,0 @@ }()); |
{ | ||
"name": "atma-utils", | ||
"description": "Helpers", | ||
"version": "0.2.49", | ||
"version": "0.2.50", | ||
"author": "Alexander Kit <alex.kit@atmajs.com>", | ||
@@ -6,0 +6,0 @@ "repository": { |
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
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
0
202613
18
6276