Skip to content

Bloblang: variables and mappings #1061

Open
@illotum

Description

@illotum

Is there a way to pass variables to mappings?

Trying something like this says the variable is not defined:

let value = some.value
let hashedValue = $value.hash("hmac_sha1", $secret)
map mask {
    root = this
    messyField = messyField.replace($value, $hashedValue)
}
objects = objects.map_each(o -> o.apply("mask"))

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions