lucid-extension-sdk
Advanced tools
Comparing version 0.0.256 to 0.0.257
@@ -13,3 +13,4 @@ import { isString } from '../../checks'; | ||
NO_WHITESPACE = "noWhitespace", | ||
UNIQUE_EDIT = "uniqueEditType" | ||
UNIQUE_EDIT = "uniqueEditType", | ||
MAX_LENGTH = "maxLength" | ||
} | ||
@@ -16,0 +17,0 @@ export declare const isFieldConstraintType: (x: unknown) => x is FieldConstraintType; |
@@ -19,2 +19,3 @@ "use strict"; | ||
FieldConstraintType["UNIQUE_EDIT"] = "uniqueEditType"; | ||
FieldConstraintType["MAX_LENGTH"] = "maxLength"; | ||
})(FieldConstraintType || (exports.FieldConstraintType = FieldConstraintType = {})); | ||
@@ -21,0 +22,0 @@ exports.isFieldConstraintType = (0, validators_1.enumValidator)(FieldConstraintType); |
@@ -35,4 +35,8 @@ import { isNumber, isUndefined } from '../core/checks'; | ||
} | ||
export type FieldConstraintDefinition = RequiredFieldConstraintDefinition | LockedFieldConstraintDefinition | MinValueFieldConstraintDefinition | MaxValueFieldConstraintDefinition | SingleLineFieldConstraintDefinition | NoWhitespaceFieldConstraintDefinition | UniqueEditFieldConstraintDefinition; | ||
export declare function minMaxFieldConstraintValidator(val: unknown): val is FieldConstraintType.MIN_VALUE | FieldConstraintType.MAX_VALUE; | ||
export interface MaxLengthConstraintDefinition { | ||
type: FieldConstraintType.MAX_LENGTH; | ||
value: number; | ||
} | ||
export type FieldConstraintDefinition = RequiredFieldConstraintDefinition | LockedFieldConstraintDefinition | MinValueFieldConstraintDefinition | MaxValueFieldConstraintDefinition | SingleLineFieldConstraintDefinition | NoWhitespaceFieldConstraintDefinition | UniqueEditFieldConstraintDefinition | MaxLengthConstraintDefinition; | ||
export declare function minMaxFieldConstraintValidator(val: unknown): val is FieldConstraintType.MIN_VALUE | FieldConstraintType.MAX_VALUE | FieldConstraintType.MAX_LENGTH; | ||
export declare const isFieldConstraintDefinition: (x: unknown) => x is { | ||
@@ -39,0 +43,0 @@ type?: FieldConstraintType | undefined; |
@@ -9,3 +9,5 @@ "use strict"; | ||
function minMaxFieldConstraintValidator(val) { | ||
return val === serializedfielddefinition_1.FieldConstraintType.MIN_VALUE || val === serializedfielddefinition_1.FieldConstraintType.MAX_VALUE; | ||
return (val === serializedfielddefinition_1.FieldConstraintType.MIN_VALUE || | ||
val === serializedfielddefinition_1.FieldConstraintType.MAX_VALUE || | ||
val === serializedfielddefinition_1.FieldConstraintType.MAX_LENGTH); | ||
} | ||
@@ -58,2 +60,3 @@ exports.minMaxFieldConstraintValidator = minMaxFieldConstraintValidator; | ||
case serializedfielddefinition_1.FieldConstraintType.MAX_VALUE: | ||
case serializedfielddefinition_1.FieldConstraintType.MAX_LENGTH: | ||
if (!(0, checks_1.isNumber)(constraint['Details'])) { | ||
@@ -60,0 +63,0 @@ throw new Error('Invalid constraint format'); |
{ | ||
"name": "lucid-extension-sdk", | ||
"version": "0.0.256", | ||
"version": "0.0.257", | ||
"description": "Utility classes for writing Lucid Software editor extensions", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
750030
17427