@candlerip/shared3 0.0.125 → 0.0.126

Sign up to get free protection for your applications and to get access to all the features.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@candlerip/shared3",
3
- "version": "0.0.125",
3
+ "version": "0.0.126",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": "./src/index.js",
@@ -1,7 +1,7 @@
1
1
  import { customErrorWorker } from '../../error/index.js';
2
2
  import { isString } from './type-guard.js';
3
3
  export const validateString = (data, name, regexp) => {
4
- const { composeCustomError } = customErrorWorker({ data, name, regexp: JSON.stringify(regexp) });
4
+ const { composeCustomError } = customErrorWorker({ data, ...(regexp && { regexp: regexp?.source }) });
5
5
  if (!data) {
6
6
  return {
7
7
  customError: composeCustomError(`Missing ${name}`),