lucid-extension-sdk 0.0.352 → 0.0.354
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -16,7 +16,7 @@ function deserializeShadow(shadow) {
|
|
|
16
16
|
return {
|
|
17
17
|
distance: Math.sqrt(shadow['x'] * shadow['x'] + shadow['y'] * shadow['y']),
|
|
18
18
|
angle: (_a = shadow['ang']) !== null && _a !== void 0 ? _a : Math.atan2(shadow['y'], shadow['x']),
|
|
19
|
-
blur: shadow['b'],
|
|
19
|
+
blur: Math.max(shadow['b'], 0),
|
|
20
20
|
color: shadow['c'],
|
|
21
21
|
};
|
|
22
22
|
}
|
|
@@ -111,6 +111,13 @@ export declare function objectOfValidator<T>(subValidator: Validator<T>): (x: un
|
|
|
111
111
|
* @return A validator for the array type
|
|
112
112
|
*/
|
|
113
113
|
export declare function nullable<T>(subValidator: (p1: unknown) => p1 is T): (x: unknown) => x is T | null;
|
|
114
|
+
/**
|
|
115
|
+
* Create a validator which allows the target to be either null or satisfy the
|
|
116
|
+
* sub-validator.
|
|
117
|
+
*
|
|
118
|
+
* @return A validator for the array type
|
|
119
|
+
*/
|
|
120
|
+
export declare function nullableValidatorWithInvalidElementTracking<T>(subValidator: (p1: unknown, invalidElements?: Map<number, unknown[]>, level?: number) => p1 is T): (subject: unknown, invalidElements?: Map<number, unknown[]>, level?: number) => subject is T | null;
|
|
114
121
|
/**
|
|
115
122
|
* Create a validator which allows the target to be undefined or satisfy the
|
|
116
123
|
* sub-validator.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.asAssertion = exports.validatorWithMessage = exports.minLengthValidator = exports.maxLengthValidator = exports.isDate = exports.isPositiveNumber = exports.isSize = exports.isPanelSize = exports.isBoundingBox = exports.isPointLike = exports.isOpacity = exports.isFalse = 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.objectValidatorWithInvalidFieldTracking = exports.objectValidator = exports.mapValidator = exports.someValidator = exports.someValue = exports.tupleValidator = exports.arrayValidatorWithInvalidElementTracking = exports.arrayValidator = exports.rangeValidator = exports.enumValidator = exports.stringEnumValidator = void 0;
|
|
3
|
+
exports.asAssertion = exports.validatorWithMessage = exports.minLengthValidator = exports.maxLengthValidator = exports.isDate = exports.isPositiveNumber = exports.isSize = exports.isPanelSize = exports.isBoundingBox = exports.isPointLike = exports.isOpacity = exports.isFalse = 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.nullableValidatorWithInvalidElementTracking = exports.nullable = exports.objectOfValidator = exports.typedRecordValidator = exports.recordValidator = exports.strictObjectValidator = exports.partialObjectValidator = exports.objectValidatorWithInvalidFieldTracking = exports.objectValidator = exports.mapValidator = exports.someValidator = exports.someValue = exports.tupleValidator = exports.arrayValidatorWithInvalidElementTracking = exports.arrayValidator = exports.rangeValidator = exports.enumValidator = exports.stringEnumValidator = void 0;
|
|
4
4
|
const checks_1 = require("../checks");
|
|
5
5
|
/*********************************************************************************
|
|
6
6
|
* Validator generators: These functions construct new composite validators
|
|
@@ -269,6 +269,18 @@ function nullable(subValidator) {
|
|
|
269
269
|
};
|
|
270
270
|
}
|
|
271
271
|
exports.nullable = nullable;
|
|
272
|
+
/**
|
|
273
|
+
* Create a validator which allows the target to be either null or satisfy the
|
|
274
|
+
* sub-validator.
|
|
275
|
+
*
|
|
276
|
+
* @return A validator for the array type
|
|
277
|
+
*/
|
|
278
|
+
function nullableValidatorWithInvalidElementTracking(subValidator) {
|
|
279
|
+
return (subject, invalidElements, level = 0) => {
|
|
280
|
+
return subject === null || subValidator(subject, invalidElements, level);
|
|
281
|
+
};
|
|
282
|
+
}
|
|
283
|
+
exports.nullableValidatorWithInvalidElementTracking = nullableValidatorWithInvalidElementTracking;
|
|
272
284
|
/**
|
|
273
285
|
* Create a validator which allows the target to be undefined or satisfy the
|
|
274
286
|
* sub-validator.
|