(
paths: any,
idProps: any,
spec: any,
anyVals: any,
depType: any
)
| 114 | const setCallbackJobOutdated = createAction('CALLBACK_JOB_OUTDATED'); |
| 115 | |
| 116 | function unwrapIfNotMulti( |
| 117 | paths: any, |
| 118 | idProps: any, |
| 119 | spec: any, |
| 120 | anyVals: any, |
| 121 | depType: any |
| 122 | ) { |
| 123 | let msg = ''; |
| 124 | |
| 125 | if (isMultiValued(spec)) { |
| 126 | return [idProps, msg]; |
| 127 | } |
| 128 | |
| 129 | if (idProps.length !== 1) { |
| 130 | if (!idProps.length) { |
| 131 | if (spec.allow_optional) { |
| 132 | idProps = [{...spec, value: null}]; |
| 133 | msg = ''; |
| 134 | } else { |
| 135 | const isStr = typeof spec.id === 'string'; |
| 136 | msg = |
| 137 | 'A nonexistent object was used in an `' + |
| 138 | depType + |
| 139 | '` of a Dash callback. The id of this object is ' + |
| 140 | (isStr |
| 141 | ? '`' + spec.id + '`' |
| 142 | : JSON.stringify(spec.id) + |
| 143 | (anyVals ? ' with MATCH values ' + anyVals : '')) + |
| 144 | ' and the property is `' + |
| 145 | spec.property + |
| 146 | (isStr |
| 147 | ? '`. The string ids in the current layout are: [' + |
| 148 | keys(paths.strs).join(', ') + |
| 149 | ']' |
| 150 | : '`. The wildcard ids currently available are logged above.'); |
| 151 | } |
| 152 | } else { |
| 153 | msg = |
| 154 | 'Multiple objects were found for an `' + |
| 155 | depType + |
| 156 | '` of a callback that only takes one value. The id spec is ' + |
| 157 | JSON.stringify(spec.id) + |
| 158 | (anyVals ? ' with MATCH values ' + anyVals : '') + |
| 159 | ' and the property is `' + |
| 160 | spec.property + |
| 161 | '`. The objects we found are: ' + |
| 162 | JSON.stringify(map(pick(['id', 'property']), idProps)); |
| 163 | } |
| 164 | } |
| 165 | return [idProps[0], msg]; |
| 166 | } |
| 167 | |
| 168 | function fillVals( |
| 169 | paths: any, |
no test coverage detected
searching dependent graphs…