enum.map
0.000000

Updates each enumerable value.

Arguments
procrequired
The proc to call with each enumerable value.
Return Value
An enumerator that updates each enumerable value.
something went wrong :(
Upcasing an array of strings
Setup
authorization=PROCAUTH
require "proc"

client = Proc.connect("PROCAUTH")
const Proc = require("@proc.dev/client");
const client = Proc.connect("PROCAUTH");
client.enum.map.call(["foo", "bar", "baz"]) {
  client.type.string.upcase
}
client.enum.map.call(["foo", "bar", "baz"], () {
  return client.type.string.upcase;
});
curl "https://proc.run/enum/map" --silent \
--header "authorization: bearer $authorization" \
--header "content-type: application/vnd.proc+json" \
--header "accept: text/plain" \
--data '[[">>", ["%%", ["foo", "bar", "baz"]]], ["$$", "proc", ["{}", ["()", "type.string.upcase"]]]]'
 

["FOO", "BAR", "BAZ"]

enum.* procs can iterate over cursors in addition to arrays—learn more in the docs.


Stuck? Want to chat about an idea? Join the community on Discord.