Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import { minValue } from 'vuelidate/lib/validators'
import includes from 'lodash/includes'
import { parseSize } from '@/utils'
const base64Pattern = /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/
const uppercaseAlphaNumPattern = /^[A-Z0-9]+$/
const alphaNumUnderscorePattern = /^\w+$/
const alphaNumUnderscoreHyphenPattern = /^[a-zA-Z0-9-_]+$/
const resourceNamePattern = /^[a-z0-9](?:[-a-z0-9]*[a-z0-9])?$/
const consecutiveHyphenPattern = /.?-{2,}.?/
const startEndHyphenPattern = /^-.*.|.*-$/
const numberOrPercentagePattern = /^[\d]+[%]?$/
const base64 = regex('base64', base64Pattern)
const uppercaseAlphaNum = regex('uppercaseAlphaNum', uppercaseAlphaNumPattern)
const alphaNumUnderscore = regex('alphaNumUnderscore', alphaNumUnderscorePattern)
const alphaNumUnderscoreHyphen = regex('alphaNumUnderscoreHyphen', alphaNumUnderscoreHyphenPattern)
const resourceName = regex('resourceName', resourceNamePattern)
const noConsecutiveHyphen = (value) => {
return !consecutiveHyphenPattern.test(value)
}
const noStartEndHyphen = (value) => {
return !startEndHyphenPattern.test(value)
}
const numberOrPercentage = (value) => {
return numberOrPercentagePattern.test(value)
}
const unique = key => withParams({ type: 'unique', key },
function (value, parentVm) {
const keys = ref(key, this, parentVm)
return !includes(keys, value)
import includes from 'lodash/includes'
import { parseSize } from '@/utils'
const base64Pattern = /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/
const uppercaseAlphaNumPattern = /^[A-Z0-9]+$/
const alphaNumUnderscorePattern = /^\w+$/
const alphaNumUnderscoreHyphenPattern = /^[a-zA-Z0-9-_]+$/
const resourceNamePattern = /^[a-z0-9](?:[-a-z0-9]*[a-z0-9])?$/
const consecutiveHyphenPattern = /.?-{2,}.?/
const startEndHyphenPattern = /^-.*.|.*-$/
const numberOrPercentagePattern = /^[\d]+[%]?$/
const base64 = regex('base64', base64Pattern)
const uppercaseAlphaNum = regex('uppercaseAlphaNum', uppercaseAlphaNumPattern)
const alphaNumUnderscore = regex('alphaNumUnderscore', alphaNumUnderscorePattern)
const alphaNumUnderscoreHyphen = regex('alphaNumUnderscoreHyphen', alphaNumUnderscoreHyphenPattern)
const resourceName = regex('resourceName', resourceNamePattern)
const noConsecutiveHyphen = (value) => {
return !consecutiveHyphenPattern.test(value)
}
const noStartEndHyphen = (value) => {
return !startEndHyphenPattern.test(value)
}
const numberOrPercentage = (value) => {
return numberOrPercentagePattern.test(value)
}
const unique = key => withParams({ type: 'unique', key },
function (value, parentVm) {
const keys = ref(key, this, parentVm)
return !includes(keys, value)
}
import { parseSize } from '@/utils'
const base64Pattern = /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/
const uppercaseAlphaNumPattern = /^[A-Z0-9]+$/
const alphaNumUnderscorePattern = /^\w+$/
const alphaNumUnderscoreHyphenPattern = /^[a-zA-Z0-9-_]+$/
const resourceNamePattern = /^[a-z0-9](?:[-a-z0-9]*[a-z0-9])?$/
const consecutiveHyphenPattern = /.?-{2,}.?/
const startEndHyphenPattern = /^-.*.|.*-$/
const numberOrPercentagePattern = /^[\d]+[%]?$/
const base64 = regex('base64', base64Pattern)
const uppercaseAlphaNum = regex('uppercaseAlphaNum', uppercaseAlphaNumPattern)
const alphaNumUnderscore = regex('alphaNumUnderscore', alphaNumUnderscorePattern)
const alphaNumUnderscoreHyphen = regex('alphaNumUnderscoreHyphen', alphaNumUnderscoreHyphenPattern)
const resourceName = regex('resourceName', resourceNamePattern)
const noConsecutiveHyphen = (value) => {
return !consecutiveHyphenPattern.test(value)
}
const noStartEndHyphen = (value) => {
return !startEndHyphenPattern.test(value)
}
const numberOrPercentage = (value) => {
return numberOrPercentagePattern.test(value)
}
const unique = key => withParams({ type: 'unique', key },
function (value, parentVm) {
const keys = ref(key, this, parentVm)
return !includes(keys, value)
}
)
import { withParams, regex, ref } from 'vuelidate/lib/validators/common'
import { minValue } from 'vuelidate/lib/validators'
import includes from 'lodash/includes'
import { parseSize } from '@/utils'
const base64Pattern = /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/
const uppercaseAlphaNumPattern = /^[A-Z0-9]+$/
const alphaNumUnderscorePattern = /^\w+$/
const alphaNumUnderscoreHyphenPattern = /^[a-zA-Z0-9-_]+$/
const resourceNamePattern = /^[a-z0-9](?:[-a-z0-9]*[a-z0-9])?$/
const consecutiveHyphenPattern = /.?-{2,}.?/
const startEndHyphenPattern = /^-.*.|.*-$/
const numberOrPercentagePattern = /^[\d]+[%]?$/
const base64 = regex('base64', base64Pattern)
const uppercaseAlphaNum = regex('uppercaseAlphaNum', uppercaseAlphaNumPattern)
const alphaNumUnderscore = regex('alphaNumUnderscore', alphaNumUnderscorePattern)
const alphaNumUnderscoreHyphen = regex('alphaNumUnderscoreHyphen', alphaNumUnderscoreHyphenPattern)
const resourceName = regex('resourceName', resourceNamePattern)
const noConsecutiveHyphen = (value) => {
return !consecutiveHyphenPattern.test(value)
}
const noStartEndHyphen = (value) => {
return !startEndHyphenPattern.test(value)
}
const numberOrPercentage = (value) => {
return numberOrPercentagePattern.test(value)
}
const unique = key => withParams({ type: 'unique', key },
function (value, parentVm) {
import { withParams, regex, ref } from 'vuelidate/lib/validators/common'
import { minValue } from 'vuelidate/lib/validators'
import includes from 'lodash/includes'
import { parseSize } from '@/utils'
const base64Pattern = /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/
const uppercaseAlphaNumPattern = /^[A-Z0-9]+$/
const alphaNumUnderscorePattern = /^\w+$/
const alphaNumUnderscoreHyphenPattern = /^[a-zA-Z0-9-_]+$/
const resourceNamePattern = /^[a-z0-9](?:[-a-z0-9]*[a-z0-9])?$/
const consecutiveHyphenPattern = /.?-{2,}.?/
const startEndHyphenPattern = /^-.*.|.*-$/
const numberOrPercentagePattern = /^[\d]+[%]?$/
const base64 = regex('base64', base64Pattern)
const uppercaseAlphaNum = regex('uppercaseAlphaNum', uppercaseAlphaNumPattern)
const alphaNumUnderscore = regex('alphaNumUnderscore', alphaNumUnderscorePattern)
const alphaNumUnderscoreHyphen = regex('alphaNumUnderscoreHyphen', alphaNumUnderscoreHyphenPattern)
const resourceName = regex('resourceName', resourceNamePattern)
const noConsecutiveHyphen = (value) => {
return !consecutiveHyphenPattern.test(value)
}
const noStartEndHyphen = (value) => {
return !startEndHyphenPattern.test(value)
}
const numberOrPercentage = (value) => {
return numberOrPercentagePattern.test(value)
}
const unique = key => withParams({ type: 'unique', key },
function (value, parentVm) {
const keys = ref(key, this, parentVm)
import {regex} from 'vuelidate/lib/validators/common'
export default regex('alphaDash', /^[a-zA-Z0-9_-]*$/)