objects

package
v2.0.0-alpha.63 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 27, 2026 License: Apache-2.0 Imports: 5 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Entries

func Entries(ctx context.Context, arg runtime.Value) (runtime.Value, error)

Entries returns associated key/value pairs from one map traversal. Keys must be strings; only values follow their clone or copy contracts. Ordering is unspecified. @param value {Map} Map whose entries are returned. @return {Any[][]} Independent two-item lists containing a String key and its cloned or copied value.

func FromEntries

func FromEntries(ctx context.Context, arg runtime.Value) (runtime.Value, error)

FromEntries consumes an iterable of two-item, indexed, measurable pairs once. Keys must be strings. Duplicate keys use the last value encountered. @param entries {Iterable} Entries containing a String key and any value. @return {Map} Independent object containing cloned or copied entry values.

func HasKey

func HasKey(ctx context.Context, arg1, arg2 runtime.Value) (runtime.Value, error)

HasKey checks key existence, including keys whose value is none. @param object {Map} Object or map to inspect. @param key {String} The key name string. @return {Boolean} True if the key exists else false.

func KeepKeys

func KeepKeys(ctx context.Context, args ...runtime.Value) (runtime.Value, error)

KeepKeys clones the source and retains only the requested keys. Missing and repeated keys are ignored. @param value {Map} Source map. @param keys {String|String[], repeated} Variadic keys, or one list of keys; an empty list keeps nothing. @return {Map} Independent map containing only selected keys.

func KeepKeysMutable

func KeepKeysMutable(ctx context.Context, args ...runtime.Value) (runtime.Value, error)

KeepKeysMutable removes unselected keys from the original target and returns it. Retained values are untouched. Missing and repeated keys are ignored; errors may leave earlier removals applied. @param target {Map} Map to mutate. @param keys {String|String[], repeated} Variadic keys, or one list of keys; an empty list keeps nothing. @return {Map} The original target containing only selected keys.

func Keys

func Keys(ctx context.Context, arg runtime.Value) (runtime.Value, error)

Keys returns an independent list of map keys in unspecified order. Use sorted(object::keys(value)) when ordering is required. @param value {Map} Map whose keys are returned. @return {String[]} Independent list of keys in unspecified order.

func Merge

func Merge(ctx context.Context, args ...runtime.Value) (runtime.Value, error)

Merge copies maps into an independent destination; later values replace earlier values. Successful factory construction transfers destination ownership to this call. Population failure closes a closable destination and joins cleanup errors; success transfers the result to the caller. Source maps remain borrowed. @param values {Map|Map[], repeated} Variadic maps, or one list of maps. @return {Map} Shallow merge with cloned or copied values.

func MergeDeep

func MergeDeep(ctx context.Context, args ...runtime.Value) (runtime.Value, error)

MergeDeep copies maps into an independent destination, merging nested maps recursively. Arrays, scalars, and none are replaced by later values. After successful factory construction, population failure closes a closable destination and joins cleanup errors. Successful results transfer to the caller; source maps remain borrowed. Failed construction is the factory's responsibility. @param values {Map|Map[], repeated} Variadic maps, or one list of maps. @return {Map} Deep merge with cloned or copied values.

func MergeDeepMutable

func MergeDeepMutable(ctx context.Context, args ...runtime.Value) (runtime.Value, error)

MergeDeepMutable deep merges sources into the original target, returning it. Conflicting nested maps are cloned before modification so external nested aliases remain unchanged. Arrays, scalars, and none are replaced. Errors may leave earlier updates applied. A target without sources is returned unchanged. @param target {Map} Map to mutate; its top-level aliases observe changes. @param sources {Map|Map[], repeated} Zero or more maps, or one list of maps. @return {Map} The original target with independently merged nested branches.

func MergeMutable

func MergeMutable(ctx context.Context, args ...runtime.Value) (runtime.Value, error)

MergeMutable merges sources into the original target and returns that same map. Incoming values are cloned or copied; later sources win. Errors may leave earlier updates applied. A target without sources is returned unchanged. @param target {Map} Map to mutate. @param sources {Map|Map[], repeated} Zero or more maps, or one list of maps. @return {Map} The original mutated target.

func OmitKeys

func OmitKeys(ctx context.Context, args ...runtime.Value) (runtime.Value, error)

OmitKeys clones the source and removes the requested keys. Missing and repeated keys are ignored. @param value {Map} Source map. @param keys {String|String[], repeated} Variadic keys, or one list of keys; an empty list omits nothing. @return {Map} Independent map without selected keys.

func OmitKeysMutable

func OmitKeysMutable(ctx context.Context, args ...runtime.Value) (runtime.Value, error)

OmitKeysMutable removes selected keys from the original target and returns it. Retained values are untouched. Missing and repeated keys are ignored; errors may leave earlier removals applied. @param target {Map} Map to mutate. @param keys {String|String[], repeated} Variadic keys, or one list of keys; an empty list omits nothing. @return {Map} The original target without selected keys.

func RegisterLib

func RegisterLib(ns runtime.Namespace)

RegisterLib registers object functions, explicit object::mut operations, and deprecated globals. @namespace object

func Values

func Values(ctx context.Context, arg runtime.Value) (runtime.Value, error)

Values returns cloned or copied map values in unspecified order. @param value {Map} Map whose values are returned. @return {Any[]} Independent list of values, following each value's clone or copy contract.

func Zip

func Zip(ctx context.Context, arg1, arg2 runtime.Value) (runtime.Value, error)

Zip constructs an object from parallel key and value lists of equal length. Keys must be strings. Duplicate keys use the last value in the input. @param keys {String[]} List of object keys. @param values {Any[]} Parallel list of values. @return {Map} Independent object containing cloned or copied values.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL