Fix missing functions (#9993)

* Fix missing functions

Signed-off-by: Denis Bykhov <bykhov.denis@gmail.com>

* Fix formatting

Signed-off-by: Denis Bykhov <bykhov.denis@gmail.com>

---------

Signed-off-by: Denis Bykhov <bykhov.denis@gmail.com>
This commit is contained in:
Denis Bykhov
2025-10-02 09:39:44 +07:00
committed by GitHub
parent e5b7f9cc1d
commit 5f3911d5c7
2 changed files with 20 additions and 2 deletions
@@ -50,6 +50,9 @@ export async function Insert (
control: ProcessControl,
execution: Execution
): Promise<Doc[]> {
if (value == null) {
value = []
}
if (!Array.isArray(value)) return value
if (props.value == null) return value
const context = parseContext(props.value)
@@ -68,6 +71,9 @@ export async function Remove (
control: ProcessControl,
execution: Execution
): Promise<Doc[]> {
if (value == null) {
value = []
}
if (!Array.isArray(value)) return value
if (props.value == null) return value
const context = parseContext(props.value)
@@ -80,11 +86,17 @@ export async function Remove (
}
export function RemoveFirst (value: Doc[], props: Record<string, any>): Doc[] {
if (value == null) {
value = []
}
if (!Array.isArray(value)) return value
return value.slice(1)
}
export function RemoveLast (value: Doc[], props: Record<string, any>): Doc[] {
if (value == null) {
value = []
}
if (!Array.isArray(value)) return value
return value.slice(0, -1)
}