@activepieces/pieces-framework
Advanced tools
Comparing version 0.6.13 to 0.6.14
{ | ||
"name": "@activepieces/pieces-framework", | ||
"version": "0.6.13", | ||
"version": "0.6.14", | ||
"type": "commonjs", | ||
@@ -5,0 +5,0 @@ "dependencies": { |
@@ -6,7 +6,7 @@ import { ErrorMessages } from './errors'; | ||
static pattern(regex: string | RegExp): TypedValidatorFn<ValidationInputType.STRING>; | ||
static maxLength(max: number, includeBounds?: boolean): TypedValidatorFn<ValidationInputType.STRING>; | ||
static minLength(min: number, includeBounds?: boolean): TypedValidatorFn<ValidationInputType.STRING>; | ||
static minValue(min: number, includeBounds?: boolean): TypedValidatorFn<ValidationInputType.NUMBER>; | ||
static maxValue(max: number, includeBounds?: boolean): TypedValidatorFn<ValidationInputType.NUMBER>; | ||
static inRange(min: number, max: number, includeBounds?: boolean): TypedValidatorFn<ValidationInputType.NUMBER>; | ||
static maxLength(max: number): TypedValidatorFn<ValidationInputType.STRING>; | ||
static minLength(min: number): TypedValidatorFn<ValidationInputType.STRING>; | ||
static minValue(min: number): TypedValidatorFn<ValidationInputType.NUMBER>; | ||
static maxValue(max: number): TypedValidatorFn<ValidationInputType.NUMBER>; | ||
static inRange(min: number, max: number): TypedValidatorFn<ValidationInputType.NUMBER>; | ||
static number: TypedValidatorFn<ValidationInputType.NUMBER>; | ||
@@ -13,0 +13,0 @@ static image: TypedValidatorFn<ValidationInputType.FILE>; |
@@ -27,3 +27,3 @@ "use strict"; | ||
; | ||
static maxLength(max, includeBounds = true) { | ||
static maxLength(max) { | ||
return { | ||
@@ -34,3 +34,3 @@ type: types_1.ValidationInputType.STRING, | ||
return null; | ||
const isValid = includeBounds ? processedValue.length < max : processedValue.length <= max; | ||
const isValid = processedValue.length <= max; | ||
if (!isValid) { | ||
@@ -44,3 +44,3 @@ return (0, utils_1.formatErrorMessage)(errors_1.ErrorMessages.MAX_LENGTH, { userInput, length: max.toString() }); | ||
; | ||
static minLength(min, includeBounds = true) { | ||
static minLength(min) { | ||
return { | ||
@@ -51,3 +51,3 @@ type: types_1.ValidationInputType.STRING, | ||
return null; | ||
const isValid = includeBounds ? processedValue.length > min : processedValue.length >= min; | ||
const isValid = processedValue.length >= min; | ||
if (!isValid) { | ||
@@ -61,7 +61,7 @@ return (0, utils_1.formatErrorMessage)(errors_1.ErrorMessages.MIN_LENGTH, { userInput, length: min.toString() }); | ||
; | ||
static minValue(min, includeBounds = true) { | ||
static minValue(min) { | ||
return { | ||
type: types_1.ValidationInputType.NUMBER, | ||
fn: (property, processedValue, userInput) => { | ||
const isValid = includeBounds ? Number(processedValue) > min : Number(processedValue) >= min; | ||
const isValid = Number(processedValue) >= min; | ||
if (isValid) | ||
@@ -74,7 +74,7 @@ return null; | ||
; | ||
static maxValue(max, includeBounds = true) { | ||
static maxValue(max) { | ||
return { | ||
type: types_1.ValidationInputType.NUMBER, | ||
fn: (property, processedValue, userInput) => { | ||
const isValid = includeBounds ? Number(processedValue) < max : Number(processedValue) <= max; | ||
const isValid = Number(processedValue) <= max; | ||
if (isValid) | ||
@@ -87,3 +87,3 @@ return null; | ||
; | ||
static inRange(min, max, includeBounds = true) { | ||
static inRange(min, max) { | ||
return { | ||
@@ -93,4 +93,4 @@ type: types_1.ValidationInputType.NUMBER, | ||
const numericValue = Number(processedValue); | ||
const isValid = (includeBounds ? numericValue <= max : numericValue < max) && | ||
(includeBounds ? numericValue >= min : numericValue > min); | ||
const isValid = (numericValue <= max) && | ||
(numericValue >= min); | ||
if (isValid) | ||
@@ -97,0 +97,0 @@ return null; |
Sorry, the diff of this file is not supported yet
77534