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.
Files changed (2) hide show
  1. package/lib/library.js +7 -0
  2. 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
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "bare-script",
4
- "version": "2.2.6",
4
+ "version": "2.2.7",
5
5
  "description": "BareScript; a lightweight scripting and expression language",
6
6
  "keywords": [
7
7
  "expression",