UNPKG

@loopback/docs

Version:
37 lines (23 loc) 1.17 kB
--- lang: en title: 'API docs: repository.constraindataobjects' keywords: LoopBack 4.0, LoopBack 4 sidebar: lb4_sidebar permalink: /doc/en/lb4/apidocs.repository.constraindataobjects.html --- <!-- Do not edit this file. It is automatically generated by API Documenter. --> [Home](./index.md) &gt; [@loopback/repository](./repository.md) &gt; [constrainDataObjects](./repository.constraindataobjects.md) ## constrainDataObjects() function A utility function which takes an array of model instance data and enforces constraint(s) on it <b>Signature:</b> ```typescript export declare function constrainDataObjects<T extends Entity>(originalData: DataObject<T>[], constraint: DataObject<T>): DataObject<T>[]; ``` ## Parameters | Parameter | Type | Description | | --- | --- | --- | | originalData | <code>DataObject&lt;T&gt;[]</code> | the array of model data to apply the constrain(s) to | | constraint | <code>DataObject&lt;T&gt;</code> | the constraint which is to be applied on the data objects | <b>Returns:</b> `DataObject<T>[]` an array of the modified data with the constraint, otherwise the original instance data array