Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
@skava/forms / build / dist / validators / errorMessage.js
Size: Mime:
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
/* eslint-disable max-statements */
const exotic_1 = require("exotic");
const errorMessageIndexed = {
    email: 'Please enter a valid email address',
    emailAndPhone: 'Please enter a valid phone number / email address',
    enterPassword: 'Please enter your password',
    newPassword: 'Old and New Passwords should not match',
    password: 'Password must have at least 8 characters [ 1 upper case, 1 lower case, 1 special case, 1 number]',
    confirmPassword: 'Passwords do not match',
    currentPassword: 'Please enter your current password',
    name: 'Please enter a valid name',
    firstName: 'Please enter your first name',
    lastName: 'Please enter your last name',
    middleName: 'Please enter a valid middle name',
    nameWithoutSpace: 'Please enter a name without empty space',
    /** @deprecated @name */
    phoneNumber: 'Please enter a valid phone number',
    telephone: 'Please enter a valid phone number',
    addressRequired: 'Please enter your address',
    zipCode: 'Please enter a valid zip code',
    creditCard: 'Enter your 16 digit card number',
    cvvNumber: 'Please enter a valid cvv number',
    expiryDate: 'Please enter the card expiry date',
    expirationMonth: 'Please enter month',
    expirationYear: 'Please enter year',
    otp: 'Please enter the OTP',
    promoCode: 'Please enter a valid promo code',
    securityQuestionAnswer: 'Please enter your answer',
    orderId: 'Order ID is invalid',
    selectSecurityQuestion: 'Please choose a security question',
    city: 'Please enter a valid city',
    state: 'Please enter a valid state',
    country: 'Please enter a valid country',
    postalCode: 'Please enter a valid postal code',
    addressLine1: 'Please enter address line1',
    addressLine2: 'Please enter address line2',
    required: 'This field is required',
    invalidInput: 'Input is invalid',
    invalidPin: 'Enter PIN',
    passwordSameAsEmail: 'Password should not be the same as email',
    couponCode: 'Please enter a valid coupon code',
    cancelReason: 'Please choose an option for cancellation',
    returnReason: 'Please choose an option for return',
    securityCode: 'Enter Security Code',
    organizationName: 'Please enter a valid organization name',
    taxId: 'Please enter a valid tax Id',
    selectRole: 'Please select a valid role',
    selectTeam: 'Please select a valid team name',
    selectQuestion: 'Please select a valid question',
};
function errorMessage(type) {
    if (exotic_1.isString(type) && exotic_1.isString(errorMessageIndexed[type])) {
        return errorMessageIndexed[type];
    }
    // Default message
    return 'This field is required';
}
exports.errorMessageFor = errorMessage;
exports.errorMessage = errorMessage;
exports.default = errorMessage;
//# sourceMappingURL=errorMessage.js.map