mirror of
				https://github.com/strapi/strapi.git
				synced 2025-11-04 03:43:34 +00:00 
			
		
		
		
	Check kebab case only if value is defined
This commit is contained in:
		
							parent
							
								
									e69479f68d
								
							
						
					
					
						commit
						c574622447
					
				@ -33,7 +33,7 @@ yup.addMethod(
 | 
			
		||||
  'isCamelCase',
 | 
			
		||||
  function isCamelCase(message = '${path} is not in camel case (anExampleOfCamelCase)') {
 | 
			
		||||
    return this.test('is in camelCase', message, (value) =>
 | 
			
		||||
      value ? utils.isCamelCase(value) : false
 | 
			
		||||
      value ? utils.isCamelCase(value) : true
 | 
			
		||||
    );
 | 
			
		||||
  }
 | 
			
		||||
);
 | 
			
		||||
@ -43,7 +43,7 @@ yup.addMethod(
 | 
			
		||||
  'isKebabCase',
 | 
			
		||||
  function isKebabCase(message = '${path} is not in kebab case (an-example-of-kebab-case)') {
 | 
			
		||||
    return this.test('is in kebab-case', message, (value) =>
 | 
			
		||||
      value ? utils.isKebabCase(value) : false
 | 
			
		||||
      value ? utils.isKebabCase(value) : true
 | 
			
		||||
    );
 | 
			
		||||
  }
 | 
			
		||||
);
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user