lucid-extension-sdk 0.0.371 → 0.0.372
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.
- package/core/checks.d.ts +7 -0
- package/core/checks.js +11 -1
- package/package.json +1 -1
package/core/checks.d.ts
CHANGED
|
@@ -117,6 +117,13 @@ export declare function isArray(val: unknown): val is unknown[];
|
|
|
117
117
|
* @return Whether variable is an array of the given type.
|
|
118
118
|
*/
|
|
119
119
|
export declare function isTypedArray<T>(typeGuard: (a: unknown) => a is T): (val: unknown) => val is T[];
|
|
120
|
+
/**
|
|
121
|
+
* Returns true if the specified value is an array and every element is defined and not null.
|
|
122
|
+
*
|
|
123
|
+
* @param val Variable to test.
|
|
124
|
+
* @returns Whether variable is an array of defined and not null elements.
|
|
125
|
+
*/
|
|
126
|
+
export declare function isDefinedArray<T>(val: (T | undefined | null)[]): val is T[];
|
|
120
127
|
/**
|
|
121
128
|
* Returns true if the specified value is a map.
|
|
122
129
|
*
|
package/core/checks.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isInstanceOf = exports.isLiteral = exports.isPromise = exports.isUnknown = exports.isAny = exports.isEmptyOrNullishObject = exports.isPair = exports.isAtLeastLength = exports.isExactLength = exports.isMap = exports.isTypedArray = exports.isArray = exports.isRecord = exports.isObjectUnsafer = exports.isObjectUnsafe = exports.isObject = exports.isFunction = exports.isInfinite = exports.isInt = exports.isNumber = exports.isBoolean = exports.isString = exports.isNullish = exports.isDefAndNotNull = exports.isVoid = exports.isUndefined = exports.isNull = exports.isDef = void 0;
|
|
3
|
+
exports.isInstanceOf = exports.isLiteral = exports.isPromise = exports.isUnknown = exports.isAny = exports.isEmptyOrNullishObject = exports.isPair = exports.isAtLeastLength = exports.isExactLength = exports.isMap = exports.isDefinedArray = exports.isTypedArray = exports.isArray = exports.isRecord = exports.isObjectUnsafer = exports.isObjectUnsafe = exports.isObject = exports.isFunction = exports.isInfinite = exports.isInt = exports.isNumber = exports.isBoolean = exports.isString = exports.isNullish = exports.isDefAndNotNull = exports.isVoid = exports.isUndefined = exports.isNull = exports.isDef = void 0;
|
|
4
4
|
/**
|
|
5
5
|
* Returns true if the specified value is not undefined.
|
|
6
6
|
*
|
|
@@ -177,6 +177,16 @@ function isTypedArray(typeGuard) {
|
|
|
177
177
|
};
|
|
178
178
|
}
|
|
179
179
|
exports.isTypedArray = isTypedArray;
|
|
180
|
+
/**
|
|
181
|
+
* Returns true if the specified value is an array and every element is defined and not null.
|
|
182
|
+
*
|
|
183
|
+
* @param val Variable to test.
|
|
184
|
+
* @returns Whether variable is an array of defined and not null elements.
|
|
185
|
+
*/
|
|
186
|
+
function isDefinedArray(val) {
|
|
187
|
+
return isArray(val) && val.every(isDefAndNotNull);
|
|
188
|
+
}
|
|
189
|
+
exports.isDefinedArray = isDefinedArray;
|
|
180
190
|
/**
|
|
181
191
|
* Returns true if the specified value is a map.
|
|
182
192
|
*
|