mirror of
https://github.com/n8n-io/n8n.git
synced 2026-06-04 10:39:23 +02:00
✨ Add isNotEmpty for objects
This commit is contained in:
parent
4ddf260afd
commit
8264fcb795
|
|
@ -21,6 +21,10 @@ function isEmpty(value: object): boolean {
|
|||
return Object.keys(value).length === 0;
|
||||
}
|
||||
|
||||
function isNotEmpty(value: object): boolean {
|
||||
return !isEmpty(value);
|
||||
}
|
||||
|
||||
function hasField(value: object, extraArgs: string[]): boolean {
|
||||
const [name] = extraArgs;
|
||||
return name in value;
|
||||
|
|
@ -93,6 +97,7 @@ export const objectExtensions: ExtensionMap = {
|
|||
typeName: 'Object',
|
||||
functions: {
|
||||
isEmpty,
|
||||
isNotEmpty,
|
||||
merge,
|
||||
hasField,
|
||||
removeField,
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user