diff --git a/src/schema/accepted/main.ts b/src/schema/accepted/main.ts index 550c349..cbb72c5 100644 --- a/src/schema/accepted/main.ts +++ b/src/schema/accepted/main.ts @@ -10,6 +10,7 @@ import { acceptedRule } from './rules.js' import { BaseLiteralType } from '../base/literal.js' import type { FieldOptions, Validation } from '../../types.js' +import { SUBTYPE } from '../../symbols.js' /** * VineAccepted represents a checkbox input that must be checked @@ -24,7 +25,12 @@ export class VineAccepted extends BaseLiteralType< */ static rules = { accepted: acceptedRule, - } + }; + + /** + * The subtype of the literal schema field + */ + [SUBTYPE] = 'checkbox' constructor(options?: Partial, validations?: Validation[]) { super(options, validations || [acceptedRule()]) diff --git a/src/schema/any/main.ts b/src/schema/any/main.ts index b0225ef..d171409 100644 --- a/src/schema/any/main.ts +++ b/src/schema/any/main.ts @@ -9,6 +9,7 @@ import { BaseLiteralType } from '../base/literal.js' import type { FieldOptions, Validation } from '../../types.js' +import { SUBTYPE } from '../../symbols.js' /** * VineAny represents a value that can be anything @@ -18,6 +19,11 @@ export class VineAny extends BaseLiteralType { super(options, validations) } + /** + * The subtype of the literal schema field + */ + [SUBTYPE] = 'any' + /** * Clones the VineAny schema type. The applied options * and validations are copied to the new instance diff --git a/src/schema/base/literal.ts b/src/schema/base/literal.ts index efade13..ef019ad 100644 --- a/src/schema/base/literal.ts +++ b/src/schema/base/literal.ts @@ -11,7 +11,7 @@ import camelcase from 'camelcase' import Macroable from '@poppinss/macroable' import type { LiteralNode, RefsStore } from '@vinejs/compiler/types' -import { OTYPE, COTYPE, PARSE, VALIDATION, ITYPE } from '../../symbols.js' +import { OTYPE, COTYPE, PARSE, VALIDATION, ITYPE, SUBTYPE } from '../../symbols.js' import type { Parser, Validation, @@ -39,7 +39,11 @@ abstract class BaseModifiersType * Each subtype should implement the compile method that returns * one of the known compiler nodes */ - abstract [PARSE](propertyName: string, refs: RefsStore, options: ParserOptions): LiteralNode + abstract [PARSE]( + propertyName: string, + refs: RefsStore, + options: ParserOptions + ): LiteralNode & { subtype: string } /** * The child class must implement the clone method @@ -116,7 +120,11 @@ export class NullableModifier< /** * Compiles to compiler node */ - [PARSE](propertyName: string, refs: RefsStore, options: ParserOptions): LiteralNode { + [PARSE]( + propertyName: string, + refs: RefsStore, + options: ParserOptions + ): LiteralNode & { subtype: string } { const output = this.#parent[PARSE](propertyName, refs, options) output.allowNull = true return output @@ -327,7 +335,11 @@ export class OptionalModifier< /** * Compiles to compiler node */ - [PARSE](propertyName: string, refs: RefsStore, options: ParserOptions): LiteralNode { + [PARSE]( + propertyName: string, + refs: RefsStore, + options: ParserOptions + ): LiteralNode & { subtype: string } { const output = this.#parent[PARSE](propertyName, refs, options) output.isOptional = true output.validations = output.validations.concat(this.compileValidations(refs)) @@ -369,7 +381,11 @@ export class TransformModifier< /** * Compiles to compiler node */ - [PARSE](propertyName: string, refs: RefsStore, options: ParserOptions): LiteralNode { + [PARSE]( + propertyName: string, + refs: RefsStore, + options: ParserOptions + ): LiteralNode & { subtype: string } { const output = this.#parent[PARSE](propertyName, refs, options) output.transformFnId = refs.trackTransformer(this.#transform) return output @@ -385,6 +401,11 @@ export abstract class BaseLiteralType extends Ba Output, CamelCaseOutput > { + /** + * Specify the subtype of the literal schema field + */ + abstract [SUBTYPE]: string + /** * The child class must implement the clone method */ @@ -479,9 +500,14 @@ export abstract class BaseLiteralType extends Ba /** * Compiles the schema type to a compiler node */ - [PARSE](propertyName: string, refs: RefsStore, options: ParserOptions): LiteralNode { + [PARSE]( + propertyName: string, + refs: RefsStore, + options: ParserOptions + ): LiteralNode & { subtype: string } { return { type: 'literal', + subtype: this[SUBTYPE], fieldName: propertyName, propertyName: options.toCamelCase ? camelcase(propertyName) : propertyName, bail: this.options.bail, diff --git a/src/schema/base/main.ts b/src/schema/base/main.ts index 63c1129..68ad994 100644 --- a/src/schema/base/main.ts +++ b/src/schema/base/main.ts @@ -7,7 +7,7 @@ * file that was distributed with this source code. */ -import type { CompilerNodes, RefsStore } from '@vinejs/compiler/types' +import type { RefsStore } from '@vinejs/compiler/types' import { ITYPE, OTYPE, COTYPE, PARSE, VALIDATION } from '../../symbols.js' import type { @@ -15,6 +15,7 @@ import type { Validation, RuleBuilder, FieldOptions, + CompilerNodes, ParserOptions, ConstructableSchema, } from '../../types.js' diff --git a/src/schema/boolean/main.ts b/src/schema/boolean/main.ts index f377c23..8094168 100644 --- a/src/schema/boolean/main.ts +++ b/src/schema/boolean/main.ts @@ -10,7 +10,7 @@ import { booleanRule } from './rules.js' import { helpers } from '../../vine/helpers.js' import { BaseLiteralType } from '../base/literal.js' -import { IS_OF_TYPE, UNIQUE_NAME } from '../../symbols.js' +import { IS_OF_TYPE, SUBTYPE, UNIQUE_NAME } from '../../symbols.js' import type { FieldOptions, Validation } from '../../types.js' /** @@ -26,6 +26,11 @@ export class VineBoolean extends BaseLiteralType { */ [UNIQUE_NAME] = 'vine.date'; + /** + * The subtype of the literal schema field + */ + [SUBTYPE] = 'date'; + /** * Checks if the value is of date type. The method must be * implemented for "unionOfTypes" diff --git a/src/schema/enum/main.ts b/src/schema/enum/main.ts index 268792b..32a9323 100644 --- a/src/schema/enum/main.ts +++ b/src/schema/enum/main.ts @@ -10,6 +10,7 @@ import { enumRule } from './rules.js' import { BaseLiteralType } from '../base/literal.js' import type { FieldContext, FieldOptions, Validation } from '../../types.js' +import { SUBTYPE } from '../../symbols.js' /** * VineEnum represents a enum data type that performs validation @@ -27,7 +28,12 @@ export class VineEnum extends BaseLiter enum: enumRule, } - #values: Values | ((field: FieldContext) => Values) + #values: Values | ((field: FieldContext) => Values); + + /** + * The subtype of the literal schema field + */ + [SUBTYPE] = 'enum' /** * Returns the enum choices diff --git a/src/schema/enum/native_enum.ts b/src/schema/enum/native_enum.ts index 6254869..2af8bd6 100644 --- a/src/schema/enum/native_enum.ts +++ b/src/schema/enum/native_enum.ts @@ -10,6 +10,7 @@ import { enumRule } from './rules.js' import { BaseLiteralType } from '../base/literal.js' import type { EnumLike, FieldOptions, Validation } from '../../types.js' +import { SUBTYPE } from '../../symbols.js' /** * VineNativeEnum represents a enum data type that performs validation @@ -30,7 +31,12 @@ export class VineNativeEnum extends BaseLiteralType< enum: enumRule, } - #values: Values + #values: Values; + + /** + * The subtype of the literal schema field + */ + [SUBTYPE] = 'enum' constructor(values: Values, options?: FieldOptions, validations?: Validation[]) { super(options, validations || [enumRule({ choices: Object.values(values) })]) diff --git a/src/schema/literal/main.ts b/src/schema/literal/main.ts index 48dc634..95e23b7 100644 --- a/src/schema/literal/main.ts +++ b/src/schema/literal/main.ts @@ -10,6 +10,7 @@ import { equalsRule } from './rules.js' import { BaseLiteralType } from '../base/literal.js' import type { FieldOptions, Validation } from '../../types.js' +import { SUBTYPE } from '../../symbols.js' /** * VineLiteral represents a type that matches an exact value @@ -22,7 +23,12 @@ export class VineLiteral extends BaseLiteralType { equals: equalsRule, } - #value: Value + #value: Value; + + /** + * The subtype of the literal schema field + */ + [SUBTYPE] = 'literal' constructor(value: Value, options?: FieldOptions, validations?: Validation[]) { super(options, validations || [equalsRule({ expectedValue: value })]) diff --git a/src/schema/number/main.ts b/src/schema/number/main.ts index b04f2b5..f12ce85 100644 --- a/src/schema/number/main.ts +++ b/src/schema/number/main.ts @@ -10,7 +10,7 @@ import { helpers } from '../../vine/helpers.js' import { BaseLiteralType } from '../base/literal.js' import { FieldOptions, Validation } from '../../types.js' -import { IS_OF_TYPE, UNIQUE_NAME } from '../../symbols.js' +import { IS_OF_TYPE, SUBTYPE, UNIQUE_NAME } from '../../symbols.js' import { maxRule, @@ -45,6 +45,11 @@ export class VineNumber extends BaseLiteralType withoutDecimals: withoutDecimalsRule, }; + /** + * The subtype of the literal schema field + */ + [SUBTYPE] = 'number'; + /** * The property must be implemented for "unionOfTypes" */ diff --git a/src/schema/string/main.ts b/src/schema/string/main.ts index 1fdf1b6..4e09492 100644 --- a/src/schema/string/main.ts +++ b/src/schema/string/main.ts @@ -8,7 +8,7 @@ */ import { BaseLiteralType } from '../base/literal.js' -import { IS_OF_TYPE, UNIQUE_NAME } from '../../symbols.js' +import { IS_OF_TYPE, SUBTYPE, UNIQUE_NAME } from '../../symbols.js' import type { Validation, AlphaOptions, @@ -100,6 +100,11 @@ export class VineString extends BaseLiteralType { normalizeEmail: normalizeEmailRule, }; + /** + * The subtype of the literal schema field + */ + [SUBTYPE] = 'string'; + /** * The property must be implemented for "unionOfTypes" */ diff --git a/src/symbols.ts b/src/symbols.ts index 8927d7b..3555f30 100644 --- a/src/symbols.ts +++ b/src/symbols.ts @@ -42,3 +42,8 @@ export const COTYPE = Symbol.for('camelcase_opaque_type') * The symbol to generate a validation rule from rule builder */ export const VALIDATION = Symbol.for('to_validation') + +/** + * The symbol for the subtype of a literal field + */ +export const SUBTYPE = Symbol.for('subtype') diff --git a/src/types.ts b/src/types.ts index daf0022..ccd7161 100644 --- a/src/types.ts +++ b/src/types.ts @@ -17,9 +17,14 @@ import type { IsMobilePhoneOptions, MobilePhoneLocale } from 'validator/lib/isMo import type { ParseFn, RefsStore, + TupleNode, + ArrayNode, + UnionNode, + RecordNode, + ObjectNode, TransformFn, + LiteralNode, FieldContext, - CompilerNodes, MessagesProviderContact, ErrorReporterContract as BaseReporter, } from '@vinejs/compiler/types' @@ -28,6 +33,17 @@ import type { helpers } from './vine/helpers.js' import type { ValidationError } from './errors/validation_error.js' import type { OTYPE, COTYPE, PARSE, VALIDATION, UNIQUE_NAME, IS_OF_TYPE, ITYPE } from './symbols.js' +/** + * Compiler nodes emitted by Vine + */ +export type CompilerNodes = + | (LiteralNode & { subtype: string }) + | ObjectNode + | ArrayNode + | UnionNode + | RecordNode + | TupleNode + /** * Options accepted by the mobile number validation */ diff --git a/tests/integration/validator.spec.ts b/tests/integration/validator.spec.ts index f2b7912..3701c97 100644 --- a/tests/integration/validator.spec.ts +++ b/tests/integration/validator.spec.ts @@ -254,6 +254,7 @@ test.group('Validator | toJSON', () => { "isOptional": false, "parseFnId": undefined, "propertyName": "name", + "subtype": "string", "type": "literal", "validations": [ { @@ -270,6 +271,7 @@ test.group('Validator | toJSON', () => { "isOptional": false, "parseFnId": undefined, "propertyName": "email", + "subtype": "string", "type": "literal", "validations": [ { @@ -291,6 +293,7 @@ test.group('Validator | toJSON', () => { "isOptional": false, "parseFnId": undefined, "propertyName": "role", + "subtype": "string", "type": "literal", "validations": [ { diff --git a/tests/unit/schema/accepted.spec.ts b/tests/unit/schema/accepted.spec.ts index 3f06978..905a92b 100644 --- a/tests/unit/schema/accepted.spec.ts +++ b/tests/unit/schema/accepted.spec.ts @@ -20,6 +20,7 @@ test.group('VineAccepted', () => { const schema = vine.accepted() assert.deepEqual(schema[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'checkbox', fieldName: '*', propertyName: '*', allowNull: false, @@ -41,6 +42,7 @@ test.group('VineAccepted', () => { assert.deepEqual(schema[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'checkbox', fieldName: '*', propertyName: '*', allowNull: true, @@ -62,6 +64,7 @@ test.group('VineAccepted', () => { assert.deepEqual(schema[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'checkbox', fieldName: '*', propertyName: '*', allowNull: false, @@ -83,6 +86,7 @@ test.group('VineAccepted', () => { assert.deepEqual(schema[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'checkbox', fieldName: '*', propertyName: '*', allowNull: false, @@ -103,6 +107,7 @@ test.group('VineAccepted', () => { const schema = vine.accepted().parse(() => {}) assert.deepEqual(schema[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'checkbox', fieldName: '*', propertyName: '*', allowNull: false, @@ -123,6 +128,7 @@ test.group('VineAccepted', () => { const schema = vine.accepted().transform(() => {}) assert.deepEqual(schema[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'checkbox', fieldName: '*', propertyName: '*', allowNull: false, @@ -148,6 +154,7 @@ test.group('VineAccepted | clone', () => { assert.deepEqual(schema[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'checkbox', fieldName: '*', propertyName: '*', allowNull: false, @@ -164,6 +171,7 @@ test.group('VineAccepted | clone', () => { }) assert.deepEqual(schema1[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'checkbox', fieldName: '*', propertyName: '*', allowNull: false, @@ -186,6 +194,7 @@ test.group('VineAccepted | clone', () => { assert.deepEqual(schema[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'checkbox', fieldName: '*', propertyName: '*', allowNull: false, @@ -202,6 +211,7 @@ test.group('VineAccepted | clone', () => { }) assert.deepEqual(schema1[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'checkbox', fieldName: '*', propertyName: '*', allowNull: true, @@ -224,6 +234,7 @@ test.group('VineAccepted | clone', () => { assert.deepEqual(schema[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'checkbox', fieldName: '*', propertyName: '*', allowNull: false, @@ -240,6 +251,7 @@ test.group('VineAccepted | clone', () => { }) assert.deepEqual(schema1[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'checkbox', fieldName: '*', propertyName: '*', allowNull: false, @@ -262,6 +274,7 @@ test.group('VineAccepted | clone', () => { assert.deepEqual(schema[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'checkbox', fieldName: '*', propertyName: '*', allowNull: false, @@ -278,6 +291,7 @@ test.group('VineAccepted | clone', () => { }) assert.deepEqual(schema1[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'checkbox', fieldName: '*', propertyName: '*', allowNull: false, @@ -300,6 +314,7 @@ test.group('VineAccepted | clone', () => { assert.deepEqual(schema[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'checkbox', fieldName: '*', propertyName: '*', allowNull: false, @@ -317,6 +332,7 @@ test.group('VineAccepted | clone', () => { assert.deepEqual(schema1[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'checkbox', fieldName: '*', propertyName: '*', allowNull: false, @@ -340,6 +356,7 @@ test.group('VineAccepted | clone', () => { assert.deepEqual(schema[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'checkbox', fieldName: '*', propertyName: '*', allowNull: false, @@ -356,6 +373,7 @@ test.group('VineAccepted | clone', () => { }) assert.deepEqual(schema1[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'checkbox', fieldName: '*', propertyName: '*', allowNull: false, diff --git a/tests/unit/schema/any.spec.ts b/tests/unit/schema/any.spec.ts index ddee4ba..a5a9ecb 100644 --- a/tests/unit/schema/any.spec.ts +++ b/tests/unit/schema/any.spec.ts @@ -20,6 +20,7 @@ test.group('VineAny', () => { const schema = vine.any() assert.deepEqual(schema[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'any', fieldName: '*', propertyName: '*', allowNull: false, @@ -35,6 +36,7 @@ test.group('VineAny', () => { assert.deepEqual(schema[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'any', fieldName: '*', propertyName: '*', allowNull: true, @@ -50,6 +52,7 @@ test.group('VineAny', () => { assert.deepEqual(schema[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'any', fieldName: '*', propertyName: '*', allowNull: false, @@ -65,6 +68,7 @@ test.group('VineAny', () => { assert.deepEqual(schema[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'any', fieldName: '*', propertyName: '*', allowNull: false, @@ -79,6 +83,7 @@ test.group('VineAny', () => { const schema = vine.any().parse(() => {}) assert.deepEqual(schema[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'any', fieldName: '*', propertyName: '*', allowNull: false, @@ -93,6 +98,7 @@ test.group('VineAny', () => { const schema = vine.any().transform(() => {}) assert.deepEqual(schema[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'any', fieldName: '*', propertyName: '*', allowNull: false, @@ -112,6 +118,7 @@ test.group('VineAny | clone', () => { assert.deepEqual(schema[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'any', fieldName: '*', propertyName: '*', allowNull: false, @@ -122,6 +129,7 @@ test.group('VineAny | clone', () => { }) assert.deepEqual(schema1[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'any', fieldName: '*', propertyName: '*', allowNull: false, @@ -138,6 +146,7 @@ test.group('VineAny | clone', () => { assert.deepEqual(schema[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'any', fieldName: '*', propertyName: '*', allowNull: false, @@ -148,6 +157,7 @@ test.group('VineAny | clone', () => { }) assert.deepEqual(schema1[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'any', fieldName: '*', propertyName: '*', allowNull: true, @@ -164,6 +174,7 @@ test.group('VineAny | clone', () => { assert.deepEqual(schema[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'any', fieldName: '*', propertyName: '*', allowNull: false, @@ -174,6 +185,7 @@ test.group('VineAny | clone', () => { }) assert.deepEqual(schema1[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'any', fieldName: '*', propertyName: '*', allowNull: false, @@ -190,6 +202,7 @@ test.group('VineAny | clone', () => { assert.deepEqual(schema[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'any', fieldName: '*', propertyName: '*', allowNull: false, @@ -200,6 +213,7 @@ test.group('VineAny | clone', () => { }) assert.deepEqual(schema1[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'any', fieldName: '*', propertyName: '*', allowNull: false, @@ -216,6 +230,7 @@ test.group('VineAny | clone', () => { assert.deepEqual(schema[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'any', fieldName: '*', propertyName: '*', allowNull: false, @@ -227,6 +242,7 @@ test.group('VineAny | clone', () => { assert.deepEqual(schema1[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'any', fieldName: '*', propertyName: '*', allowNull: false, @@ -244,6 +260,7 @@ test.group('VineAny | clone', () => { assert.deepEqual(schema[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'any', fieldName: '*', propertyName: '*', allowNull: false, @@ -254,6 +271,7 @@ test.group('VineAny | clone', () => { }) assert.deepEqual(schema1[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'any', fieldName: '*', propertyName: '*', allowNull: false, diff --git a/tests/unit/schema/array.spec.ts b/tests/unit/schema/array.spec.ts index 01b377f..1493f72 100644 --- a/tests/unit/schema/array.spec.ts +++ b/tests/unit/schema/array.spec.ts @@ -56,6 +56,7 @@ test.group('VineArray', () => { properties: [ { type: 'literal', + subtype: 'string', fieldName: 'username', propertyName: 'username', bail: true, @@ -72,6 +73,7 @@ test.group('VineArray', () => { }, { type: 'literal', + subtype: 'string', fieldName: 'password', propertyName: 'password', bail: true, @@ -124,6 +126,7 @@ test.group('VineArray', () => { properties: [ { type: 'literal', + subtype: 'string', fieldName: 'username', propertyName: 'username', bail: true, @@ -140,6 +143,7 @@ test.group('VineArray', () => { }, { type: 'literal', + subtype: 'string', fieldName: 'password', propertyName: 'password', bail: true, @@ -192,6 +196,7 @@ test.group('VineArray', () => { properties: [ { type: 'literal', + subtype: 'string', fieldName: 'username', propertyName: 'username', bail: true, @@ -208,6 +213,7 @@ test.group('VineArray', () => { }, { type: 'literal', + subtype: 'string', fieldName: 'password', propertyName: 'password', bail: true, @@ -260,6 +266,7 @@ test.group('VineArray', () => { properties: [ { type: 'literal', + subtype: 'string', fieldName: 'username', propertyName: 'username', bail: true, @@ -276,6 +283,7 @@ test.group('VineArray', () => { }, { type: 'literal', + subtype: 'string', fieldName: 'password', propertyName: 'password', bail: true, @@ -340,6 +348,7 @@ test.group('VineArray', () => { properties: [ { type: 'literal', + subtype: 'string', fieldName: 'username', propertyName: 'username', bail: true, @@ -356,6 +365,7 @@ test.group('VineArray', () => { }, { type: 'literal', + subtype: 'string', fieldName: 'password', propertyName: 'password', bail: true, @@ -408,6 +418,7 @@ test.group('VineArray', () => { properties: [ { type: 'literal', + subtype: 'string', fieldName: 'username', propertyName: 'username', bail: true, @@ -424,6 +435,7 @@ test.group('VineArray', () => { }, { type: 'literal', + subtype: 'string', fieldName: 'password', propertyName: 'password', bail: true, @@ -476,6 +488,7 @@ test.group('VineArray', () => { properties: [ { type: 'literal', + subtype: 'string', fieldName: 'username', propertyName: 'username', bail: true, @@ -492,6 +505,7 @@ test.group('VineArray', () => { }, { type: 'literal', + subtype: 'string', fieldName: 'password', propertyName: 'password', bail: true, @@ -561,6 +575,7 @@ test.group('VineArray | clone', () => { properties: [ { type: 'literal', + subtype: 'string', fieldName: 'username', propertyName: 'username', bail: true, @@ -577,6 +592,7 @@ test.group('VineArray | clone', () => { }, { type: 'literal', + subtype: 'string', fieldName: 'password', propertyName: 'password', bail: true, @@ -617,6 +633,7 @@ test.group('VineArray | clone', () => { properties: [ { type: 'literal', + subtype: 'string', fieldName: 'username', propertyName: 'username', bail: true, @@ -633,6 +650,7 @@ test.group('VineArray | clone', () => { }, { type: 'literal', + subtype: 'string', fieldName: 'password', propertyName: 'password', bail: true, @@ -684,6 +702,7 @@ test.group('VineArray | clone', () => { properties: [ { type: 'literal', + subtype: 'string', fieldName: 'username', propertyName: 'username', bail: true, @@ -700,6 +719,7 @@ test.group('VineArray | clone', () => { }, { type: 'literal', + subtype: 'string', fieldName: 'password', propertyName: 'password', bail: true, @@ -740,6 +760,7 @@ test.group('VineArray | clone', () => { properties: [ { type: 'literal', + subtype: 'string', fieldName: 'username', propertyName: 'username', bail: true, @@ -756,6 +777,7 @@ test.group('VineArray | clone', () => { }, { type: 'literal', + subtype: 'string', fieldName: 'password', propertyName: 'password', bail: true, @@ -807,6 +829,7 @@ test.group('VineArray | clone', () => { properties: [ { type: 'literal', + subtype: 'string', fieldName: 'username', propertyName: 'username', bail: true, @@ -823,6 +846,7 @@ test.group('VineArray | clone', () => { }, { type: 'literal', + subtype: 'string', fieldName: 'password', propertyName: 'password', bail: true, @@ -863,6 +887,7 @@ test.group('VineArray | clone', () => { properties: [ { type: 'literal', + subtype: 'string', fieldName: 'username', propertyName: 'username', bail: true, @@ -879,6 +904,7 @@ test.group('VineArray | clone', () => { }, { type: 'literal', + subtype: 'string', fieldName: 'password', propertyName: 'password', bail: true, @@ -931,6 +957,7 @@ test.group('VineArray | clone', () => { properties: [ { type: 'literal', + subtype: 'string', fieldName: 'username', propertyName: 'username', bail: true, @@ -947,6 +974,7 @@ test.group('VineArray | clone', () => { }, { type: 'literal', + subtype: 'string', fieldName: 'password', propertyName: 'password', bail: true, @@ -988,6 +1016,7 @@ test.group('VineArray | clone', () => { properties: [ { type: 'literal', + subtype: 'string', fieldName: 'username', propertyName: 'username', bail: true, @@ -1004,6 +1033,7 @@ test.group('VineArray | clone', () => { }, { type: 'literal', + subtype: 'string', fieldName: 'password', propertyName: 'password', bail: true, @@ -1064,6 +1094,7 @@ test.group('VineArray | clone', () => { properties: [ { type: 'literal', + subtype: 'string', fieldName: 'username', propertyName: 'username', bail: true, @@ -1080,6 +1111,7 @@ test.group('VineArray | clone', () => { }, { type: 'literal', + subtype: 'string', fieldName: 'password', propertyName: 'password', bail: true, @@ -1132,6 +1164,7 @@ test.group('VineArray | clone', () => { properties: [ { type: 'literal', + subtype: 'string', fieldName: 'username', propertyName: 'username', bail: true, @@ -1148,6 +1181,7 @@ test.group('VineArray | clone', () => { }, { type: 'literal', + subtype: 'string', fieldName: 'password', propertyName: 'password', bail: true, @@ -1200,6 +1234,7 @@ test.group('VineArray | clone', () => { properties: [ { type: 'literal', + subtype: 'string', fieldName: 'username', propertyName: 'username', bail: true, @@ -1216,6 +1251,7 @@ test.group('VineArray | clone', () => { }, { type: 'literal', + subtype: 'string', fieldName: 'password', propertyName: 'password', bail: true, @@ -1256,6 +1292,7 @@ test.group('VineArray | clone', () => { properties: [ { type: 'literal', + subtype: 'string', fieldName: 'username', propertyName: 'username', bail: true, @@ -1272,6 +1309,7 @@ test.group('VineArray | clone', () => { }, { type: 'literal', + subtype: 'string', fieldName: 'password', propertyName: 'password', bail: true, @@ -1326,6 +1364,7 @@ test.group('VineArray | clone', () => { properties: [ { type: 'literal', + subtype: 'string', fieldName: 'username', propertyName: 'username', bail: true, @@ -1342,6 +1381,7 @@ test.group('VineArray | clone', () => { }, { type: 'literal', + subtype: 'string', fieldName: 'password', propertyName: 'password', bail: true, @@ -1382,6 +1422,7 @@ test.group('VineArray | clone', () => { properties: [ { type: 'literal', + subtype: 'string', fieldName: 'username', propertyName: 'username', bail: true, @@ -1398,6 +1439,7 @@ test.group('VineArray | clone', () => { }, { type: 'literal', + subtype: 'string', fieldName: 'password', propertyName: 'password', bail: true, @@ -1452,6 +1494,7 @@ test.group('VineArray | clone', () => { properties: [ { type: 'literal', + subtype: 'string', fieldName: 'username', propertyName: 'username', bail: true, @@ -1468,6 +1511,7 @@ test.group('VineArray | clone', () => { }, { type: 'literal', + subtype: 'string', fieldName: 'password', propertyName: 'password', bail: true, @@ -1508,6 +1552,7 @@ test.group('VineArray | clone', () => { properties: [ { type: 'literal', + subtype: 'string', fieldName: 'username', propertyName: 'username', bail: true, @@ -1524,6 +1569,7 @@ test.group('VineArray | clone', () => { }, { type: 'literal', + subtype: 'string', fieldName: 'password', propertyName: 'password', bail: true, @@ -1566,6 +1612,7 @@ test.group('VineArray | applying rules', () => { parseFnId: undefined, each: { type: 'literal', + subtype: 'string', fieldName: '*', propertyName: '*', bail: true, @@ -1610,6 +1657,7 @@ test.group('VineArray | applying rules', () => { parseFnId: undefined, each: { type: 'literal', + subtype: 'string', fieldName: '*', propertyName: '*', bail: true, @@ -1654,6 +1702,7 @@ test.group('VineArray | applying rules', () => { parseFnId: undefined, each: { type: 'literal', + subtype: 'string', fieldName: '*', propertyName: '*', bail: true, @@ -1698,6 +1747,7 @@ test.group('VineArray | applying rules', () => { parseFnId: undefined, each: { type: 'literal', + subtype: 'string', fieldName: '*', propertyName: '*', bail: true, @@ -1742,6 +1792,7 @@ test.group('VineArray | applying rules', () => { parseFnId: undefined, each: { type: 'literal', + subtype: 'string', fieldName: '*', propertyName: '*', bail: true, @@ -1786,6 +1837,7 @@ test.group('VineArray | applying rules', () => { parseFnId: undefined, each: { type: 'literal', + subtype: 'string', fieldName: '*', propertyName: '*', bail: true, @@ -1837,6 +1889,7 @@ test.group('VineArray | applying rules', () => { parseFnId: undefined, each: { type: 'literal', + subtype: 'string', fieldName: '*', propertyName: '*', bail: true, diff --git a/tests/unit/schema/boolean.spec.ts b/tests/unit/schema/boolean.spec.ts index 5e36ef4..3f4b171 100644 --- a/tests/unit/schema/boolean.spec.ts +++ b/tests/unit/schema/boolean.spec.ts @@ -21,6 +21,7 @@ test.group('VineBoolean', () => { const schema = vine.boolean() assert.deepEqual(schema[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'boolean', fieldName: '*', propertyName: '*', allowNull: false, @@ -42,6 +43,7 @@ test.group('VineBoolean', () => { const schema = vine.boolean({ strict: true }) assert.deepEqual(schema[PARSE]('*', refs, { toCamelCase: false }), { type: 'literal', + subtype: 'boolean', fieldName: '*', propertyName: '*', allowNull: false, @@ -69,6 +71,7 @@ test.group('VineBoolean', () => { assert.deepEqual(schema[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'boolean', fieldName: '*', propertyName: '*', allowNull: true, @@ -90,6 +93,7 @@ test.group('VineBoolean', () => { assert.deepEqual(schema[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'boolean', fieldName: '*', propertyName: '*', allowNull: false, @@ -111,6 +115,7 @@ test.group('VineBoolean', () => { assert.deepEqual(schema[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'boolean', fieldName: '*', propertyName: '*', allowNull: false, @@ -131,6 +136,7 @@ test.group('VineBoolean', () => { const schema = vine.boolean().parse(() => {}) assert.deepEqual(schema[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'boolean', fieldName: '*', propertyName: '*', allowNull: false, @@ -151,6 +157,7 @@ test.group('VineBoolean', () => { const schema = vine.boolean().transform(() => {}) assert.deepEqual(schema[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'boolean', fieldName: '*', propertyName: '*', allowNull: false, @@ -203,6 +210,7 @@ test.group('VineBoolean | clone', () => { assert.deepEqual(schema[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'boolean', fieldName: '*', propertyName: '*', allowNull: false, @@ -219,6 +227,7 @@ test.group('VineBoolean | clone', () => { }) assert.deepEqual(schema1[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'boolean', fieldName: '*', propertyName: '*', allowNull: false, @@ -241,6 +250,7 @@ test.group('VineBoolean | clone', () => { assert.deepEqual(schema[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'boolean', fieldName: '*', propertyName: '*', allowNull: false, @@ -257,6 +267,7 @@ test.group('VineBoolean | clone', () => { }) assert.deepEqual(schema1[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'boolean', fieldName: '*', propertyName: '*', allowNull: true, @@ -279,6 +290,7 @@ test.group('VineBoolean | clone', () => { assert.deepEqual(schema[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'boolean', fieldName: '*', propertyName: '*', allowNull: false, @@ -295,6 +307,7 @@ test.group('VineBoolean | clone', () => { }) assert.deepEqual(schema1[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'boolean', fieldName: '*', propertyName: '*', allowNull: false, @@ -317,6 +330,7 @@ test.group('VineBoolean | clone', () => { assert.deepEqual(schema[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'boolean', fieldName: '*', propertyName: '*', allowNull: false, @@ -333,6 +347,7 @@ test.group('VineBoolean | clone', () => { }) assert.deepEqual(schema1[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'boolean', fieldName: '*', propertyName: '*', allowNull: false, @@ -355,6 +370,7 @@ test.group('VineBoolean | clone', () => { assert.deepEqual(schema[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'boolean', fieldName: '*', propertyName: '*', allowNull: false, @@ -372,6 +388,7 @@ test.group('VineBoolean | clone', () => { assert.deepEqual(schema1[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'boolean', fieldName: '*', propertyName: '*', allowNull: false, @@ -395,6 +412,7 @@ test.group('VineBoolean | clone', () => { assert.deepEqual(schema[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'boolean', fieldName: '*', propertyName: '*', allowNull: false, @@ -411,6 +429,7 @@ test.group('VineBoolean | clone', () => { }) assert.deepEqual(schema1[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'boolean', fieldName: '*', propertyName: '*', allowNull: false, @@ -434,6 +453,7 @@ test.group('VineBoolean | clone', () => { assert.deepEqual(schema[PARSE]('*', refs, { toCamelCase: false }), { type: 'literal', + subtype: 'boolean', fieldName: '*', propertyName: '*', allowNull: false, @@ -450,6 +470,7 @@ test.group('VineBoolean | clone', () => { }) assert.deepEqual(schema1[PARSE]('*', refs, { toCamelCase: false }), { type: 'literal', + subtype: 'boolean', fieldName: '*', propertyName: '*', allowNull: false, diff --git a/tests/unit/schema/date.spec.ts b/tests/unit/schema/date.spec.ts index b165c8e..291cf43 100644 --- a/tests/unit/schema/date.spec.ts +++ b/tests/unit/schema/date.spec.ts @@ -35,6 +35,7 @@ test.group('VineDate', () => { const schema = vine.date() assert.deepEqual(schema[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'date', fieldName: '*', propertyName: '*', allowNull: false, @@ -56,6 +57,7 @@ test.group('VineDate', () => { assert.deepEqual(schema[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'date', fieldName: '*', propertyName: '*', allowNull: true, @@ -77,6 +79,7 @@ test.group('VineDate', () => { assert.deepEqual(schema[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'date', fieldName: '*', propertyName: '*', allowNull: false, @@ -98,6 +101,7 @@ test.group('VineDate', () => { assert.deepEqual(schema[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'date', fieldName: '*', propertyName: '*', allowNull: false, @@ -119,6 +123,7 @@ test.group('VineDate', () => { assert.deepEqual(schema[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'date', fieldName: '*', propertyName: '*', allowNull: false, @@ -144,6 +149,7 @@ test.group('VineDate', () => { const schema = vine.date().transform(() => {}) assert.deepEqual(schema[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'date', fieldName: '*', propertyName: '*', allowNull: false, @@ -165,6 +171,7 @@ test.group('VineDate', () => { const schema = vine.date().parse(() => {}) assert.deepEqual(schema[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'date', fieldName: '*', propertyName: '*', allowNull: false, @@ -200,6 +207,7 @@ test.group('VineDate | clone', () => { assert.deepEqual(schema[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'date', fieldName: '*', propertyName: '*', allowNull: false, @@ -216,6 +224,7 @@ test.group('VineDate | clone', () => { }) assert.deepEqual(schema1[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'date', fieldName: '*', propertyName: '*', allowNull: false, @@ -238,6 +247,7 @@ test.group('VineDate | clone', () => { assert.deepEqual(schema[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'date', fieldName: '*', propertyName: '*', allowNull: false, @@ -254,6 +264,7 @@ test.group('VineDate | clone', () => { }) assert.deepEqual(schema1[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'date', fieldName: '*', propertyName: '*', allowNull: true, @@ -276,6 +287,7 @@ test.group('VineDate | clone', () => { assert.deepEqual(schema[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'date', fieldName: '*', propertyName: '*', allowNull: false, @@ -292,6 +304,7 @@ test.group('VineDate | clone', () => { }) assert.deepEqual(schema1[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'date', fieldName: '*', propertyName: '*', allowNull: false, @@ -314,6 +327,7 @@ test.group('VineDate | clone', () => { assert.deepEqual(schema[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'date', fieldName: '*', propertyName: '*', allowNull: false, @@ -330,6 +344,7 @@ test.group('VineDate | clone', () => { }) assert.deepEqual(schema1[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'date', fieldName: '*', propertyName: '*', allowNull: false, @@ -352,6 +367,7 @@ test.group('VineDate | clone', () => { assert.deepEqual(schema[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'date', fieldName: '*', propertyName: '*', allowNull: false, @@ -373,6 +389,7 @@ test.group('VineDate | clone', () => { }) assert.deepEqual(schema1[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'date', fieldName: '*', propertyName: '*', allowNull: false, @@ -405,6 +422,7 @@ test.group('VineDate | clone', () => { assert.deepEqual(schema[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'date', fieldName: '*', propertyName: '*', allowNull: false, @@ -422,6 +440,7 @@ test.group('VineDate | clone', () => { assert.deepEqual(schema1[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'date', fieldName: '*', propertyName: '*', allowNull: false, @@ -445,6 +464,7 @@ test.group('VineDate | clone', () => { assert.deepEqual(schema[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'date', fieldName: '*', propertyName: '*', allowNull: false, @@ -461,6 +481,7 @@ test.group('VineDate | clone', () => { }) assert.deepEqual(schema1[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'date', fieldName: '*', propertyName: '*', allowNull: false, @@ -485,6 +506,7 @@ test.group('VineDate | applying rules', () => { assert.deepEqual(schema[PARSE]('*', refs, { toCamelCase: false }), { type: 'literal', + subtype: 'date', fieldName: '*', propertyName: '*', bail: true, @@ -518,6 +540,7 @@ test.group('VineDate | applying rules', () => { assert.deepEqual(schema[PARSE]('*', refs, { toCamelCase: false }), { type: 'literal', + subtype: 'date', fieldName: '*', propertyName: '*', bail: true, @@ -551,6 +574,7 @@ test.group('VineDate | applying rules', () => { assert.deepEqual(schema[PARSE]('*', refs, { toCamelCase: false }), { type: 'literal', + subtype: 'date', fieldName: '*', propertyName: '*', bail: true, @@ -584,6 +608,7 @@ test.group('VineDate | applying rules', () => { assert.deepEqual(schema[PARSE]('*', refs, { toCamelCase: false }), { type: 'literal', + subtype: 'date', fieldName: '*', propertyName: '*', bail: true, @@ -617,6 +642,7 @@ test.group('VineDate | applying rules', () => { assert.deepEqual(schema[PARSE]('*', refs, { toCamelCase: false }), { type: 'literal', + subtype: 'date', fieldName: '*', propertyName: '*', bail: true, @@ -650,6 +676,7 @@ test.group('VineDate | applying rules', () => { assert.deepEqual(schema[PARSE]('*', refs, { toCamelCase: false }), { type: 'literal', + subtype: 'date', fieldName: '*', propertyName: '*', bail: true, @@ -683,6 +710,7 @@ test.group('VineDate | applying rules', () => { assert.deepEqual(schema[PARSE]('*', refs, { toCamelCase: false }), { type: 'literal', + subtype: 'date', fieldName: '*', propertyName: '*', bail: true, @@ -716,6 +744,7 @@ test.group('VineDate | applying rules', () => { assert.deepEqual(schema[PARSE]('*', refs, { toCamelCase: false }), { type: 'literal', + subtype: 'date', fieldName: '*', propertyName: '*', bail: true, @@ -749,6 +778,7 @@ test.group('VineDate | applying rules', () => { assert.deepEqual(schema[PARSE]('*', refs, { toCamelCase: false }), { type: 'literal', + subtype: 'date', fieldName: '*', propertyName: '*', bail: true, @@ -782,6 +812,7 @@ test.group('VineDate | applying rules', () => { assert.deepEqual(schema[PARSE]('*', refs, { toCamelCase: false }), { type: 'literal', + subtype: 'date', fieldName: '*', propertyName: '*', bail: true, @@ -815,6 +846,7 @@ test.group('VineDate | applying rules', () => { assert.deepEqual(schema[PARSE]('*', refs, { toCamelCase: false }), { type: 'literal', + subtype: 'date', fieldName: '*', propertyName: '*', bail: true, @@ -848,6 +880,7 @@ test.group('VineDate | applying rules', () => { assert.deepEqual(schema[PARSE]('*', refs, { toCamelCase: false }), { type: 'literal', + subtype: 'date', fieldName: '*', propertyName: '*', bail: true, @@ -881,6 +914,7 @@ test.group('VineDate | applying rules', () => { assert.deepEqual(schema[PARSE]('*', refs, { toCamelCase: false }), { type: 'literal', + subtype: 'date', fieldName: '*', propertyName: '*', bail: true, diff --git a/tests/unit/schema/enum.spec.ts b/tests/unit/schema/enum.spec.ts index 8ad1f9c..27bea05 100644 --- a/tests/unit/schema/enum.spec.ts +++ b/tests/unit/schema/enum.spec.ts @@ -20,6 +20,7 @@ test.group('VineEnum', () => { const schema = vine.enum(['guest', 'admin', 'moderator']) assert.deepEqual(schema[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'enum', fieldName: '*', propertyName: '*', allowNull: false, @@ -41,6 +42,7 @@ test.group('VineEnum', () => { assert.deepEqual(schema[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'enum', fieldName: '*', propertyName: '*', allowNull: true, @@ -62,6 +64,7 @@ test.group('VineEnum', () => { assert.deepEqual(schema[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'enum', fieldName: '*', propertyName: '*', allowNull: false, @@ -83,6 +86,7 @@ test.group('VineEnum', () => { assert.deepEqual(schema[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'enum', fieldName: '*', propertyName: '*', allowNull: false, @@ -103,6 +107,7 @@ test.group('VineEnum', () => { const schema = vine.enum(['guest', 'admin', 'moderator']).transform(() => {}) assert.deepEqual(schema[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'enum', fieldName: '*', propertyName: '*', allowNull: false, @@ -124,6 +129,7 @@ test.group('VineEnum', () => { const schema = vine.enum(['guest', 'admin', 'moderator']).parse(() => {}) assert.deepEqual(schema[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'enum', fieldName: '*', propertyName: '*', allowNull: false, @@ -148,6 +154,7 @@ test.group('VineEnum | clone', () => { assert.deepEqual(schema[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'enum', fieldName: '*', propertyName: '*', allowNull: false, @@ -164,6 +171,7 @@ test.group('VineEnum | clone', () => { }) assert.deepEqual(schema1[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'enum', fieldName: '*', propertyName: '*', allowNull: false, @@ -186,6 +194,7 @@ test.group('VineEnum | clone', () => { assert.deepEqual(schema[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'enum', fieldName: '*', propertyName: '*', allowNull: false, @@ -202,6 +211,7 @@ test.group('VineEnum | clone', () => { }) assert.deepEqual(schema1[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'enum', fieldName: '*', propertyName: '*', allowNull: true, @@ -224,6 +234,7 @@ test.group('VineEnum | clone', () => { assert.deepEqual(schema[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'enum', fieldName: '*', propertyName: '*', allowNull: false, @@ -240,6 +251,7 @@ test.group('VineEnum | clone', () => { }) assert.deepEqual(schema1[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'enum', fieldName: '*', propertyName: '*', allowNull: false, @@ -262,6 +274,7 @@ test.group('VineEnum | clone', () => { assert.deepEqual(schema[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'enum', fieldName: '*', propertyName: '*', allowNull: false, @@ -278,6 +291,7 @@ test.group('VineEnum | clone', () => { }) assert.deepEqual(schema1[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'enum', fieldName: '*', propertyName: '*', allowNull: false, @@ -300,6 +314,7 @@ test.group('VineEnum | clone', () => { assert.deepEqual(schema[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'enum', fieldName: '*', propertyName: '*', allowNull: false, @@ -317,6 +332,7 @@ test.group('VineEnum | clone', () => { assert.deepEqual(schema1[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'enum', fieldName: '*', propertyName: '*', allowNull: false, @@ -340,6 +356,7 @@ test.group('VineEnum | clone', () => { assert.deepEqual(schema[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'enum', fieldName: '*', propertyName: '*', allowNull: false, @@ -356,6 +373,7 @@ test.group('VineEnum | clone', () => { }) assert.deepEqual(schema1[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'enum', fieldName: '*', propertyName: '*', allowNull: false, diff --git a/tests/unit/schema/literal.spec.ts b/tests/unit/schema/literal.spec.ts index 128af0e..551b3a4 100644 --- a/tests/unit/schema/literal.spec.ts +++ b/tests/unit/schema/literal.spec.ts @@ -20,6 +20,7 @@ test.group('VineLiteral', () => { const schema = vine.literal(22) assert.deepEqual(schema[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'literal', fieldName: '*', propertyName: '*', allowNull: false, @@ -41,6 +42,7 @@ test.group('VineLiteral', () => { assert.deepEqual(schema[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'literal', fieldName: '*', propertyName: '*', allowNull: true, @@ -62,6 +64,7 @@ test.group('VineLiteral', () => { assert.deepEqual(schema[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'literal', fieldName: '*', propertyName: '*', allowNull: false, @@ -83,6 +86,7 @@ test.group('VineLiteral', () => { assert.deepEqual(schema[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'literal', fieldName: '*', propertyName: '*', allowNull: false, @@ -103,6 +107,7 @@ test.group('VineLiteral', () => { const schema = vine.literal(22).transform(() => {}) assert.deepEqual(schema[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'literal', fieldName: '*', propertyName: '*', allowNull: false, @@ -124,6 +129,7 @@ test.group('VineLiteral', () => { const schema = vine.literal(22).parse(() => {}) assert.deepEqual(schema[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'literal', fieldName: '*', propertyName: '*', allowNull: false, @@ -148,6 +154,7 @@ test.group('VineLiteral | clone', () => { assert.deepEqual(schema[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'literal', fieldName: '*', propertyName: '*', allowNull: false, @@ -164,6 +171,7 @@ test.group('VineLiteral | clone', () => { }) assert.deepEqual(schema1[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'literal', fieldName: '*', propertyName: '*', allowNull: false, @@ -186,6 +194,7 @@ test.group('VineLiteral | clone', () => { assert.deepEqual(schema[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'literal', fieldName: '*', propertyName: '*', allowNull: false, @@ -202,6 +211,7 @@ test.group('VineLiteral | clone', () => { }) assert.deepEqual(schema1[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'literal', fieldName: '*', propertyName: '*', allowNull: true, @@ -224,6 +234,7 @@ test.group('VineLiteral | clone', () => { assert.deepEqual(schema[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'literal', fieldName: '*', propertyName: '*', allowNull: false, @@ -240,6 +251,7 @@ test.group('VineLiteral | clone', () => { }) assert.deepEqual(schema1[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'literal', fieldName: '*', propertyName: '*', allowNull: false, @@ -262,6 +274,7 @@ test.group('VineLiteral | clone', () => { assert.deepEqual(schema[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'literal', fieldName: '*', propertyName: '*', allowNull: false, @@ -278,6 +291,7 @@ test.group('VineLiteral | clone', () => { }) assert.deepEqual(schema1[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'literal', fieldName: '*', propertyName: '*', allowNull: false, @@ -300,6 +314,7 @@ test.group('VineLiteral | clone', () => { assert.deepEqual(schema[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'literal', fieldName: '*', propertyName: '*', allowNull: false, @@ -317,6 +332,7 @@ test.group('VineLiteral | clone', () => { assert.deepEqual(schema1[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'literal', fieldName: '*', propertyName: '*', allowNull: false, @@ -340,6 +356,7 @@ test.group('VineLiteral | clone', () => { assert.deepEqual(schema[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'literal', fieldName: '*', propertyName: '*', allowNull: false, @@ -357,6 +374,7 @@ test.group('VineLiteral | clone', () => { assert.deepEqual(schema1[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'literal', fieldName: '*', propertyName: '*', allowNull: false, diff --git a/tests/unit/schema/native_enum.spec.ts b/tests/unit/schema/native_enum.spec.ts index aa23dce..db5d6c9 100644 --- a/tests/unit/schema/native_enum.spec.ts +++ b/tests/unit/schema/native_enum.spec.ts @@ -25,6 +25,7 @@ test.group('VineNativeEnum', () => { const schema = vine.enum(Role) assert.deepEqual(schema[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'enum', fieldName: '*', propertyName: '*', allowNull: false, @@ -46,6 +47,7 @@ test.group('VineNativeEnum', () => { assert.deepEqual(schema[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'enum', fieldName: '*', propertyName: '*', allowNull: true, @@ -67,6 +69,7 @@ test.group('VineNativeEnum', () => { assert.deepEqual(schema[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'enum', fieldName: '*', propertyName: '*', allowNull: false, @@ -88,6 +91,7 @@ test.group('VineNativeEnum', () => { assert.deepEqual(schema[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'enum', fieldName: '*', propertyName: '*', allowNull: false, @@ -108,6 +112,7 @@ test.group('VineNativeEnum', () => { const schema = vine.enum(Role).transform(() => {}) assert.deepEqual(schema[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'enum', fieldName: '*', propertyName: '*', allowNull: false, @@ -129,6 +134,7 @@ test.group('VineNativeEnum', () => { const schema = vine.enum(Role).parse(() => {}) assert.deepEqual(schema[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'enum', fieldName: '*', propertyName: '*', allowNull: false, @@ -153,6 +159,7 @@ test.group('VineNativeEnum | clone', () => { assert.deepEqual(schema[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'enum', fieldName: '*', propertyName: '*', allowNull: false, @@ -169,6 +176,7 @@ test.group('VineNativeEnum | clone', () => { }) assert.deepEqual(schema1[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'enum', fieldName: '*', propertyName: '*', allowNull: false, @@ -191,6 +199,7 @@ test.group('VineNativeEnum | clone', () => { assert.deepEqual(schema[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'enum', fieldName: '*', propertyName: '*', allowNull: false, @@ -207,6 +216,7 @@ test.group('VineNativeEnum | clone', () => { }) assert.deepEqual(schema1[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'enum', fieldName: '*', propertyName: '*', allowNull: true, @@ -229,6 +239,7 @@ test.group('VineNativeEnum | clone', () => { assert.deepEqual(schema[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'enum', fieldName: '*', propertyName: '*', allowNull: false, @@ -245,6 +256,7 @@ test.group('VineNativeEnum | clone', () => { }) assert.deepEqual(schema1[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'enum', fieldName: '*', propertyName: '*', allowNull: false, @@ -267,6 +279,7 @@ test.group('VineNativeEnum | clone', () => { assert.deepEqual(schema[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'enum', fieldName: '*', propertyName: '*', allowNull: false, @@ -283,6 +296,7 @@ test.group('VineNativeEnum | clone', () => { }) assert.deepEqual(schema1[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'enum', fieldName: '*', propertyName: '*', allowNull: false, @@ -305,6 +319,7 @@ test.group('VineNativeEnum | clone', () => { assert.deepEqual(schema[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'enum', fieldName: '*', propertyName: '*', allowNull: false, @@ -322,6 +337,7 @@ test.group('VineNativeEnum | clone', () => { assert.deepEqual(schema1[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'enum', fieldName: '*', propertyName: '*', allowNull: false, @@ -345,6 +361,7 @@ test.group('VineNativeEnum | clone', () => { assert.deepEqual(schema[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'enum', fieldName: '*', propertyName: '*', allowNull: false, @@ -361,6 +378,7 @@ test.group('VineNativeEnum | clone', () => { }) assert.deepEqual(schema1[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'enum', fieldName: '*', propertyName: '*', allowNull: false, diff --git a/tests/unit/schema/number.spec.ts b/tests/unit/schema/number.spec.ts index 99ecbec..e085baa 100644 --- a/tests/unit/schema/number.spec.ts +++ b/tests/unit/schema/number.spec.ts @@ -30,6 +30,7 @@ test.group('VineNumber', () => { const schema = vine.number() assert.deepEqual(schema[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'number', fieldName: '*', propertyName: '*', allowNull: false, @@ -51,6 +52,7 @@ test.group('VineNumber', () => { assert.deepEqual(schema[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'number', fieldName: '*', propertyName: '*', allowNull: true, @@ -72,6 +74,7 @@ test.group('VineNumber', () => { assert.deepEqual(schema[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'number', fieldName: '*', propertyName: '*', allowNull: false, @@ -93,6 +96,7 @@ test.group('VineNumber', () => { assert.deepEqual(schema[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'number', fieldName: '*', propertyName: '*', allowNull: false, @@ -114,6 +118,7 @@ test.group('VineNumber', () => { assert.deepEqual(schema[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'number', fieldName: '*', propertyName: '*', allowNull: false, @@ -144,6 +149,7 @@ test.group('VineNumber', () => { const schema = vine.number().transform(() => {}) assert.deepEqual(schema[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'number', fieldName: '*', propertyName: '*', allowNull: false, @@ -165,6 +171,7 @@ test.group('VineNumber', () => { const schema = vine.number().parse(() => {}) assert.deepEqual(schema[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'number', fieldName: '*', propertyName: '*', allowNull: false, @@ -202,6 +209,7 @@ test.group('VineNumber | clone', () => { assert.deepEqual(schema[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'number', fieldName: '*', propertyName: '*', allowNull: false, @@ -218,6 +226,7 @@ test.group('VineNumber | clone', () => { }) assert.deepEqual(schema1[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'number', fieldName: '*', propertyName: '*', allowNull: false, @@ -240,6 +249,7 @@ test.group('VineNumber | clone', () => { assert.deepEqual(schema[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'number', fieldName: '*', propertyName: '*', allowNull: false, @@ -256,6 +266,7 @@ test.group('VineNumber | clone', () => { }) assert.deepEqual(schema1[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'number', fieldName: '*', propertyName: '*', allowNull: true, @@ -278,6 +289,7 @@ test.group('VineNumber | clone', () => { assert.deepEqual(schema[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'number', fieldName: '*', propertyName: '*', allowNull: false, @@ -294,6 +306,7 @@ test.group('VineNumber | clone', () => { }) assert.deepEqual(schema1[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'number', fieldName: '*', propertyName: '*', allowNull: false, @@ -316,6 +329,7 @@ test.group('VineNumber | clone', () => { assert.deepEqual(schema[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'number', fieldName: '*', propertyName: '*', allowNull: false, @@ -332,6 +346,7 @@ test.group('VineNumber | clone', () => { }) assert.deepEqual(schema1[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'number', fieldName: '*', propertyName: '*', allowNull: false, @@ -354,6 +369,7 @@ test.group('VineNumber | clone', () => { assert.deepEqual(schema[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'number', fieldName: '*', propertyName: '*', allowNull: false, @@ -375,6 +391,7 @@ test.group('VineNumber | clone', () => { }) assert.deepEqual(schema1[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'number', fieldName: '*', propertyName: '*', allowNull: false, @@ -407,6 +424,7 @@ test.group('VineNumber | clone', () => { assert.deepEqual(schema[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'number', fieldName: '*', propertyName: '*', allowNull: false, @@ -424,6 +442,7 @@ test.group('VineNumber | clone', () => { assert.deepEqual(schema1[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'number', fieldName: '*', propertyName: '*', allowNull: false, @@ -447,6 +466,7 @@ test.group('VineNumber | clone', () => { assert.deepEqual(schema[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'number', fieldName: '*', propertyName: '*', allowNull: false, @@ -463,6 +483,7 @@ test.group('VineNumber | clone', () => { }) assert.deepEqual(schema1[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'number', fieldName: '*', propertyName: '*', allowNull: false, @@ -487,6 +508,7 @@ test.group('VineNumber | applying rules', () => { assert.deepEqual(schema[PARSE]('*', refs, { toCamelCase: false }), { type: 'literal', + subtype: 'number', fieldName: '*', propertyName: '*', bail: true, @@ -520,6 +542,7 @@ test.group('VineNumber | applying rules', () => { assert.deepEqual(schema[PARSE]('*', refs, { toCamelCase: false }), { type: 'literal', + subtype: 'number', fieldName: '*', propertyName: '*', bail: true, @@ -553,6 +576,7 @@ test.group('VineNumber | applying rules', () => { assert.deepEqual(schema[PARSE]('*', refs, { toCamelCase: false }), { type: 'literal', + subtype: 'number', fieldName: '*', propertyName: '*', bail: true, @@ -586,6 +610,7 @@ test.group('VineNumber | applying rules', () => { assert.deepEqual(schema[PARSE]('*', refs, { toCamelCase: false }), { type: 'literal', + subtype: 'number', fieldName: '*', propertyName: '*', bail: true, @@ -619,6 +644,7 @@ test.group('VineNumber | applying rules', () => { assert.deepEqual(schema[PARSE]('*', refs, { toCamelCase: false }), { type: 'literal', + subtype: 'number', fieldName: '*', propertyName: '*', bail: true, @@ -652,6 +678,7 @@ test.group('VineNumber | applying rules', () => { assert.deepEqual(schema[PARSE]('*', refs, { toCamelCase: false }), { type: 'literal', + subtype: 'number', fieldName: '*', propertyName: '*', bail: true, @@ -685,6 +712,7 @@ test.group('VineNumber | applying rules', () => { assert.deepEqual(schema[PARSE]('*', refs, { toCamelCase: false }), { type: 'literal', + subtype: 'number', fieldName: '*', propertyName: '*', bail: true, @@ -718,6 +746,7 @@ test.group('VineNumber | applying rules', () => { assert.deepEqual(schema[PARSE]('*', refs, { toCamelCase: false }), { type: 'literal', + subtype: 'number', fieldName: '*', propertyName: '*', bail: true, @@ -751,6 +780,7 @@ test.group('VineNumber | applying rules', () => { assert.deepEqual(schema[PARSE]('*', refs, { toCamelCase: false }), { type: 'literal', + subtype: 'number', fieldName: '*', propertyName: '*', bail: true, diff --git a/tests/unit/schema/object.spec.ts b/tests/unit/schema/object.spec.ts index e6585df..a87c519 100644 --- a/tests/unit/schema/object.spec.ts +++ b/tests/unit/schema/object.spec.ts @@ -55,6 +55,7 @@ test.group('VineObject', () => { properties: [ { type: 'literal', + subtype: 'string', fieldName: 'username', propertyName: 'username', bail: true, @@ -95,6 +96,7 @@ test.group('VineObject', () => { properties: [ { type: 'literal', + subtype: 'string', fieldName: 'username', propertyName: 'username', bail: true, @@ -135,6 +137,7 @@ test.group('VineObject', () => { properties: [ { type: 'literal', + subtype: 'string', fieldName: 'username', propertyName: 'username', bail: true, @@ -175,6 +178,7 @@ test.group('VineObject', () => { properties: [ { type: 'literal', + subtype: 'string', fieldName: 'username', propertyName: 'username', bail: true, @@ -215,6 +219,7 @@ test.group('VineObject', () => { properties: [ { type: 'literal', + subtype: 'string', fieldName: 'username', propertyName: 'username', bail: true, @@ -274,6 +279,7 @@ test.group('VineObject', () => { properties: [ { type: 'literal', + subtype: 'literal', fieldName: 'is_hiring_guide', propertyName: 'is_hiring_guide', bail: true, @@ -290,6 +296,7 @@ test.group('VineObject', () => { }, { type: 'literal', + subtype: 'string', fieldName: 'name', propertyName: 'name', bail: true, @@ -306,6 +313,7 @@ test.group('VineObject', () => { }, { type: 'literal', + subtype: 'string', fieldName: 'price', propertyName: 'price', bail: true, @@ -331,6 +339,7 @@ test.group('VineObject', () => { properties: [ { type: 'literal', + subtype: 'literal', fieldName: 'is_hiring_guide', propertyName: 'is_hiring_guide', bail: true, @@ -355,6 +364,7 @@ test.group('VineObject', () => { properties: [ { type: 'literal', + subtype: 'string', fieldName: 'username', propertyName: 'username', bail: true, @@ -371,6 +381,7 @@ test.group('VineObject', () => { }, { type: 'literal', + subtype: 'string', fieldName: 'password', propertyName: 'password', bail: true, @@ -443,6 +454,7 @@ test.group('VineObject', () => { properties: [ { type: 'literal', + subtype: 'literal', fieldName: 'hiring_guide', propertyName: 'hiring_guide', bail: true, @@ -459,6 +471,7 @@ test.group('VineObject', () => { }, { type: 'literal', + subtype: 'string', fieldName: 'guide_name', propertyName: 'guide_name', bail: true, @@ -475,6 +488,7 @@ test.group('VineObject', () => { }, { type: 'literal', + subtype: 'string', fieldName: 'fees', propertyName: 'fees', bail: true, @@ -500,6 +514,7 @@ test.group('VineObject', () => { properties: [ { type: 'literal', + subtype: 'literal', fieldName: 'hiring_guide', propertyName: 'hiring_guide', bail: true, @@ -531,6 +546,7 @@ test.group('VineObject', () => { properties: [ { type: 'literal', + subtype: 'literal', fieldName: 'monument', propertyName: 'monument', bail: true, @@ -547,6 +563,7 @@ test.group('VineObject', () => { }, { type: 'literal', + subtype: 'enum', fieldName: 'available_transport', propertyName: 'available_transport', bail: true, @@ -563,6 +580,7 @@ test.group('VineObject', () => { }, { type: 'literal', + subtype: 'literal', fieldName: 'has_free_entry', propertyName: 'has_free_entry', bail: true, @@ -588,6 +606,7 @@ test.group('VineObject', () => { properties: [ { type: 'literal', + subtype: 'literal', fieldName: 'monument', propertyName: 'monument', bail: true, @@ -604,6 +623,7 @@ test.group('VineObject', () => { }, { type: 'literal', + subtype: 'enum', fieldName: 'available_transport', propertyName: 'available_transport', bail: true, @@ -620,6 +640,7 @@ test.group('VineObject', () => { }, { type: 'literal', + subtype: 'literal', fieldName: 'has_free_entry', propertyName: 'has_free_entry', bail: true, @@ -644,6 +665,7 @@ test.group('VineObject', () => { properties: [ { type: 'literal', + subtype: 'string', fieldName: 'visitor_name', propertyName: 'visitor_name', bail: true, @@ -709,6 +731,7 @@ test.group('VineObject', () => { properties: [ { type: 'literal', + subtype: 'literal', fieldName: 'is_hiring_guide', propertyName: 'is_hiring_guide', bail: true, @@ -725,6 +748,7 @@ test.group('VineObject', () => { }, { type: 'literal', + subtype: 'string', fieldName: 'name', propertyName: 'name', bail: true, @@ -741,6 +765,7 @@ test.group('VineObject', () => { }, { type: 'literal', + subtype: 'string', fieldName: 'price', propertyName: 'price', bail: true, @@ -766,6 +791,7 @@ test.group('VineObject', () => { properties: [ { type: 'literal', + subtype: 'literal', fieldName: 'is_hiring_guide', propertyName: 'is_hiring_guide', bail: true, @@ -790,6 +816,7 @@ test.group('VineObject', () => { properties: [ { type: 'literal', + subtype: 'string', fieldName: 'username', propertyName: 'username', bail: true, @@ -806,6 +833,7 @@ test.group('VineObject', () => { }, { type: 'literal', + subtype: 'string', fieldName: 'password', propertyName: 'password', bail: true, @@ -860,6 +888,7 @@ test.group('VineObject', () => { properties: [ { type: 'literal', + subtype: 'string', fieldName: 'username', propertyName: 'username', bail: true, @@ -876,6 +905,7 @@ test.group('VineObject', () => { }, { type: 'literal', + subtype: 'string', fieldName: 'password', propertyName: 'password', bail: true, @@ -922,6 +952,7 @@ test.group('VineObject', () => { properties: [ { type: 'literal', + subtype: 'number', fieldName: 'post_id', propertyName: 'postId', bail: true, @@ -950,6 +981,7 @@ test.group('VineObject', () => { properties: [ { type: 'literal', + subtype: 'string', fieldName: 'user_name', propertyName: 'userName', bail: true, @@ -966,6 +998,7 @@ test.group('VineObject', () => { }, { type: 'literal', + subtype: 'string', fieldName: 'pass_word', propertyName: 'passWord', bail: true, @@ -1012,6 +1045,7 @@ test.group('VineObject', () => { properties: [ { type: 'literal', + subtype: 'number', fieldName: 'post_id', propertyName: 'post_id', bail: true, @@ -1040,6 +1074,7 @@ test.group('VineObject', () => { properties: [ { type: 'literal', + subtype: 'string', fieldName: 'user_name', propertyName: 'userName', bail: true, @@ -1056,6 +1091,7 @@ test.group('VineObject', () => { }, { type: 'literal', + subtype: 'string', fieldName: 'pass_word', propertyName: 'passWord', bail: true, @@ -1118,6 +1154,7 @@ test.group('VineObject', () => { properties: [ { type: 'literal', + subtype: 'literal', fieldName: 'is_hiring_guide', propertyName: 'isHiringGuide', bail: true, @@ -1134,6 +1171,7 @@ test.group('VineObject', () => { }, { type: 'literal', + subtype: 'string', fieldName: 'name', propertyName: 'name', bail: true, @@ -1150,6 +1188,7 @@ test.group('VineObject', () => { }, { type: 'literal', + subtype: 'string', fieldName: 'price', propertyName: 'price', bail: true, @@ -1175,6 +1214,7 @@ test.group('VineObject', () => { properties: [ { type: 'literal', + subtype: 'literal', fieldName: 'is_hiring_guide', propertyName: 'isHiringGuide', bail: true, @@ -1199,6 +1239,7 @@ test.group('VineObject', () => { properties: [ { type: 'literal', + subtype: 'string', fieldName: 'username', propertyName: 'username', bail: true, @@ -1215,6 +1256,7 @@ test.group('VineObject', () => { }, { type: 'literal', + subtype: 'string', fieldName: 'password', propertyName: 'password', bail: true, @@ -1288,6 +1330,7 @@ test.group('VineObject', () => { properties: [ { type: 'literal', + subtype: 'literal', fieldName: 'hiring_guide', propertyName: 'hiringGuide', bail: true, @@ -1304,6 +1347,7 @@ test.group('VineObject', () => { }, { type: 'literal', + subtype: 'string', fieldName: 'guide_name', propertyName: 'guideName', bail: true, @@ -1320,6 +1364,7 @@ test.group('VineObject', () => { }, { type: 'literal', + subtype: 'string', fieldName: 'fees', propertyName: 'fees', bail: true, @@ -1345,6 +1390,7 @@ test.group('VineObject', () => { properties: [ { type: 'literal', + subtype: 'literal', fieldName: 'hiring_guide', propertyName: 'hiringGuide', bail: true, @@ -1376,6 +1422,7 @@ test.group('VineObject', () => { properties: [ { type: 'literal', + subtype: 'literal', fieldName: 'monument', propertyName: 'monument', bail: true, @@ -1392,6 +1439,7 @@ test.group('VineObject', () => { }, { type: 'literal', + subtype: 'enum', fieldName: 'available_transport', propertyName: 'availableTransport', bail: true, @@ -1408,6 +1456,7 @@ test.group('VineObject', () => { }, { type: 'literal', + subtype: 'literal', fieldName: 'has_free_entry', propertyName: 'hasFreeEntry', bail: true, @@ -1433,6 +1482,7 @@ test.group('VineObject', () => { properties: [ { type: 'literal', + subtype: 'literal', fieldName: 'monument', propertyName: 'monument', bail: true, @@ -1449,6 +1499,7 @@ test.group('VineObject', () => { }, { type: 'literal', + subtype: 'enum', fieldName: 'available_transport', propertyName: 'availableTransport', bail: true, @@ -1465,6 +1516,7 @@ test.group('VineObject', () => { }, { type: 'literal', + subtype: 'literal', fieldName: 'has_free_entry', propertyName: 'hasFreeEntry', bail: true, @@ -1489,6 +1541,7 @@ test.group('VineObject', () => { properties: [ { type: 'literal', + subtype: 'string', fieldName: 'visitor_name', propertyName: 'visitorName', bail: true, @@ -1533,6 +1586,7 @@ test.group('VineObject', () => { properties: [ { type: 'literal', + subtype: 'number', fieldName: 'post_id', propertyName: 'postId', bail: true, @@ -1561,6 +1615,7 @@ test.group('VineObject', () => { properties: [ { type: 'literal', + subtype: 'string', fieldName: 'user_name', propertyName: 'userName', bail: true, @@ -1577,6 +1632,7 @@ test.group('VineObject', () => { }, { type: 'literal', + subtype: 'string', fieldName: 'pass_word', propertyName: 'passWord', bail: true, @@ -1643,6 +1699,7 @@ test.group('VineObject', () => { properties: [ { type: 'literal', + subtype: 'number', fieldName: 'post_id', propertyName: 'postId', bail: true, @@ -1671,6 +1728,7 @@ test.group('VineObject', () => { properties: [ { type: 'literal', + subtype: 'string', fieldName: 'user_name', propertyName: 'userName', bail: true, @@ -1687,6 +1745,7 @@ test.group('VineObject', () => { }, { type: 'literal', + subtype: 'string', fieldName: 'pass_word', propertyName: 'passWord', bail: true, @@ -1734,6 +1793,7 @@ test.group('VineObject', () => { properties: [ { type: 'literal', + subtype: 'number', fieldName: 'post_id', propertyName: 'postId', bail: true, @@ -1762,6 +1822,7 @@ test.group('VineObject', () => { properties: [ { type: 'literal', + subtype: 'string', fieldName: 'user_name', propertyName: 'userName', bail: true, @@ -1778,6 +1839,7 @@ test.group('VineObject', () => { }, { type: 'literal', + subtype: 'string', fieldName: 'pass_word', propertyName: 'passWord', bail: true, @@ -1881,6 +1943,7 @@ test.group('VineObject | clone', () => { properties: [ { type: 'literal', + subtype: 'string', fieldName: 'username', propertyName: 'username', bail: true, @@ -1912,6 +1975,7 @@ test.group('VineObject | clone', () => { properties: [ { type: 'literal', + subtype: 'string', fieldName: 'username', propertyName: 'username', bail: true, @@ -1928,6 +1992,7 @@ test.group('VineObject | clone', () => { }, { type: 'literal', + subtype: 'string', fieldName: 'password', propertyName: 'password', bail: true, @@ -1968,6 +2033,7 @@ test.group('VineObject | clone', () => { properties: [ { type: 'literal', + subtype: 'string', fieldName: 'username', propertyName: 'username', bail: true, @@ -1999,6 +2065,7 @@ test.group('VineObject | clone', () => { properties: [ { type: 'literal', + subtype: 'string', fieldName: 'username', propertyName: 'username', bail: true, @@ -2038,6 +2105,7 @@ test.group('VineObject | clone', () => { properties: [ { type: 'literal', + subtype: 'string', fieldName: 'username', propertyName: 'username', bail: true, @@ -2069,6 +2137,7 @@ test.group('VineObject | clone', () => { properties: [ { type: 'literal', + subtype: 'string', fieldName: 'username', propertyName: 'username', bail: true, @@ -2109,6 +2178,7 @@ test.group('VineObject | clone', () => { properties: [ { type: 'literal', + subtype: 'string', fieldName: 'username', propertyName: 'username', bail: true, @@ -2140,6 +2210,7 @@ test.group('VineObject | clone', () => { properties: [ { type: 'literal', + subtype: 'string', fieldName: 'username', propertyName: 'username', bail: true, @@ -2179,6 +2250,7 @@ test.group('VineObject | clone', () => { properties: [ { type: 'literal', + subtype: 'string', fieldName: 'username', propertyName: 'username', bail: true, @@ -2209,6 +2281,7 @@ test.group('VineObject | clone', () => { properties: [ { type: 'literal', + subtype: 'string', fieldName: 'username', propertyName: 'username', bail: true, @@ -2259,6 +2332,7 @@ test.group('VineObject | clone', () => { properties: [ { type: 'literal', + subtype: 'string', fieldName: 'username', propertyName: 'username', bail: true, @@ -2275,6 +2349,7 @@ test.group('VineObject | clone', () => { }, { type: 'literal', + subtype: 'string', fieldName: 'password', propertyName: 'password', bail: true, @@ -2314,6 +2389,7 @@ test.group('VineObject | clone', () => { properties: [ { type: 'literal', + subtype: 'literal', fieldName: 'is_hiring_guide', propertyName: 'is_hiring_guide', bail: true, @@ -2330,6 +2406,7 @@ test.group('VineObject | clone', () => { }, { type: 'literal', + subtype: 'string', fieldName: 'name', propertyName: 'name', bail: true, @@ -2346,6 +2423,7 @@ test.group('VineObject | clone', () => { }, { type: 'literal', + subtype: 'string', fieldName: 'price', propertyName: 'price', bail: true, @@ -2371,6 +2449,7 @@ test.group('VineObject | clone', () => { properties: [ { type: 'literal', + subtype: 'literal', fieldName: 'is_hiring_guide', propertyName: 'is_hiring_guide', bail: true, @@ -2395,6 +2474,7 @@ test.group('VineObject | clone', () => { properties: [ { type: 'literal', + subtype: 'string', fieldName: 'username', propertyName: 'username', bail: true, @@ -2411,6 +2491,7 @@ test.group('VineObject | clone', () => { }, { type: 'literal', + subtype: 'string', fieldName: 'password', propertyName: 'password', bail: true, @@ -2482,6 +2563,7 @@ test.group('VineObject | clone', () => { properties: [ { type: 'literal', + subtype: 'literal', fieldName: 'hiring_guide', propertyName: 'hiring_guide', bail: true, @@ -2498,6 +2580,7 @@ test.group('VineObject | clone', () => { }, { type: 'literal', + subtype: 'string', fieldName: 'guide_name', propertyName: 'guide_name', bail: true, @@ -2514,6 +2597,7 @@ test.group('VineObject | clone', () => { }, { type: 'literal', + subtype: 'string', fieldName: 'fees', propertyName: 'fees', bail: true, @@ -2539,6 +2623,7 @@ test.group('VineObject | clone', () => { properties: [ { type: 'literal', + subtype: 'literal', fieldName: 'hiring_guide', propertyName: 'hiring_guide', bail: true, @@ -2563,6 +2648,7 @@ test.group('VineObject | clone', () => { properties: [ { type: 'literal', + subtype: 'string', fieldName: 'visitor_name', propertyName: 'visitor_name', bail: true, @@ -2602,6 +2688,7 @@ test.group('VineObject | clone', () => { properties: [ { type: 'literal', + subtype: 'literal', fieldName: 'monument', propertyName: 'monument', bail: true, @@ -2618,6 +2705,7 @@ test.group('VineObject | clone', () => { }, { type: 'literal', + subtype: 'enum', fieldName: 'available_transport', propertyName: 'available_transport', bail: true, @@ -2634,6 +2722,7 @@ test.group('VineObject | clone', () => { }, { type: 'literal', + subtype: 'literal', fieldName: 'has_free_entry', propertyName: 'has_free_entry', bail: true, @@ -2659,6 +2748,7 @@ test.group('VineObject | clone', () => { properties: [ { type: 'literal', + subtype: 'literal', fieldName: 'monument', propertyName: 'monument', bail: true, @@ -2675,6 +2765,7 @@ test.group('VineObject | clone', () => { }, { type: 'literal', + subtype: 'enum', fieldName: 'available_transport', propertyName: 'available_transport', bail: true, @@ -2691,6 +2782,7 @@ test.group('VineObject | clone', () => { }, { type: 'literal', + subtype: 'literal', fieldName: 'has_free_entry', propertyName: 'has_free_entry', bail: true, @@ -2715,6 +2807,7 @@ test.group('VineObject | clone', () => { properties: [ { type: 'literal', + subtype: 'string', fieldName: 'visitor_name', propertyName: 'visitor_name', bail: true, @@ -2758,6 +2851,7 @@ test.group('VineObject | clone', () => { properties: [ { type: 'literal', + subtype: 'number', fieldName: 'post_id', propertyName: 'post_id', bail: true, @@ -2786,6 +2880,7 @@ test.group('VineObject | clone', () => { properties: [ { type: 'literal', + subtype: 'string', fieldName: 'user_name', propertyName: 'user_name', bail: true, @@ -2802,6 +2897,7 @@ test.group('VineObject | clone', () => { }, { type: 'literal', + subtype: 'string', fieldName: 'pass_word', propertyName: 'pass_word', bail: true, @@ -2835,6 +2931,7 @@ test.group('VineObject | clone', () => { properties: [ { type: 'literal', + subtype: 'number', fieldName: 'post_id', propertyName: 'postId', bail: true, @@ -2863,6 +2960,7 @@ test.group('VineObject | clone', () => { properties: [ { type: 'literal', + subtype: 'string', fieldName: 'user_name', propertyName: 'userName', bail: true, @@ -2879,6 +2977,7 @@ test.group('VineObject | clone', () => { }, { type: 'literal', + subtype: 'string', fieldName: 'pass_word', propertyName: 'passWord', bail: true, @@ -2926,6 +3025,7 @@ test.group('VineObject | clone', () => { properties: [ { type: 'literal', + subtype: 'number', fieldName: 'post_id', propertyName: 'postId', bail: true, @@ -2954,6 +3054,7 @@ test.group('VineObject | clone', () => { properties: [ { type: 'literal', + subtype: 'string', fieldName: 'user_name', propertyName: 'userName', bail: true, @@ -2970,6 +3071,7 @@ test.group('VineObject | clone', () => { }, { type: 'literal', + subtype: 'string', fieldName: 'pass_word', propertyName: 'passWord', bail: true, @@ -3003,6 +3105,7 @@ test.group('VineObject | clone', () => { properties: [ { type: 'literal', + subtype: 'string', fieldName: 'user_name', propertyName: 'user_name', bail: true, @@ -3019,6 +3122,7 @@ test.group('VineObject | clone', () => { }, { type: 'literal', + subtype: 'string', fieldName: 'pass_word', propertyName: 'pass_word', bail: true, @@ -3084,6 +3188,7 @@ test.group('VineObject | clone', () => { properties: [ { type: 'literal', + subtype: 'literal', fieldName: 'is_hiring_guide', propertyName: 'is_hiring_guide', bail: true, @@ -3100,6 +3205,7 @@ test.group('VineObject | clone', () => { }, { type: 'literal', + subtype: 'string', fieldName: 'name', propertyName: 'name', bail: true, @@ -3116,6 +3222,7 @@ test.group('VineObject | clone', () => { }, { type: 'literal', + subtype: 'string', fieldName: 'price', propertyName: 'price', bail: true, @@ -3141,6 +3248,7 @@ test.group('VineObject | clone', () => { properties: [ { type: 'literal', + subtype: 'literal', fieldName: 'is_hiring_guide', propertyName: 'is_hiring_guide', bail: true, @@ -3165,6 +3273,7 @@ test.group('VineObject | clone', () => { properties: [ { type: 'literal', + subtype: 'string', fieldName: 'username', propertyName: 'username', bail: true, @@ -3181,6 +3290,7 @@ test.group('VineObject | clone', () => { }, { type: 'literal', + subtype: 'string', fieldName: 'password', propertyName: 'password', bail: true, @@ -3220,6 +3330,7 @@ test.group('VineObject | clone', () => { properties: [ { type: 'literal', + subtype: 'literal', fieldName: 'is_hiring_guide', propertyName: 'is_hiring_guide', bail: true, @@ -3236,6 +3347,7 @@ test.group('VineObject | clone', () => { }, { type: 'literal', + subtype: 'string', fieldName: 'name', propertyName: 'name', bail: true, @@ -3252,6 +3364,7 @@ test.group('VineObject | clone', () => { }, { type: 'literal', + subtype: 'string', fieldName: 'price', propertyName: 'price', bail: true, @@ -3277,6 +3390,7 @@ test.group('VineObject | clone', () => { properties: [ { type: 'literal', + subtype: 'literal', fieldName: 'is_hiring_guide', propertyName: 'is_hiring_guide', bail: true, @@ -3301,6 +3415,7 @@ test.group('VineObject | clone', () => { properties: [ { type: 'literal', + subtype: 'string', fieldName: 'username', propertyName: 'username', bail: true, @@ -3317,6 +3432,7 @@ test.group('VineObject | clone', () => { }, { type: 'literal', + subtype: 'string', fieldName: 'password', propertyName: 'password', bail: true, @@ -3381,6 +3497,7 @@ test.group('VineObject | clone', () => { properties: [ { type: 'literal', + subtype: 'literal', fieldName: 'is_hiring_guide', propertyName: 'is_hiring_guide', bail: true, @@ -3397,6 +3514,7 @@ test.group('VineObject | clone', () => { }, { type: 'literal', + subtype: 'string', fieldName: 'name', propertyName: 'name', bail: true, @@ -3413,6 +3531,7 @@ test.group('VineObject | clone', () => { }, { type: 'literal', + subtype: 'string', fieldName: 'price', propertyName: 'price', bail: true, @@ -3438,6 +3557,7 @@ test.group('VineObject | clone', () => { properties: [ { type: 'literal', + subtype: 'literal', fieldName: 'is_hiring_guide', propertyName: 'is_hiring_guide', bail: true, @@ -3462,6 +3582,7 @@ test.group('VineObject | clone', () => { properties: [ { type: 'literal', + subtype: 'string', fieldName: 'username', propertyName: 'username', bail: true, @@ -3478,6 +3599,7 @@ test.group('VineObject | clone', () => { }, { type: 'literal', + subtype: 'string', fieldName: 'password', propertyName: 'password', bail: true, @@ -3517,6 +3639,7 @@ test.group('VineObject | clone', () => { properties: [ { type: 'literal', + subtype: 'literal', fieldName: 'is_hiring_guide', propertyName: 'is_hiring_guide', bail: true, @@ -3533,6 +3656,7 @@ test.group('VineObject | clone', () => { }, { type: 'literal', + subtype: 'string', fieldName: 'name', propertyName: 'name', bail: true, @@ -3549,6 +3673,7 @@ test.group('VineObject | clone', () => { }, { type: 'literal', + subtype: 'string', fieldName: 'price', propertyName: 'price', bail: true, @@ -3574,6 +3699,7 @@ test.group('VineObject | clone', () => { properties: [ { type: 'literal', + subtype: 'literal', fieldName: 'is_hiring_guide', propertyName: 'is_hiring_guide', bail: true, @@ -3598,6 +3724,7 @@ test.group('VineObject | clone', () => { properties: [ { type: 'literal', + subtype: 'string', fieldName: 'username', propertyName: 'username', bail: true, @@ -3614,6 +3741,7 @@ test.group('VineObject | clone', () => { }, { type: 'literal', + subtype: 'string', fieldName: 'password', propertyName: 'password', bail: true, @@ -3659,6 +3787,7 @@ test.group('VineObject | clone', () => { properties: [ { type: 'literal', + subtype: 'number', fieldName: 'post_id', propertyName: 'postId', bail: true, @@ -3687,6 +3816,7 @@ test.group('VineObject | clone', () => { properties: [ { type: 'literal', + subtype: 'string', fieldName: 'user_name', propertyName: 'userName', bail: true, @@ -3703,6 +3833,7 @@ test.group('VineObject | clone', () => { }, { type: 'literal', + subtype: 'string', fieldName: 'pass_word', propertyName: 'passWord', bail: true, @@ -3736,6 +3867,7 @@ test.group('VineObject | clone', () => { properties: [ { type: 'literal', + subtype: 'number', fieldName: 'post_id', propertyName: 'postId', bail: true, @@ -3764,6 +3896,7 @@ test.group('VineObject | clone', () => { properties: [ { type: 'literal', + subtype: 'string', fieldName: 'user_name', propertyName: 'userName', bail: true, @@ -3780,6 +3913,7 @@ test.group('VineObject | clone', () => { }, { type: 'literal', + subtype: 'string', fieldName: 'pass_word', propertyName: 'passWord', bail: true, @@ -3824,6 +3958,7 @@ test.group('VineObject | clone', () => { properties: [ { type: 'literal', + subtype: 'string', fieldName: 'username', propertyName: 'username', bail: true, @@ -3855,6 +3990,7 @@ test.group('VineObject | clone', () => { properties: [ { type: 'literal', + subtype: 'string', fieldName: 'username', propertyName: 'username', bail: true, @@ -3897,6 +4033,7 @@ test.group('VineObject | clone', () => { properties: [ { type: 'literal', + subtype: 'string', fieldName: 'username', propertyName: 'username', bail: true, @@ -3928,6 +4065,7 @@ test.group('VineObject | clone', () => { properties: [ { type: 'literal', + subtype: 'string', fieldName: 'username', propertyName: 'username', bail: true, @@ -3970,6 +4108,7 @@ test.group('VineObject | clone', () => { properties: [ { type: 'literal', + subtype: 'string', fieldName: 'username', propertyName: 'username', bail: true, @@ -4001,6 +4140,7 @@ test.group('VineObject | clone', () => { properties: [ { type: 'literal', + subtype: 'string', fieldName: 'username', propertyName: 'username', bail: true, diff --git a/tests/unit/schema/record.spec.ts b/tests/unit/schema/record.spec.ts index a203e39..308540d 100644 --- a/tests/unit/schema/record.spec.ts +++ b/tests/unit/schema/record.spec.ts @@ -53,6 +53,7 @@ test.group('VineRecord', () => { properties: [ { type: 'literal', + subtype: 'string', fieldName: 'username', propertyName: 'username', bail: true, @@ -69,6 +70,7 @@ test.group('VineRecord', () => { }, { type: 'literal', + subtype: 'string', fieldName: 'password', propertyName: 'password', bail: true, @@ -121,6 +123,7 @@ test.group('VineRecord', () => { properties: [ { type: 'literal', + subtype: 'string', fieldName: 'username', propertyName: 'username', bail: true, @@ -137,6 +140,7 @@ test.group('VineRecord', () => { }, { type: 'literal', + subtype: 'string', fieldName: 'password', propertyName: 'password', bail: true, @@ -189,6 +193,7 @@ test.group('VineRecord', () => { properties: [ { type: 'literal', + subtype: 'string', fieldName: 'username', propertyName: 'username', bail: true, @@ -205,6 +210,7 @@ test.group('VineRecord', () => { }, { type: 'literal', + subtype: 'string', fieldName: 'password', propertyName: 'password', bail: true, @@ -257,6 +263,7 @@ test.group('VineRecord', () => { properties: [ { type: 'literal', + subtype: 'string', fieldName: 'username', propertyName: 'username', bail: true, @@ -273,6 +280,7 @@ test.group('VineRecord', () => { }, { type: 'literal', + subtype: 'string', fieldName: 'password', propertyName: 'password', bail: true, @@ -325,6 +333,7 @@ test.group('VineRecord', () => { properties: [ { type: 'literal', + subtype: 'string', fieldName: 'username', propertyName: 'username', bail: true, @@ -341,6 +350,7 @@ test.group('VineRecord', () => { }, { type: 'literal', + subtype: 'string', fieldName: 'password', propertyName: 'password', bail: true, @@ -393,6 +403,7 @@ test.group('VineRecord', () => { properties: [ { type: 'literal', + subtype: 'string', fieldName: 'username', propertyName: 'username', bail: true, @@ -409,6 +420,7 @@ test.group('VineRecord', () => { }, { type: 'literal', + subtype: 'string', fieldName: 'password', propertyName: 'password', bail: true, @@ -474,6 +486,7 @@ test.group('VineRecord | clone', () => { properties: [ { type: 'literal', + subtype: 'string', fieldName: 'username', propertyName: 'username', bail: true, @@ -490,6 +503,7 @@ test.group('VineRecord | clone', () => { }, { type: 'literal', + subtype: 'string', fieldName: 'password', propertyName: 'password', bail: true, @@ -530,6 +544,7 @@ test.group('VineRecord | clone', () => { properties: [ { type: 'literal', + subtype: 'string', fieldName: 'username', propertyName: 'username', bail: true, @@ -546,6 +561,7 @@ test.group('VineRecord | clone', () => { }, { type: 'literal', + subtype: 'string', fieldName: 'password', propertyName: 'password', bail: true, @@ -597,6 +613,7 @@ test.group('VineRecord | clone', () => { properties: [ { type: 'literal', + subtype: 'string', fieldName: 'username', propertyName: 'username', bail: true, @@ -613,6 +630,7 @@ test.group('VineRecord | clone', () => { }, { type: 'literal', + subtype: 'string', fieldName: 'password', propertyName: 'password', bail: true, @@ -653,6 +671,7 @@ test.group('VineRecord | clone', () => { properties: [ { type: 'literal', + subtype: 'string', fieldName: 'username', propertyName: 'username', bail: true, @@ -669,6 +688,7 @@ test.group('VineRecord | clone', () => { }, { type: 'literal', + subtype: 'string', fieldName: 'password', propertyName: 'password', bail: true, @@ -720,6 +740,7 @@ test.group('VineRecord | clone', () => { properties: [ { type: 'literal', + subtype: 'string', fieldName: 'username', propertyName: 'username', bail: true, @@ -736,6 +757,7 @@ test.group('VineRecord | clone', () => { }, { type: 'literal', + subtype: 'string', fieldName: 'password', propertyName: 'password', bail: true, @@ -776,6 +798,7 @@ test.group('VineRecord | clone', () => { properties: [ { type: 'literal', + subtype: 'string', fieldName: 'username', propertyName: 'username', bail: true, @@ -792,6 +815,7 @@ test.group('VineRecord | clone', () => { }, { type: 'literal', + subtype: 'string', fieldName: 'password', propertyName: 'password', bail: true, @@ -844,6 +868,7 @@ test.group('VineRecord | clone', () => { properties: [ { type: 'literal', + subtype: 'string', fieldName: 'username', propertyName: 'username', bail: true, @@ -860,6 +885,7 @@ test.group('VineRecord | clone', () => { }, { type: 'literal', + subtype: 'string', fieldName: 'password', propertyName: 'password', bail: true, @@ -901,6 +927,7 @@ test.group('VineRecord | clone', () => { properties: [ { type: 'literal', + subtype: 'string', fieldName: 'username', propertyName: 'username', bail: true, @@ -917,6 +944,7 @@ test.group('VineRecord | clone', () => { }, { type: 'literal', + subtype: 'string', fieldName: 'password', propertyName: 'password', bail: true, @@ -971,6 +999,7 @@ test.group('VineRecord | clone', () => { properties: [ { type: 'literal', + subtype: 'string', fieldName: 'username', propertyName: 'username', bail: true, @@ -987,6 +1016,7 @@ test.group('VineRecord | clone', () => { }, { type: 'literal', + subtype: 'string', fieldName: 'password', propertyName: 'password', bail: true, @@ -1027,6 +1057,7 @@ test.group('VineRecord | clone', () => { properties: [ { type: 'literal', + subtype: 'string', fieldName: 'username', propertyName: 'username', bail: true, @@ -1043,6 +1074,7 @@ test.group('VineRecord | clone', () => { }, { type: 'literal', + subtype: 'string', fieldName: 'password', propertyName: 'password', bail: true, @@ -1097,6 +1129,7 @@ test.group('VineRecord | clone', () => { properties: [ { type: 'literal', + subtype: 'string', fieldName: 'username', propertyName: 'username', bail: true, @@ -1113,6 +1146,7 @@ test.group('VineRecord | clone', () => { }, { type: 'literal', + subtype: 'string', fieldName: 'password', propertyName: 'password', bail: true, @@ -1153,6 +1187,7 @@ test.group('VineRecord | clone', () => { properties: [ { type: 'literal', + subtype: 'string', fieldName: 'username', propertyName: 'username', bail: true, @@ -1169,6 +1204,7 @@ test.group('VineRecord | clone', () => { }, { type: 'literal', + subtype: 'string', fieldName: 'password', propertyName: 'password', bail: true, @@ -1211,6 +1247,7 @@ test.group('VineRecord | applying rules', () => { parseFnId: undefined, each: { type: 'literal', + subtype: 'string', fieldName: '*', propertyName: '*', bail: true, @@ -1255,6 +1292,7 @@ test.group('VineRecord | applying rules', () => { parseFnId: undefined, each: { type: 'literal', + subtype: 'string', fieldName: '*', propertyName: '*', bail: true, @@ -1299,6 +1337,7 @@ test.group('VineRecord | applying rules', () => { parseFnId: undefined, each: { type: 'literal', + subtype: 'string', fieldName: '*', propertyName: '*', bail: true, @@ -1344,6 +1383,7 @@ test.group('VineRecord | applying rules', () => { parseFnId: undefined, each: { type: 'literal', + subtype: 'string', fieldName: '*', propertyName: '*', bail: true, diff --git a/tests/unit/schema/string.spec.ts b/tests/unit/schema/string.spec.ts index 661f148..55ed4c5 100644 --- a/tests/unit/schema/string.spec.ts +++ b/tests/unit/schema/string.spec.ts @@ -58,6 +58,7 @@ test.group('VineString', () => { const schema = vine.string() assert.deepEqual(schema[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'string', fieldName: '*', propertyName: '*', allowNull: false, @@ -79,6 +80,7 @@ test.group('VineString', () => { assert.deepEqual(schema[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'string', fieldName: '*', propertyName: '*', allowNull: true, @@ -100,6 +102,7 @@ test.group('VineString', () => { assert.deepEqual(schema[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'string', fieldName: '*', propertyName: '*', allowNull: false, @@ -121,6 +124,7 @@ test.group('VineString', () => { assert.deepEqual(schema[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'string', fieldName: '*', propertyName: '*', allowNull: false, @@ -141,6 +145,7 @@ test.group('VineString', () => { const schema = vine.string().transform(() => {}) assert.deepEqual(schema[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'string', fieldName: '*', propertyName: '*', allowNull: false, @@ -177,6 +182,7 @@ test.group('VineString | clone', () => { assert.deepEqual(schema[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'string', fieldName: '*', propertyName: '*', allowNull: false, @@ -193,6 +199,7 @@ test.group('VineString | clone', () => { }) assert.deepEqual(schema1[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'string', fieldName: '*', propertyName: '*', allowNull: false, @@ -215,6 +222,7 @@ test.group('VineString | clone', () => { assert.deepEqual(schema[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'string', fieldName: '*', propertyName: '*', allowNull: false, @@ -231,6 +239,7 @@ test.group('VineString | clone', () => { }) assert.deepEqual(schema1[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'string', fieldName: '*', propertyName: '*', allowNull: true, @@ -253,6 +262,7 @@ test.group('VineString | clone', () => { assert.deepEqual(schema[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'string', fieldName: '*', propertyName: '*', allowNull: false, @@ -269,6 +279,7 @@ test.group('VineString | clone', () => { }) assert.deepEqual(schema1[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'string', fieldName: '*', propertyName: '*', allowNull: false, @@ -291,6 +302,7 @@ test.group('VineString | clone', () => { assert.deepEqual(schema[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'string', fieldName: '*', propertyName: '*', allowNull: false, @@ -307,6 +319,7 @@ test.group('VineString | clone', () => { }) assert.deepEqual(schema1[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'string', fieldName: '*', propertyName: '*', allowNull: false, @@ -329,6 +342,7 @@ test.group('VineString | clone', () => { assert.deepEqual(schema[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'string', fieldName: '*', propertyName: '*', allowNull: false, @@ -346,6 +360,7 @@ test.group('VineString | clone', () => { assert.deepEqual(schema1[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'string', fieldName: '*', propertyName: '*', allowNull: false, @@ -369,6 +384,7 @@ test.group('VineString | clone', () => { assert.deepEqual(schema[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'string', fieldName: '*', propertyName: '*', allowNull: true, @@ -385,6 +401,7 @@ test.group('VineString | clone', () => { }) assert.deepEqual(schema1[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'string', fieldName: '*', propertyName: '*', allowNull: true, @@ -412,6 +429,7 @@ test.group('VineString | clone', () => { assert.deepEqual(schema[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'string', fieldName: '*', propertyName: '*', allowNull: false, @@ -433,6 +451,7 @@ test.group('VineString | clone', () => { }) assert.deepEqual(schema1[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'string', fieldName: '*', propertyName: '*', allowNull: true, @@ -465,6 +484,7 @@ test.group('VineString | clone', () => { assert.deepEqual(schema[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'string', fieldName: '*', propertyName: '*', allowNull: false, @@ -482,6 +502,7 @@ test.group('VineString | clone', () => { }) assert.deepEqual(schema1[PARSE]('*', refsBuilder(), { toCamelCase: false }), { type: 'literal', + subtype: 'string', fieldName: '*', propertyName: '*', allowNull: true, @@ -515,6 +536,7 @@ test.group('VineString | applying rules', () => { assert.deepEqual(schema[PARSE]('*', refs, { toCamelCase: false }), { type: 'literal', + subtype: 'string', fieldName: '*', propertyName: '*', allowNull: false, @@ -724,6 +746,7 @@ test.group('VineString | applying rules', () => { assert.deepEqual(schema[PARSE]('*', refs, { toCamelCase: false }), { type: 'literal', + subtype: 'string', fieldName: '*', propertyName: '*', allowNull: false, diff --git a/tests/unit/schema/tuple.spec.ts b/tests/unit/schema/tuple.spec.ts index 87ac136..84c228c 100644 --- a/tests/unit/schema/tuple.spec.ts +++ b/tests/unit/schema/tuple.spec.ts @@ -51,6 +51,7 @@ test.group('VineTuple', () => { properties: [ { type: 'literal', + subtype: 'string', fieldName: '0', propertyName: '0', bail: true, @@ -86,6 +87,7 @@ test.group('VineTuple', () => { properties: [ { type: 'literal', + subtype: 'string', fieldName: '0', propertyName: '0', bail: true, @@ -121,6 +123,7 @@ test.group('VineTuple', () => { properties: [ { type: 'literal', + subtype: 'string', fieldName: '0', propertyName: '0', bail: true, @@ -137,6 +140,7 @@ test.group('VineTuple', () => { }, { type: 'literal', + subtype: 'number', fieldName: '1', propertyName: '1', bail: true, @@ -172,6 +176,7 @@ test.group('VineTuple', () => { properties: [ { type: 'literal', + subtype: 'string', fieldName: '0', propertyName: '0', bail: true, @@ -207,6 +212,7 @@ test.group('VineTuple', () => { properties: [ { type: 'literal', + subtype: 'string', fieldName: '0', propertyName: '0', bail: true, @@ -242,6 +248,7 @@ test.group('VineTuple', () => { properties: [ { type: 'literal', + subtype: 'string', fieldName: '0', propertyName: '0', bail: true, @@ -277,6 +284,7 @@ test.group('VineTuple', () => { properties: [ { type: 'literal', + subtype: 'string', fieldName: '0', propertyName: '0', bail: true, @@ -357,6 +365,7 @@ test.group('VineTuple | clone', () => { properties: [ { type: 'literal', + subtype: 'string', fieldName: '0', propertyName: '0', bail: true, @@ -387,6 +396,7 @@ test.group('VineTuple | clone', () => { properties: [ { type: 'literal', + subtype: 'string', fieldName: '0', propertyName: '0', bail: true, @@ -423,6 +433,7 @@ test.group('VineTuple | clone', () => { properties: [ { type: 'literal', + subtype: 'string', fieldName: '0', propertyName: '0', bail: true, @@ -453,6 +464,7 @@ test.group('VineTuple | clone', () => { properties: [ { type: 'literal', + subtype: 'string', fieldName: '0', propertyName: '0', bail: true, @@ -489,6 +501,7 @@ test.group('VineTuple | clone', () => { properties: [ { type: 'literal', + subtype: 'string', fieldName: '0', propertyName: '0', bail: true, @@ -505,6 +518,7 @@ test.group('VineTuple | clone', () => { }, { type: 'literal', + subtype: 'number', fieldName: '1', propertyName: '1', bail: true, @@ -534,6 +548,7 @@ test.group('VineTuple | clone', () => { properties: [ { type: 'literal', + subtype: 'string', fieldName: '0', propertyName: '0', bail: true, @@ -550,6 +565,7 @@ test.group('VineTuple | clone', () => { }, { type: 'literal', + subtype: 'number', fieldName: '1', propertyName: '1', bail: true, @@ -586,6 +602,7 @@ test.group('VineTuple | clone', () => { properties: [ { type: 'literal', + subtype: 'string', fieldName: '0', propertyName: '0', bail: true, @@ -616,6 +633,7 @@ test.group('VineTuple | clone', () => { properties: [ { type: 'literal', + subtype: 'string', fieldName: '0', propertyName: '0', bail: true, @@ -652,6 +670,7 @@ test.group('VineTuple | clone', () => { properties: [ { type: 'literal', + subtype: 'string', fieldName: '0', propertyName: '0', bail: true, @@ -682,6 +701,7 @@ test.group('VineTuple | clone', () => { properties: [ { type: 'literal', + subtype: 'string', fieldName: '0', propertyName: '0', bail: true, @@ -718,6 +738,7 @@ test.group('VineTuple | clone', () => { properties: [ { type: 'literal', + subtype: 'string', fieldName: '0', propertyName: '0', bail: true, @@ -748,6 +769,7 @@ test.group('VineTuple | clone', () => { properties: [ { type: 'literal', + subtype: 'string', fieldName: '0', propertyName: '0', bail: true, @@ -784,6 +806,7 @@ test.group('VineTuple | clone', () => { properties: [ { type: 'literal', + subtype: 'string', fieldName: '0', propertyName: '0', bail: true, @@ -814,6 +837,7 @@ test.group('VineTuple | clone', () => { properties: [ { type: 'literal', + subtype: 'string', fieldName: '0', propertyName: '0', bail: true, @@ -850,6 +874,7 @@ test.group('VineTuple | clone', () => { properties: [ { type: 'literal', + subtype: 'string', fieldName: '0', propertyName: '0', bail: true, @@ -880,6 +905,7 @@ test.group('VineTuple | clone', () => { properties: [ { type: 'literal', + subtype: 'string', fieldName: '0', propertyName: '0', bail: true, @@ -916,6 +942,7 @@ test.group('VineTuple | clone', () => { properties: [ { type: 'literal', + subtype: 'string', fieldName: '0', propertyName: '0', bail: true, @@ -946,6 +973,7 @@ test.group('VineTuple | clone', () => { properties: [ { type: 'literal', + subtype: 'string', fieldName: '0', propertyName: '0', bail: true, diff --git a/tests/unit/schema/union.spec.ts b/tests/unit/schema/union.spec.ts index 93597b7..ff45aff 100644 --- a/tests/unit/schema/union.spec.ts +++ b/tests/unit/schema/union.spec.ts @@ -62,6 +62,7 @@ test.group('Vine Union', () => { parseFnId: undefined, propertyName: 'type', type: 'literal', + subtype: 'literal', validations: [ { implicit: false, @@ -78,6 +79,7 @@ test.group('Vine Union', () => { parseFnId: undefined, propertyName: 'account_id', type: 'literal', + subtype: 'string', validations: [ { implicit: false, @@ -111,6 +113,7 @@ test.group('Vine Union', () => { parseFnId: undefined, propertyName: 'type', type: 'literal', + subtype: 'literal', validations: [ { implicit: false, @@ -127,6 +130,7 @@ test.group('Vine Union', () => { parseFnId: undefined, propertyName: 'email', type: 'literal', + subtype: 'string', validations: [ { implicit: false, @@ -160,6 +164,7 @@ test.group('Vine Union', () => { parseFnId: undefined, propertyName: 'type', type: 'literal', + subtype: 'literal', validations: [ { implicit: false, @@ -176,6 +181,7 @@ test.group('Vine Union', () => { parseFnId: undefined, propertyName: 'project_url', type: 'literal', + subtype: 'string', validations: [ { implicit: false, @@ -243,6 +249,7 @@ test.group('Vine Union', () => { parseFnId: undefined, propertyName: 'type', type: 'literal', + subtype: 'literal', validations: [ { implicit: false, @@ -259,6 +266,7 @@ test.group('Vine Union', () => { parseFnId: undefined, propertyName: 'account_id', type: 'literal', + subtype: 'string', validations: [ { implicit: false, @@ -292,6 +300,7 @@ test.group('Vine Union', () => { parseFnId: undefined, propertyName: 'type', type: 'literal', + subtype: 'literal', validations: [ { implicit: false, @@ -308,6 +317,7 @@ test.group('Vine Union', () => { parseFnId: undefined, propertyName: 'email', type: 'literal', + subtype: 'string', validations: [ { implicit: false, @@ -341,6 +351,7 @@ test.group('Vine Union', () => { parseFnId: undefined, propertyName: 'type', type: 'literal', + subtype: 'literal', validations: [ { implicit: false, @@ -357,6 +368,7 @@ test.group('Vine Union', () => { parseFnId: undefined, propertyName: 'project_url', type: 'literal', + subtype: 'string', validations: [ { implicit: false, @@ -429,6 +441,7 @@ test.group('Vine Union', () => { parseFnId: undefined, propertyName: 'type', type: 'literal', + subtype: 'literal', validations: [ { implicit: false, @@ -445,6 +458,7 @@ test.group('Vine Union', () => { parseFnId: undefined, propertyName: 'account_id', type: 'literal', + subtype: 'string', validations: [ { implicit: false, @@ -478,6 +492,7 @@ test.group('Vine Union', () => { parseFnId: undefined, propertyName: 'type', type: 'literal', + subtype: 'literal', validations: [ { implicit: false, @@ -494,6 +509,7 @@ test.group('Vine Union', () => { parseFnId: undefined, propertyName: 'email', type: 'literal', + subtype: 'string', validations: [ { implicit: false, @@ -527,6 +543,7 @@ test.group('Vine Union', () => { parseFnId: undefined, propertyName: 'type', type: 'literal', + subtype: 'literal', validations: [ { implicit: false, @@ -543,6 +560,7 @@ test.group('Vine Union', () => { parseFnId: undefined, propertyName: 'project_url', type: 'literal', + subtype: 'string', validations: [ { implicit: false, @@ -585,6 +603,7 @@ test.group('Vine Union', () => { parseFnId: undefined, propertyName: 'type', type: 'literal', + subtype: 'literal', validations: [ { implicit: false, @@ -601,6 +620,7 @@ test.group('Vine Union', () => { parseFnId: undefined, propertyName: 'account_id', type: 'literal', + subtype: 'string', validations: [ { implicit: false, @@ -634,6 +654,7 @@ test.group('Vine Union', () => { parseFnId: undefined, propertyName: 'type', type: 'literal', + subtype: 'literal', validations: [ { implicit: false, @@ -650,6 +671,7 @@ test.group('Vine Union', () => { parseFnId: undefined, propertyName: 'email', type: 'literal', + subtype: 'string', validations: [ { implicit: false, @@ -683,6 +705,7 @@ test.group('Vine Union', () => { parseFnId: undefined, propertyName: 'type', type: 'literal', + subtype: 'literal', validations: [ { implicit: false, @@ -699,6 +722,7 @@ test.group('Vine Union', () => { parseFnId: undefined, propertyName: 'project_url', type: 'literal', + subtype: 'string', validations: [ { implicit: false, @@ -769,6 +793,7 @@ test.group('Vine Union', () => { parseFnId: undefined, propertyName: 'type', type: 'literal', + subtype: 'literal', validations: [ { implicit: false, @@ -785,6 +810,7 @@ test.group('Vine Union', () => { parseFnId: undefined, propertyName: 'accountId', type: 'literal', + subtype: 'string', validations: [ { implicit: false, @@ -818,6 +844,7 @@ test.group('Vine Union', () => { parseFnId: undefined, propertyName: 'type', type: 'literal', + subtype: 'literal', validations: [ { implicit: false, @@ -834,6 +861,7 @@ test.group('Vine Union', () => { parseFnId: undefined, propertyName: 'email', type: 'literal', + subtype: 'string', validations: [ { implicit: false, @@ -867,6 +895,7 @@ test.group('Vine Union', () => { parseFnId: undefined, propertyName: 'type', type: 'literal', + subtype: 'literal', validations: [ { implicit: false, @@ -883,6 +912,7 @@ test.group('Vine Union', () => { parseFnId: undefined, propertyName: 'projectUrl', type: 'literal', + subtype: 'string', validations: [ { implicit: false, @@ -954,6 +984,7 @@ test.group('Vine Union', () => { parseFnId: undefined, propertyName: 'type', type: 'literal', + subtype: 'literal', validations: [ { implicit: false, @@ -970,6 +1001,7 @@ test.group('Vine Union', () => { parseFnId: undefined, propertyName: 'account_id', type: 'literal', + subtype: 'string', validations: [ { implicit: false, @@ -1003,6 +1035,7 @@ test.group('Vine Union', () => { parseFnId: undefined, propertyName: 'type', type: 'literal', + subtype: 'literal', validations: [ { implicit: false, @@ -1019,6 +1052,7 @@ test.group('Vine Union', () => { parseFnId: undefined, propertyName: 'email', type: 'literal', + subtype: 'string', validations: [ { implicit: false, @@ -1052,6 +1086,7 @@ test.group('Vine Union', () => { parseFnId: undefined, propertyName: 'type', type: 'literal', + subtype: 'literal', validations: [ { implicit: false, @@ -1068,6 +1103,7 @@ test.group('Vine Union', () => { parseFnId: undefined, propertyName: 'project_url', type: 'literal', + subtype: 'string', validations: [ { implicit: false, @@ -1110,6 +1146,7 @@ test.group('Vine Union', () => { parseFnId: undefined, propertyName: 'type', type: 'literal', + subtype: 'literal', validations: [ { implicit: false, @@ -1126,6 +1163,7 @@ test.group('Vine Union', () => { parseFnId: undefined, propertyName: 'account_id', type: 'literal', + subtype: 'string', validations: [ { implicit: false, @@ -1159,6 +1197,7 @@ test.group('Vine Union', () => { parseFnId: undefined, propertyName: 'type', type: 'literal', + subtype: 'literal', validations: [ { implicit: false, @@ -1175,6 +1214,7 @@ test.group('Vine Union', () => { parseFnId: undefined, propertyName: 'email', type: 'literal', + subtype: 'string', validations: [ { implicit: false, @@ -1208,6 +1248,7 @@ test.group('Vine Union', () => { parseFnId: undefined, propertyName: 'type', type: 'literal', + subtype: 'literal', validations: [ { implicit: false, @@ -1224,6 +1265,7 @@ test.group('Vine Union', () => { parseFnId: undefined, propertyName: 'project_url', type: 'literal', + subtype: 'string', validations: [ { implicit: false, diff --git a/tests/unit/schema/union_of_types.spec.ts b/tests/unit/schema/union_of_types.spec.ts index 4da59e1..b07efbe 100644 --- a/tests/unit/schema/union_of_types.spec.ts +++ b/tests/unit/schema/union_of_types.spec.ts @@ -34,6 +34,7 @@ test.group('Vine UnionOfTypes', () => { parseFnId: undefined, propertyName: '*', type: 'literal', + subtype: 'boolean', validations: [ { implicit: false, @@ -53,6 +54,7 @@ test.group('Vine UnionOfTypes', () => { parseFnId: undefined, propertyName: '*', type: 'literal', + subtype: 'string', validations: [ { implicit: false, @@ -86,6 +88,7 @@ test.group('Vine UnionOfTypes', () => { parseFnId: undefined, propertyName: '*', type: 'literal', + subtype: 'boolean', validations: [ { implicit: false, @@ -105,6 +108,7 @@ test.group('Vine UnionOfTypes', () => { parseFnId: undefined, propertyName: '*', type: 'literal', + subtype: 'string', validations: [ { implicit: false, @@ -132,6 +136,7 @@ test.group('Vine UnionOfTypes', () => { parseFnId: undefined, propertyName: '*', type: 'literal', + subtype: 'boolean', validations: [ { implicit: false, @@ -151,6 +156,7 @@ test.group('Vine UnionOfTypes', () => { parseFnId: undefined, propertyName: '*', type: 'literal', + subtype: 'string', validations: [ { implicit: false, @@ -183,6 +189,7 @@ test.group('Vine UnionOfTypes', () => { parseFnId: undefined, propertyName: 'healthCheck', type: 'literal', + subtype: 'boolean', validations: [ { implicit: false, @@ -202,6 +209,7 @@ test.group('Vine UnionOfTypes', () => { parseFnId: undefined, propertyName: 'healthCheck', type: 'literal', + subtype: 'string', validations: [ { implicit: false, @@ -235,6 +243,7 @@ test.group('Vine UnionOfTypes', () => { parseFnId: undefined, propertyName: '*', type: 'literal', + subtype: 'boolean', validations: [ { implicit: false, @@ -254,6 +263,7 @@ test.group('Vine UnionOfTypes', () => { parseFnId: undefined, propertyName: '*', type: 'literal', + subtype: 'string', validations: [ { implicit: false, @@ -281,6 +291,7 @@ test.group('Vine UnionOfTypes', () => { parseFnId: undefined, propertyName: '*', type: 'literal', + subtype: 'boolean', validations: [ { implicit: false, @@ -300,6 +311,7 @@ test.group('Vine UnionOfTypes', () => { parseFnId: undefined, propertyName: '*', type: 'literal', + subtype: 'string', validations: [ { implicit: false,