@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,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,
|
4
|
+
const { composeCustomError } = customErrorWorker({ data, ...(regexp && { regexp: regexp?.source }) });
|
5
5
|
if (!data) {
|
6
6
|
return {
|
7
7
|
customError: composeCustomError(`Missing ${name}`),
|