lucid-extension-sdk
Advanced tools
Comparing version 0.0.248 to 0.0.249
@@ -93,2 +93,3 @@ import { isNumber, isString } from '../checks'; | ||
export declare function recordValidator<K extends string, V>(keyList: K[], valueValidator: Validator<V>): (x: unknown) => x is Record<K, V>; | ||
export declare function typedRecordValidator<K extends string | number | symbol, V>(keyValidator: Validator<K>, valueValidator: Validator<V>): (x: unknown) => x is Record<K, V>; | ||
export declare function objectOfValidator<T>(subValidator: Validator<T>): (x: unknown) => x is Record<any, T>; | ||
@@ -95,0 +96,0 @@ /** |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.asAssertion = exports.validatorWithMessage = exports.minLengthValidator = exports.maxLengthValidator = exports.isDate = exports.isPositiveNumber = exports.isSize = exports.isPanelSize = exports.isBoundingBox = exports.isPointLike = exports.isOpacity = exports.isTrue = exports.isFlag = exports.isRestrictions = exports.isStringOrNegativeOne = exports.isBooleanOrEmptyString = exports.isNumberOrEmptyString = exports.isSet = exports.propertyValidator = exports.exclude = exports.both = exports.either = exports.isNullOption = exports.nullableOption = exports.option = exports.nullable = exports.objectOfValidator = exports.recordValidator = exports.strictObjectValidator = exports.partialObjectValidator = exports.objectValidator = exports.mapValidator = exports.someValidator = exports.someValue = exports.tupleValidator = exports.arrayValidator = exports.rangeValidator = exports.enumValidator = exports.stringEnumValidator = void 0; | ||
exports.asAssertion = exports.validatorWithMessage = exports.minLengthValidator = exports.maxLengthValidator = exports.isDate = exports.isPositiveNumber = exports.isSize = exports.isPanelSize = exports.isBoundingBox = exports.isPointLike = exports.isOpacity = exports.isTrue = exports.isFlag = exports.isRestrictions = exports.isStringOrNegativeOne = exports.isBooleanOrEmptyString = exports.isNumberOrEmptyString = exports.isSet = exports.propertyValidator = exports.exclude = exports.both = exports.either = exports.isNullOption = exports.nullableOption = exports.option = exports.nullable = exports.objectOfValidator = exports.typedRecordValidator = exports.recordValidator = exports.strictObjectValidator = exports.partialObjectValidator = exports.objectValidator = exports.mapValidator = exports.someValidator = exports.someValue = exports.tupleValidator = exports.arrayValidator = exports.rangeValidator = exports.enumValidator = exports.stringEnumValidator = void 0; | ||
const checks_1 = require("../checks"); | ||
@@ -195,2 +195,11 @@ const object_1 = require("../object"); | ||
exports.recordValidator = recordValidator; | ||
function typedRecordValidator(keyValidator, valueValidator) { | ||
return (x) => { | ||
if ((0, checks_1.isArray)(x) || !(0, checks_1.isObject)(x)) { | ||
return false; | ||
} | ||
return Object.keys(x).every((key) => keyValidator(key)) && Object.values(x).every((val) => valueValidator(val)); | ||
}; | ||
} | ||
exports.typedRecordValidator = typedRecordValidator; | ||
function objectOfValidator(subValidator) { | ||
@@ -197,0 +206,0 @@ return (x) => { |
{ | ||
"name": "lucid-extension-sdk", | ||
"version": "0.0.248", | ||
"version": "0.0.249", | ||
"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
747590
17358