Component evidence
A collection of general-purpose helper functions for data validation, tree manipulation, and object inspection. Use for standardizing data handling across the application.
// Source: https://github.com/nocobase/nocobase | License: Apache-2.0
// Provided via justclaw.it.com; keep this notice with the code.
/**
* This file is part of the NocoBase (R) project.
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
* Authors: NocoBase Team.
*
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
* For more information, please refer to: https://www.nocobase.com/agreement.
*/
import _ from 'lodash';
import flat from 'flat';
export const isString = (value: any): value is string => {
return typeof value === 'string';
};
export const isArray = (value: any): value is Array<any> => {
return Array.isArray(value);
};
export const isEmpty = (value: unknown) => {
if (isPlainObject(value)) {
return Object.keys(value).length === 0;
}
... (truncated -- full source via MCP)