-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexit-def.struct.js
12 lines (12 loc) · 2.48 KB
/
exit-def.struct.js
1
2
3
4
5
6
7
8
9
10
11
12
module.exports = {
friendlyName: 'Unrecognized flavors',
description: 'Could not recognize one or more of the provided `flavorStrings`.', // >> A short explanation of what it means if the machine's `fn` calls this exit at runtime. Written as a post-mortem analysis (past tense).
extendedDescription: 'Some **markdown**.', // >> Like any other `extendedDescription`, supports markdown.
moreInfoUrl: 'http://gummyworms.com/flavors',
outputFriendlyName: 'Unrecognized flavors', // >> e.g. if var name would normally be `unrecognizedFlavors`
outputDescription: 'A list of invalid gummy worm flavors.', // >> noun phrase
outputExample: '*', // >> an example of the output, if relevant. Technically, this is an RTTC exemplar schema. Omit this property (as well as `like`, `itemOf`, and `getExample`) to indicate no output.
like: 'foo', // >> *ADVANCED, USE WITH CARE*: The code name of an input to base this data type guarantee off of. The referenced input must exist. The effective data type guarantee will be exactly the same as the input's exemplar (`example`). That is, if the referenced input has `example: [ { age: 49 } ]`, then the effective RTTC exemplar schema will be `[ { age: 49 } ]`. If runtime data is received for the referenced input, it will be exemplified (using `rttc.coerceExemplar()`) and used instead. (This is useful for building custom iterator machines, or machines that parse data with a dynamic schema.)
itemOf: 'bar', // >> *ADVANCED, USE WITH CARE*: The code name of an input to base this data type guarantee off of. The referenced input must exist, and its `example` MUST be an array. The effective data type guarantee will be based off of the *pattern* of the input's exemplar (`example`). That is, if the referenced input has `example: [ { name: 'foo' } ]`, then the effective RTTC exemplar schema for this exit will be `{name: 'foo'}`. If runtime data is received for the referenced input, it will be exemplified (using `rttc.coerceExemplar()`) and used instead. (This is useful for building custom iterator machines, or machines that parse data with a dynamic schema.)
getExample: '->', // >> ***VERY ADVANCED, USE WITH CARE!***: A function which receives runtime input values as its first argument and is expected to return an RTTC exemplar schema describing the data type under these particular conditions. May not return `undefined` or throw. Returning `null` to indicate that the exit is void (has no output) is experimental in the current version of the specification.
};