@vinejs/vine
Advanced tools
Comparing version 1.5.2 to 1.5.3
@@ -1,2 +0,1 @@ | ||
import validator from 'validator'; | ||
import type { FieldContext } from '@vinejs/compiler/types'; | ||
@@ -120,3 +119,3 @@ import type { AlphaOptions, MobileOptions, PassportOptions, CreditCardOptions, PostalCodeOptions } from '../../types.js'; | ||
*/ | ||
export declare const normalizeEmailRule: (options?: validator.default.NormalizeEmailOptions | undefined) => import("../../types.js").Validation<validator.default.NormalizeEmailOptions | undefined>; | ||
export declare const normalizeEmailRule: (options?: import("validator").default.NormalizeEmailOptions | undefined) => import("../../types.js").Validation<import("validator").default.NormalizeEmailOptions | undefined>; | ||
/** | ||
@@ -123,0 +122,0 @@ * Converts the field value to UPPERCASE. |
@@ -9,3 +9,4 @@ /* | ||
*/ | ||
import validator from 'validator'; | ||
import normalizeEmail from 'validator/lib/normalizeEmail.js'; | ||
import escape from 'validator/lib/escape.js'; | ||
import { helpers } from '../../vine/helpers.js'; | ||
@@ -296,3 +297,3 @@ import { messages } from '../../defaults.js'; | ||
} | ||
field.mutate(validator.default.normalizeEmail(value, options), field); | ||
field.mutate(normalizeEmail.default(value, options), field); | ||
}); | ||
@@ -333,3 +334,3 @@ /** | ||
} | ||
field.mutate(validator.default.escape(value), field); | ||
field.mutate(escape.default(value), field); | ||
}); | ||
@@ -336,0 +337,0 @@ /** |
@@ -7,2 +7,3 @@ import type { ParseFn, RefsStore, TransformFn, FieldContext, CompilerNodes, MessagesProviderContact, ErrorReporterContract as BaseReporter } from '@vinejs/compiler/types'; | ||
import type { IsMobilePhoneOptions, MobilePhoneLocale } from 'validator/lib/isMobilePhone.js'; | ||
import type { PostalCodeLocale } from 'validator/lib/isPostalCode.js'; | ||
import type { helpers } from './vine/helpers.js'; | ||
@@ -45,3 +46,3 @@ import type { ValidationError } from './errors/validation_error.js'; | ||
export type PostalCodeOptions = { | ||
countryCode: (typeof helpers)['postalCountryCodes'][number][]; | ||
countryCode: PostalCodeLocale[]; | ||
}; | ||
@@ -48,0 +49,0 @@ /** |
@@ -1,2 +0,4 @@ | ||
import validator from 'validator'; | ||
import isEmail from 'validator/lib/isEmail.js'; | ||
import isURL from 'validator/lib/isURL.js'; | ||
import isIBAN from 'validator/lib/isIBAN.js'; | ||
/** | ||
@@ -70,20 +72,20 @@ * Collection of helpers used across the codebase to coerce | ||
asBoolean(value: any): boolean | null; | ||
isEmail: typeof import("validator/lib/isEmail.js").default; | ||
isURL: typeof import("validator/lib/isURL.js").default; | ||
isAlpha: typeof validator.default.isAlpha; | ||
isAlphaNumeric: typeof validator.default.isAlphanumeric; | ||
isIP: typeof validator.default.isIP; | ||
isUUID: typeof validator.default.isUUID; | ||
isAscii: typeof validator.default.isAscii; | ||
isCreditCard: typeof validator.default.isCreditCard; | ||
isIBAN: typeof import("validator/lib/isIBAN.js").default; | ||
isJWT: typeof validator.default.isJWT; | ||
isLatLong: typeof validator.default.isLatLong; | ||
isMobilePhone: typeof validator.default.isMobilePhone; | ||
isPassportNumber: typeof validator.default.isPassportNumber; | ||
isPostalCode: typeof validator.default.isPostalCode; | ||
isSlug: typeof validator.default.isSlug; | ||
isDecimal: typeof validator.default.isDecimal; | ||
mobileLocales: validator.default.MobilePhoneLocale[]; | ||
postalCountryCodes: validator.default.PostalCodeLocale[]; | ||
isEmail: typeof isEmail.default; | ||
isURL: typeof isURL.default; | ||
isAlpha: typeof import("validator").default.isAlpha; | ||
isAlphaNumeric: typeof import("validator").default.isAlphanumeric; | ||
isIP: typeof import("validator").default.isIP; | ||
isUUID: typeof import("validator").default.isUUID; | ||
isAscii: typeof import("validator").default.isAscii; | ||
isCreditCard: typeof import("validator").default.isCreditCard; | ||
isIBAN: typeof isIBAN.default; | ||
isJWT: typeof import("validator").default.isJWT; | ||
isLatLong: typeof import("validator").default.isLatLong; | ||
isMobilePhone: typeof import("validator").default.isMobilePhone; | ||
isPassportNumber: typeof import("validator").default.isPassportNumber; | ||
isPostalCode: typeof import("validator").default.isPostalCode; | ||
isSlug: typeof import("validator").default.isSlug; | ||
isDecimal: typeof import("validator").default.isDecimal; | ||
mobileLocales: import("validator").default.MobilePhoneLocale[]; | ||
postalCountryCodes: import("validator").default.PostalCodeLocale[]; | ||
passportCountryCodes: readonly ["AM", "AR", "AT", "AU", "AZ", "BE", "BG", "BR", "BY", "CA", "CH", "CY", "CZ", "DE", "DK", "DZ", "ES", "FI", "FR", "GB", "GR", "HR", "HU", "IE", "IN", "ID", "IR", "IS", "IT", "JM", "JP", "KR", "KZ", "LI", "LT", "LU", "LV", "LY", "MT", "MZ", "MY", "MX", "NL", "NZ", "PH", "PK", "PL", "PT", "RO", "RU", "SE", "SL", "SK", "TH", "TR", "UA", "US"]; | ||
@@ -90,0 +92,0 @@ /** |
@@ -9,3 +9,23 @@ /* | ||
*/ | ||
import validator from 'validator'; | ||
import isEmail from 'validator/lib/isEmail.js'; | ||
import isURL from 'validator/lib/isURL.js'; | ||
import isAlpha from 'validator/lib/isAlpha.js'; | ||
import isAlphanumeric from 'validator/lib/isAlphanumeric.js'; | ||
import isIP from 'validator/lib/isIP.js'; | ||
import isUUID from 'validator/lib/isUUID.js'; | ||
import isAscii from 'validator/lib/isAscii.js'; | ||
import isCreditCard from 'validator/lib/isCreditCard.js'; | ||
import isIBAN from 'validator/lib/isIBAN.js'; | ||
import isJWT from 'validator/lib/isJWT.js'; | ||
import isLatLong from 'validator/lib/isLatLong.js'; | ||
import isPassportNumber from 'validator/lib/isPassportNumber.js'; | ||
import isSlug from 'validator/lib/isSlug.js'; | ||
import isDecimal from 'validator/lib/isDecimal.js'; | ||
import isHexColor from 'validator/lib/isHexColor.js'; | ||
import isMobilePhone from 'validator/lib/isMobilePhone.js'; | ||
import isPostalCode from 'validator/lib/isPostalCode.js'; | ||
// @ts-ignore type missing from @types/validator | ||
import { locales as mobilePhoneLocales } from 'validator/lib/isMobilePhone.js'; | ||
// @ts-ignore type missing from @types/validator | ||
import { locales as postalCodeLocales } from 'validator/lib/isPostalCode.js'; | ||
import { resolve4, resolve6 } from 'node:dns/promises'; | ||
@@ -115,20 +135,20 @@ const BOOLEAN_POSITIVES = ['1', 1, 'true', true, 'on']; | ||
}, | ||
isEmail: validator.default.isEmail, | ||
isURL: validator.default.isURL, | ||
isAlpha: validator.default.isAlpha, | ||
isAlphaNumeric: validator.default.isAlphanumeric, | ||
isIP: validator.default.isIP, | ||
isUUID: validator.default.isUUID, | ||
isAscii: validator.default.isAscii, | ||
isCreditCard: validator.default.isCreditCard, | ||
isIBAN: validator.default.isIBAN, | ||
isJWT: validator.default.isJWT, | ||
isLatLong: validator.default.isLatLong, | ||
isMobilePhone: validator.default.isMobilePhone, | ||
isPassportNumber: validator.default.isPassportNumber, | ||
isPostalCode: validator.default.isPostalCode, | ||
isSlug: validator.default.isSlug, | ||
isDecimal: validator.default.isDecimal, | ||
mobileLocales: validator.default.isMobilePhoneLocales, | ||
postalCountryCodes: validator.default.isPostalCodeLocales, | ||
isEmail: isEmail.default, | ||
isURL: isURL.default, | ||
isAlpha: isAlpha.default, | ||
isAlphaNumeric: isAlphanumeric.default, | ||
isIP: isIP.default, | ||
isUUID: isUUID.default, | ||
isAscii: isAscii.default, | ||
isCreditCard: isCreditCard.default, | ||
isIBAN: isIBAN.default, | ||
isJWT: isJWT.default, | ||
isLatLong: isLatLong.default, | ||
isMobilePhone: isMobilePhone.default, | ||
isPassportNumber: isPassportNumber.default, | ||
isPostalCode: isPostalCode.default, | ||
isSlug: isSlug.default, | ||
isDecimal: isDecimal.default, | ||
mobileLocales: mobilePhoneLocales, | ||
postalCountryCodes: postalCodeLocales, | ||
passportCountryCodes: [ | ||
@@ -200,3 +220,3 @@ 'AM', | ||
} | ||
return validator.default.isHexColor(value); | ||
return isHexColor.default(value); | ||
}, | ||
@@ -203,0 +223,0 @@ /** |
@@ -38,5 +38,3 @@ import { createRule } from './create_rule.js'; | ||
isEmail: typeof import("validator/lib/isEmail.js").default; | ||
isURL: typeof import("validator/lib/isURL.js").default; /** | ||
* Schema to use for validation | ||
*/ | ||
isURL: typeof import("validator/lib/isURL.js").default; | ||
isAlpha: typeof import("validator").default.isAlpha; | ||
@@ -43,0 +41,0 @@ isAlphaNumeric: typeof import("validator").default.isAlphanumeric; |
{ | ||
"name": "@vinejs/vine", | ||
"version": "1.5.2", | ||
"version": "1.5.3", | ||
"description": "Form data validation library for Node.js", | ||
@@ -5,0 +5,0 @@ "type": "module", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
204216
6269
1