@webiny/validation 0.0.0-unstable.6e5425ee89 → 0.0.0-unstable.79032b23a5

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": "@webiny/validation",
3
- "version": "0.0.0-unstable.6e5425ee89",
3
+ "version": "0.0.0-unstable.79032b23a5",
4
4
  "main": "index.js",
5
5
  "repository": {
6
6
  "type": "git",
@@ -14,7 +14,7 @@
14
14
  ],
15
15
  "license": "MIT",
16
16
  "dependencies": {
17
- "@babel/runtime": "7.20.1",
17
+ "@babel/runtime": "7.20.13",
18
18
  "isnumeric": "0.3.3",
19
19
  "lodash": "4.17.21"
20
20
  },
@@ -24,8 +24,8 @@
24
24
  "@babel/preset-env": "^7.19.4",
25
25
  "@babel/preset-typescript": "^7.18.6",
26
26
  "@types/lodash": "^4.14.190",
27
- "@webiny/cli": "^0.0.0-unstable.6e5425ee89",
28
- "@webiny/project-utils": "^0.0.0-unstable.6e5425ee89",
27
+ "@webiny/cli": "^0.0.0-unstable.79032b23a5",
28
+ "@webiny/project-utils": "^0.0.0-unstable.79032b23a5",
29
29
  "babel-plugin-lodash": "^3.3.4",
30
30
  "jest": "^28.1.0",
31
31
  "merge": "^1.2.1",
@@ -41,5 +41,5 @@
41
41
  "build": "yarn webiny run build",
42
42
  "watch": "yarn webiny run watch"
43
43
  },
44
- "gitHead": "1e49c5d4b72b2f00661572464188f53b42ed7745"
44
+ "gitHead": "79032b23a5e5b580fb21be88e8cc66d0dce7afdc"
45
45
  }
@@ -11,9 +11,9 @@ var _default = value => {
11
11
  return;
12
12
  }
13
13
  value = value + "";
14
- if (value.match(/^[a-z]+(\-[a-z]+)*$/) && value.length <= 100) {
14
+ if (value.match(/^[a-z0-9]+(-[a-z0-9]+)*$/) && value.length <= 100) {
15
15
  return;
16
16
  }
17
- throw new _validationError.default("Slug must consist of only 'a-z' and '-' and be max 100 characters long (for example: 'some-entry-slug')");
17
+ throw new _validationError.default("Slug must consist of only 'a-z', '0-9' and '-' and be max 100 characters long (for example: 'some-slug' or 'some-slug-2')");
18
18
  };
19
19
  exports.default = _default;
@@ -1 +1 @@
1
- {"version":3,"names":["value","match","length","ValidationError"],"sources":["slug.ts"],"sourcesContent":["import ValidationError from \"~/validationError\";\n\nexport default (value: any) => {\n if (!value) {\n return;\n }\n value = value + \"\";\n\n if (value.match(/^[a-z]+(\\-[a-z]+)*$/) && value.length <= 100) {\n return;\n }\n\n throw new ValidationError(\n \"Slug must consist of only 'a-z' and '-' and be max 100 characters long (for example: 'some-entry-slug')\"\n );\n};\n"],"mappings":";;;;;;;AAAA;AAAgD,eAEhCA,KAAU,IAAK;EAC3B,IAAI,CAACA,KAAK,EAAE;IACR;EACJ;EACAA,KAAK,GAAGA,KAAK,GAAG,EAAE;EAElB,IAAIA,KAAK,CAACC,KAAK,CAAC,qBAAqB,CAAC,IAAID,KAAK,CAACE,MAAM,IAAI,GAAG,EAAE;IAC3D;EACJ;EAEA,MAAM,IAAIC,wBAAe,CACrB,yGAAyG,CAC5G;AACL,CAAC;AAAA"}
1
+ {"version":3,"names":["value","match","length","ValidationError"],"sources":["slug.ts"],"sourcesContent":["import ValidationError from \"~/validationError\";\n\nexport default (value: any) => {\n if (!value) {\n return;\n }\n value = value + \"\";\n\n if (value.match(/^[a-z0-9]+(-[a-z0-9]+)*$/) && value.length <= 100) {\n return;\n }\n\n throw new ValidationError(\n \"Slug must consist of only 'a-z', '0-9' and '-' and be max 100 characters long (for example: 'some-slug' or 'some-slug-2')\"\n );\n};\n"],"mappings":";;;;;;;AAAA;AAAgD,eAEhCA,KAAU,IAAK;EAC3B,IAAI,CAACA,KAAK,EAAE;IACR;EACJ;EACAA,KAAK,GAAGA,KAAK,GAAG,EAAE;EAElB,IAAIA,KAAK,CAACC,KAAK,CAAC,0BAA0B,CAAC,IAAID,KAAK,CAACE,MAAM,IAAI,GAAG,EAAE;IAChE;EACJ;EAEA,MAAM,IAAIC,wBAAe,CACrB,2HAA2H,CAC9H;AACL,CAAC;AAAA"}