mirror of
https://github.com/hcengineering/platform.git
synced 2026-09-11 04:07: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:
@@ -75,7 +75,10 @@ import {
|
||||
Split,
|
||||
Subtract,
|
||||
Trim,
|
||||
UpperCase
|
||||
UpperCase,
|
||||
EmptyArray,
|
||||
ExecutionInitiator,
|
||||
ExecutionStarted
|
||||
} from './transform'
|
||||
import {
|
||||
RunSubProcess,
|
||||
@@ -428,7 +431,10 @@ export default async () => ({
|
||||
Insert,
|
||||
Remove,
|
||||
RemoveFirst,
|
||||
RemoveLast
|
||||
RemoveLast,
|
||||
EmptyArray,
|
||||
ExecutionInitiator,
|
||||
ExecutionStarted
|
||||
},
|
||||
rollbacks: {
|
||||
ToDoCloseRollback,
|
||||
|
||||
@@ -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