bare-script 2.2.6 → 2.2.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/library.js +7 -0
- package/package.json +1 -1
package/lib/library.js
CHANGED
|
@@ -135,6 +135,13 @@ export const scriptFunctions = {
|
|
|
135
135
|
return value;
|
|
136
136
|
},
|
|
137
137
|
|
|
138
|
+
// $function: arrayShift
|
|
139
|
+
// $group: Array
|
|
140
|
+
// $doc: Remove the first element of the array and return it
|
|
141
|
+
// $arg array: The array
|
|
142
|
+
// $return: The first element of the array; null if the array is empty.
|
|
143
|
+
'arrayShift': ([array]) => (Array.isArray(array) ? array.shift() ?? null : null),
|
|
144
|
+
|
|
138
145
|
// $function: arraySlice
|
|
139
146
|
// $group: Array
|
|
140
147
|
// $doc: Copy a portion of an array
|