@travetto/schema 5.0.13 → 5.0.14

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/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2023 ArcSine Technologies
3
+ Copyright (c) 2020 ArcSine Technologies
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@travetto/schema",
3
- "version": "5.0.13",
3
+ "version": "5.0.14",
4
4
  "description": "Data type registry for runtime validation, reflection and binding.",
5
5
  "keywords": [
6
6
  "schema",
@@ -27,10 +27,10 @@
27
27
  "directory": "module/schema"
28
28
  },
29
29
  "dependencies": {
30
- "@travetto/registry": "^5.0.13"
30
+ "@travetto/registry": "^5.0.14"
31
31
  },
32
32
  "peerDependencies": {
33
- "@travetto/transformer": "^5.0.10"
33
+ "@travetto/transformer": "^5.0.11"
34
34
  },
35
35
  "peerDependenciesMeta": {
36
36
  "@travetto/transformer": {
package/src/bind-util.ts CHANGED
@@ -220,7 +220,7 @@ export class BindUtil {
220
220
  // Ensure its an array
221
221
  if (!Array.isArray(v) && field.array) {
222
222
  if (typeof v === 'string' && v.includes(',')) {
223
- v = v.split(/\s*,\s*/);
223
+ v = v.split(/,/).map(x => x.trim());
224
224
  } else {
225
225
  v = [v];
226
226
  }
package/src/data.ts CHANGED
@@ -91,6 +91,9 @@ export class DataUtil {
91
91
  const retObj: Record<string, unknown> = castTo(ret);
92
92
 
93
93
  for (const key of Object.keys(bObj)) {
94
+ if (key === '__proto__' || key === 'constructor' || key === 'prototype') {
95
+ continue;
96
+ }
94
97
  retObj[key] = this.#deepAssignRaw(retObj[key], bObj[key], mode);
95
98
  }
96
99
  }
@@ -14,7 +14,7 @@ export const CommonRegExp = {
14
14
  email: /^[a-zA-Z0-9.!#$%&’*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/,
15
15
  telephone: /^(\+?\d{1,3}(\s*-?\s*|\s+))?((\(\d{3}\))|\d{3})(\s*|-|[.])(\d{3})(\s*|-|[.])(\d{4})(\s+(x|ext[.]?)\s*\d+)?$/,
16
16
  url: /^(https?|ftp):\/\/[^\s/$.?#].[^\s]*$/,
17
- simpleName: /^([a-zA-Z\u0080-\u024F]*(?:. |-| |'))*[a-zA-Z\u0080-\u024F]+$/,
17
+ simpleName: /^([a-zA-Z\u0080-\u024F]{0,100}(?:. |-| |')){0,10}[a-zA-Z\u0080-\u024F]+$/,
18
18
  postalCode: /^\d{5}(?:[-\s]\d{4})?$/
19
19
  };
20
20