UNPKG

@joshfarrant/shortcuts-js

Version:
32 lines 908 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const utils_1 = require("../utils"); /** * @action Dictionary * @section Actions > Scripting > Dictionaries * @icon Scripting * * Passes the specified list of key-value pairs to the next action as a dictionary * * ```js * // Create a dictionary * dictionary({ * value: { * hello: 'world!', * myNum: 7, * myArray: ['a', 'b', 'c', 'etc'], * myObj: { * anotherString: 'How deep does this thing go?', * } * }, * }); * ``` */ const dictionary = ({ value = {}, }) => ({ WFWorkflowActionIdentifier: 'is.workflow.actions.dictionary', WFWorkflowActionParameters: Object.assign({}, (Object.keys(value).length === 0 ? {} : { WFItems: utils_1.buildSerialization(value), })), }); exports.default = utils_1.withActionOutput(dictionary); //# sourceMappingURL=dictionary.js.map