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

jsMain.com.bkahlert.kommons.debug.Object.kt Maven / Gradle / Ivy

There is a newer version: 2.8.0
Show newest version
package com.bkahlert.kommons.debug

/**
 * The built-in `Object` object.
 *
 * @see Object
 */
public external object Object {
    /**
     * Returns the own enumerable property names of the specified [obj] as an array,
     * iterated in the same order that a usual loop would.
     */
    public fun keys(obj: Any): Array

    /**
     * Returns the own enumerable string-keyed property [key, value] pairs of the specified [obj] as an array.
     */
    public fun entries(obj: Any): Array>

    /**
     * Returns all properties, including non-enumerable properties except for those which use Symbol, found directly in
     * the specified [obj] as an array.
     */
    public fun getOwnPropertyNames(obj: Any): Array
}

/**
 * Returns the own enumerable property names of this object as an array,
 * iterated in the same order that a usual loop would.
 */
public val Any.keys: Array get() = Object.keys(this)

/**
 * Returns the own enumerable string-keyed property [key, value] pairs of this object as an array.
 */
public val Any.entries: Array> get() = Object.entries(this)




© 2015 - 2024 Weber Informatics LLC | Privacy Policy