(model?: unknown, options?: AddOptions)
| 12 | add(model: Array<Record<string, any>> | TModel, options?: AddOptions): TModel; |
| 13 | add(models: Array<Array<Record<string, any>> | TModel>, options?: AddOptions): TModel[]; |
| 14 | add(model?: unknown, options?: AddOptions): any { |
| 15 | //Note: the undefined case needed because backbonejs not handle the reset() correctly |
| 16 | var models = isArray(model) ? model : !isUndefined(model) ? [model] : undefined; |
| 17 | |
| 18 | models = models?.map((m) => (m instanceof this.newModel ? m : new this.newModel(this.module, m))) ?? [undefined]; |
| 19 | |
| 20 | return super.add(isArray(model) ? models : models[0], options); |
| 21 | } |
| 22 | |
| 23 | constructor( |
| 24 | module: ModuleExt<TModel>, |
nothing calls this directly
no test coverage detected