@onehat/data 1.19.14 → 1.19.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onehat/data",
3
- "version": "1.19.14",
3
+ "version": "1.19.15",
4
4
  "description": "JS data modeling package with adapters for many storage mediums.",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
@@ -236,9 +236,15 @@ export default class Schema extends EventEmitter {
236
236
  if (this.isDestroyed) {
237
237
  throw Error('this.getPropertyDefinition is no longer valid. Schema has been destroyed.');
238
238
  }
239
- return _.find(this.model.properties, (propertyDefinition) => {
239
+ const found = _.clone(_.find(this.model.properties, (propertyDefinition) => {
240
240
  return propertyDefinition.name === propertyName;
241
- });
241
+ }));
242
+
243
+ if (this.model?.validator?.fields && this.model.validator.fields[propertyName]) {
244
+ found.validator = this.model?.validator?.fields[propertyName];
245
+ }
246
+
247
+ return found;
242
248
  }
243
249
 
244
250
  getTitles = () => {