All Downloads are FREE. Search and download functionalities are using the official Maven repository.

main.kotlin.com.intuit.playerui.j2v8.extensions.Unwrap.kt Maven / Gradle / Ivy

There is a newer version: 0.10.0-next.5
Show newest version
package com.intuit.playerui.j2v8.extensions

import com.eclipsesource.v8.V8Object
import com.intuit.playerui.core.bridge.Node
import com.intuit.playerui.core.bridge.NodeWrapper
import com.intuit.playerui.j2v8.bridge.V8Node

/** Extension to recursively unwrap [NodeWrapper]s until we hit a [Node] implementation */
internal fun Node.unwrap(): V8Object? = when (this) {
    is V8Node -> v8Object
    is NodeWrapper -> node.unwrap()
    else -> null
}

internal fun NodeWrapper.unwrap(): V8Object? = node.unwrap()




© 2015 - 2024 Weber Informatics LLC | Privacy Policy