mirror of
https://github.com/OliveTin/OliveTin
synced 2025-12-19 04:25:32 +00:00
fix: #672 Empty execution tracking ID in InternalLogEntry (backport to release/2k)
This commit is contained in:
29
frontend/node_modules/stylelint/lib/utils/validateObjectWithArrayProps.mjs
generated
vendored
Normal file
29
frontend/node_modules/stylelint/lib/utils/validateObjectWithArrayProps.mjs
generated
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
import { isPlainObject } from './validateTypes.mjs';
|
||||
|
||||
/**
|
||||
* Check whether the variable is an object and all its properties are one or more values
|
||||
* that satisfy the specified validator(s):
|
||||
*
|
||||
* @example
|
||||
* ignoreProperties = {
|
||||
* value1: ["item11", "item12", "item13"],
|
||||
* value2: "item2",
|
||||
* };
|
||||
* validateObjectWithArrayProps(isString)(ignoreProperties);
|
||||
* //=> true
|
||||
*
|
||||
* @typedef {(value: unknown) => boolean} Validator
|
||||
* @param {...Validator} validators
|
||||
* @returns {Validator}
|
||||
*/
|
||||
export default function validateObjectWithArrayProps(...validators) {
|
||||
return (value) => {
|
||||
if (!isPlainObject(value)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return Object.values(value)
|
||||
.flat()
|
||||
.every((item) => validators.some((v) => v(item)));
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user