smsmslib 1.0.48 → 1.0.54
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/javascr/system/array.js +30 -0
- package/package.json +5 -2
package/javascr/system/array.js
CHANGED
|
@@ -100,3 +100,33 @@ export function sj_array_push(a_any, ...push)
|
|
|
100
100
|
}
|
|
101
101
|
|
|
102
102
|
|
|
103
|
+
/**
|
|
104
|
+
* Safely creates a new Array instance with a specified length.
|
|
105
|
+
*
|
|
106
|
+
* @param {number} i_len [in]
|
|
107
|
+
* The length of the new array. Must be a non-negative integer.
|
|
108
|
+
*
|
|
109
|
+
* @param {any} initial [in, optional]
|
|
110
|
+
* The value to fill each element with.
|
|
111
|
+
*
|
|
112
|
+
* @returns {Array<any> | null}
|
|
113
|
+
* A new array of the specified length filled with `initial`.
|
|
114
|
+
* Returns `null` if the length is invalid or a runtime error occurs.
|
|
115
|
+
*/
|
|
116
|
+
export function sj_array_new(i_len, initial)
|
|
117
|
+
{
|
|
118
|
+
let a_any = null;
|
|
119
|
+
|
|
120
|
+
try
|
|
121
|
+
{
|
|
122
|
+
a_any = new Array(i_len).fill(initial);
|
|
123
|
+
}
|
|
124
|
+
catch (o_err)
|
|
125
|
+
{
|
|
126
|
+
console.error(`${sj_array_new.name}: ${o_err.message}`);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
return a_any;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "smsmslib",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.54",
|
|
4
4
|
"description": "Reusable functions for me.",
|
|
5
5
|
"files": [
|
|
6
6
|
"javascr/**/*.js",
|
|
@@ -17,5 +17,8 @@
|
|
|
17
17
|
"smsmslib"
|
|
18
18
|
],
|
|
19
19
|
"author": "",
|
|
20
|
-
"license": "ISC"
|
|
20
|
+
"license": "ISC",
|
|
21
|
+
"dependencies": {
|
|
22
|
+
"smsmslib": "^1.0.54"
|
|
23
|
+
}
|
|
21
24
|
}
|