mirror of
https://github.com/hcengineering/platform.git
synced 2026-09-10 03:37:43 +02:00
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:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user