( name: string, patch?: object, options?: object )
| 9 | } = {}; |
| 10 | |
| 11 | export function getSchemaTpl( |
| 12 | name: string, |
| 13 | patch?: object, |
| 14 | options?: object |
| 15 | ): any { |
| 16 | const tpl = tpls[name] || {}; |
| 17 | let schema = null; |
| 18 | |
| 19 | if (typeof tpl === 'function') { |
| 20 | schema = tpl(patch, options); |
| 21 | } else { |
| 22 | schema = patch |
| 23 | ? { |
| 24 | ...tpl, |
| 25 | ...patch |
| 26 | } |
| 27 | : tpl; |
| 28 | } |
| 29 | |
| 30 | return schema; |
| 31 | } |
| 32 | |
| 33 | export function setSchemaTpl(name: string, value: any) { |
| 34 | tpls[name] = value; |
no outgoing calls
no test coverage detected