Skip to content

Array Operations

List manipulation — chunk, flatten, group, map, reduce, zip, and more.

12 modules

ModuleDescription
Dzielenie tablicyPodziel tablice na czesci o okreslonej wielkosci
KompaktujUsuń wartości null/puste z tablicy
Roznica tablicZnajdz elementy w pierwszej tablicy, ktorych nie ma w innych
UsuńUsuń pierwsze N elementów z tablicy
Splaszczanie tablicySplaszcz zagniezdzene tablice do pojedynczej tablicy
Grupuj WedługGrupuj elementy tablicy według klucza
Przeciecie tablicZnajdz wspolne elementy miedzy tablicami
Laczenie tablicyPolacz elementy tablicy w lancuch znakow
Mapowanie tablicyPrzeksztalc kazdy element w tablicy
Redukcja tablicyZredukuj tablice do pojedynczej wartosci
WeźWeź pierwsze N elementów z tablicy
Połącz TablicePołącz wiele tablic element po elemencie

Modules

Dzielenie tablicy

array.chunk

Podziel tablice na czesci o okreslonej wielkosci

Parameters:

NameTypeRequiredDefaultDescription
arrayarrayYes-Array of items to process. Can be numbers, strings, or objects.
sizenumberYes10Number of items per chunk

Output:

FieldTypeDescription
resultarrayTablica czesci
chunksnumberTablica czesci

Example: Chunk into groups of 3

yaml
array: [1, 2, 3, 4, 5, 6, 7, 8, 9]
size: 3

Example: Batch process items

yaml
array: ["a", "b", "c", "d", "e"]
size: 2

Kompaktuj

array.compact

Usuń wartości null/puste z tablicy

Parameters:

NameTypeRequiredDefaultDescription
arrayarrayYes-Tablica do skompaktowania
remove_empty_stringsbooleanNoTrueUsuń puste ciągi
remove_zerobooleanNoFalseUsuń puste ciągi
remove_falsebooleanNoFalseUsuń wartości zero

Output:

FieldTypeDescription
resultarrayUsuń wartości fałszywe
removednumberSkompaktowana tablica

Roznica tablic

array.difference

Znajdz elementy w pierwszej tablicy, ktorych nie ma w innych

Parameters:

NameTypeRequiredDefaultDescription
arrayarrayYes-Array of items to process. Can be numbers, strings, or objects.
subtractarrayYes-Arrays containing items to remove from the base array

Output:

FieldTypeDescription
resultarrayElementy unikalne dla pierwszej tablicy
lengthnumberElementy unikalne dla pierwszej tablicy

Example: Find unique elements

yaml
array: [1, 2, 3, 4, 5]
subtract: [[2, 4], [5]]

Usuń

array.drop

Usuń pierwsze N elementów z tablicy

Parameters:

NameTypeRequiredDefaultDescription
arrayarrayYes-Tablica źródłowa
countnumberYes1Tablica źródłowa

Output:

FieldTypeDescription
resultarrayLiczba elementów do usunięcia
droppednumberPozostałe elementy

Splaszczanie tablicy

array.flatten

Splaszcz zagniezdzene tablice do pojedynczej tablicy

Parameters:

NameTypeRequiredDefaultDescription
arrayarrayYes-Array of items to process. Can be numbers, strings, or objects.
depthnumberNo1How many levels of nesting to flatten (-1 for infinite)

Output:

FieldTypeDescription
resultarraySplaszczona tablica
lengthnumberSplaszczona tablica

Example: Flatten one level

yaml
array: [[1, 2], [3, 4], [5, 6]]
depth: 1

Example: Flatten all levels

yaml
array: [[1, [2, [3, [4]]]]]
depth: -1

Grupuj Według

array.group_by

Grupuj elementy tablicy według klucza

Parameters:

NameTypeRequiredDefaultDescription
arrayarrayYes-Tablica obiektów do grupowania
keystringYes-Tablica obiektów do grupowania

Output:

FieldTypeDescription
groupsobjectNazwa właściwości do grupowania
keysarrayWyniki grupowania
countnumberWyniki grupowania

Przeciecie tablic

array.intersection

Znajdz wspolne elementy miedzy tablicami

Parameters:

NameTypeRequiredDefaultDescription
arraysarrayYes-Array of arrays to process (for intersection, union)

Output:

FieldTypeDescription
resultarrayWspolne elementy
lengthnumberWspolne elementy

Example: Find common elements

yaml
arrays: [[1, 2, 3, 4], [2, 3, 5], [2, 3, 6]]

Laczenie tablicy

array.join

Polacz elementy tablicy w lancuch znakow

Parameters:

NameTypeRequiredDefaultDescription
arrayarrayYes-Array of items to process. Can be numbers, strings, or objects.
separatorselect (, , ,, , `
, , - `, ``)No,String to insert between items when joining

Output:

FieldTypeDescription
resultstringPolaczony lancuch znakow

Example: Join with comma

yaml
array: ["apple", "banana", "cherry"]
separator: ,

Example: Join with newline

yaml
array: ["Line 1", "Line 2", "Line 3"]
separator:

Mapowanie tablicy

array.map

Przeksztalc kazdy element w tablicy

Parameters:

NameTypeRequiredDefaultDescription
arrayarrayYes-Array of items to process. Can be numbers, strings, or objects.
operationselect (multiply, add, subtract, divide, extract, uppercase, lowercase, trim, tostring, tonumber)Yes-Transformation to apply to each item
valueanyNo-Value for the operation: number for math operations, field name for extract

Output:

FieldTypeDescription
resultarrayPrzeksztalcona tablica
lengthnumberPrzeksztalcona tablica

Example: Multiply numbers

yaml
array: [1, 2, 3, 4, 5]
operation: multiply
value: 2

Example: Extract field from objects

yaml
array: [{"name": "Alice", "age": 30}, {"name": "Bob", "age": 25}]
operation: extract
value: name

Redukcja tablicy

array.reduce

Zredukuj tablice do pojedynczej wartosci

Parameters:

NameTypeRequiredDefaultDescription
arrayarrayYes-Array of items to process. Can be numbers, strings, or objects.
operationselect (sum, product, average, min, max, count, join, first, last)Yes-How to combine all items into a single value
separatorselect (, , ,, , `
, , - `, ``)No,String to insert between items when joining

Output:

FieldTypeDescription
resultanyZredukowana wartosc
operationstringZredukowana wartosc

Example: Sum numbers

yaml
array: [1, 2, 3, 4, 5]
operation: sum

Example: Join strings

yaml
array: ["Hello", "World", "from", "Flyto"]
operation: join
separator:

Weź

array.take

Weź pierwsze N elementów z tablicy

Parameters:

NameTypeRequiredDefaultDescription
arrayarrayYes-Tablica źródłowa
countnumberYes1Tablica źródłowa

Output:

FieldTypeDescription
resultarrayLiczba elementów do pobrania
lengthnumberPobrane elementy

Połącz Tablice

array.zip

Połącz wiele tablic element po elemencie

Parameters:

NameTypeRequiredDefaultDescription
arraysarrayYes-Tablica tablic do połączenia
fill_valueanyNo-Tablica tablic do połączenia

Output:

FieldTypeDescription
resultarrayWartość dla brakujących elementów
lengthnumberPołączona tablica

Released under the Apache 2.0 License.