fixed YMap

This commit is contained in:
Kevin Jahns
2019-03-29 13:49:13 +01:00
parent ff981a8697
commit c188f813a4
13 changed files with 32 additions and 184 deletions

View File

@@ -3,24 +3,23 @@
*/
import { Y } from '../utils/Y.js' // eslint-disable-line
import { Type } from '../types/AbstractType.js/index.js.js.js.js' // eslint-disable-line
import { AbstractType } from '../types/AbstractType.js' // eslint-disable-line
/**
* Check if `parent` is a parent of `child`.
*
* @param {Type | Y} parent
* @param {Type | Y} child
* @param {AbstractType} parent
* @param {AbstractType} child
* @return {Boolean} Whether `parent` is a parent of `child`.
*
* @public
*/
export const isParentOf = (parent, child) => {
child = child._parent
while (child !== null) {
while (child._item !== null) {
if (child === parent) {
return true
}
child = child._parent
child = child._item.parent
}
return false
}