(
modelJson: io.ModelJSON, modelWeightsId: number|number[])
| 167 | * @doc {heading: 'Models', subheading: 'IOHandlers'} |
| 168 | */ |
| 169 | export function bundleResourceIO( |
| 170 | modelJson: io.ModelJSON, modelWeightsId: number|number[]): io.IOHandler { |
| 171 | if (typeof modelJson !== 'object') { |
| 172 | throw new Error( |
| 173 | 'modelJson must be a JavaScript object (and not a string).\n' + |
| 174 | 'Have you wrapped your asset path in a require() statement?'); |
| 175 | } |
| 176 | |
| 177 | if (typeof modelWeightsId === 'string') { |
| 178 | throw new Error( |
| 179 | 'modelWeightsID must be a number or number array.\n' + |
| 180 | 'Have you wrapped your asset paths in a require() statements?'); |
| 181 | } |
| 182 | const modelWeightsIdArr = |
| 183 | Array.isArray(modelWeightsId) ? modelWeightsId : [modelWeightsId]; |
| 184 | return new BundleResourceHandler(modelJson, modelWeightsIdArr); |
| 185 | } |
no outgoing calls
no test coverage detected
searching dependent graphs…