@putkoff/abstract-utilities 0.1.222 → 0.1.223
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/dist/cjs/index.js
CHANGED
|
@@ -1146,6 +1146,23 @@ function isNum(obj) {
|
|
|
1146
1146
|
}
|
|
1147
1147
|
return isStrInString(obj, getNums());
|
|
1148
1148
|
}
|
|
1149
|
+
function ensure_number(object) {
|
|
1150
|
+
if (isNum(object)) {
|
|
1151
|
+
return Number(object);
|
|
1152
|
+
}
|
|
1153
|
+
let nuString = '';
|
|
1154
|
+
const object_str = assureString(object);
|
|
1155
|
+
const str_spl = object_str.split('');
|
|
1156
|
+
for (const obj in str_spl) {
|
|
1157
|
+
if (isNum(obj)) {
|
|
1158
|
+
nuString += obj;
|
|
1159
|
+
}
|
|
1160
|
+
}
|
|
1161
|
+
if (nuString != '') {
|
|
1162
|
+
return Number(nuString);
|
|
1163
|
+
}
|
|
1164
|
+
return null;
|
|
1165
|
+
}
|
|
1149
1166
|
function getAlphas() {
|
|
1150
1167
|
return 'abcdefghijklmnopqrstuvwxyz';
|
|
1151
1168
|
}
|
|
@@ -1654,6 +1671,7 @@ exports.eatEnd = eatEnd;
|
|
|
1654
1671
|
exports.eatInner = eatInner;
|
|
1655
1672
|
exports.eatOuter = eatOuter;
|
|
1656
1673
|
exports.ensure_list = ensure_list;
|
|
1674
|
+
exports.ensure_number = ensure_number;
|
|
1657
1675
|
exports.fetchIndexHtml = fetchIndexHtml;
|
|
1658
1676
|
exports.fetchIndexHtmlContainer = fetchIndexHtmlContainer;
|
|
1659
1677
|
exports.fetchIt = fetchIt;
|