@tsed/core 6.75.3 → 6.75.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.js +2 -2
- package/lib/index.js.map +1 -1
- package/lib/index.modern.js +2 -2
- package/lib/index.modern.js.map +1 -1
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -145,7 +145,7 @@ function classOf(target) {
|
|
|
145
145
|
}
|
|
146
146
|
|
|
147
147
|
function ancestorOf(target) {
|
|
148
|
-
return Object.getPrototypeOf(target);
|
|
148
|
+
return target && Object.getPrototypeOf(target);
|
|
149
149
|
}
|
|
150
150
|
function getInheritedClass(target) {
|
|
151
151
|
return ancestorOf(target);
|
|
@@ -191,7 +191,7 @@ function ancestorsOf(target) {
|
|
|
191
191
|
const classes = [];
|
|
192
192
|
let currentTarget = classOf(target);
|
|
193
193
|
|
|
194
|
-
while (nameOf(currentTarget) !== "") {
|
|
194
|
+
while (currentTarget && nameOf(currentTarget) !== "") {
|
|
195
195
|
classes.unshift(currentTarget);
|
|
196
196
|
currentTarget = getInheritedClass(currentTarget);
|
|
197
197
|
}
|