(sentence: ISentence, argKey: string)
| 2 | import { toSafeBoolean, toSafeNumber, toSafeString } from './toSafeType'; |
| 3 | |
| 4 | export function getSentenceArgByKey(sentence: ISentence, argKey: string): null | string | boolean | number { |
| 5 | const args = sentence.args; |
| 6 | const result = args.find((arg) => arg.key === argKey); |
| 7 | if (result) { |
| 8 | return result.value; |
| 9 | } else return null; |
| 10 | } |
| 11 | |
| 12 | export function getBooleanArgByKey(sentence: ISentence, argKey: string): boolean | null { |
| 13 | const argValue = getSentenceArgByKey(sentence, argKey); |
no outgoing calls
no test coverage detected