corebasic 1.0.142 → 1.0.144
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/libs/mobilecodes.js +3 -0
- package/libs/utils.js +9 -1
- package/package.json +1 -1
package/libs/mobilecodes.js
CHANGED
package/libs/utils.js
CHANGED
|
@@ -15,6 +15,13 @@ let _ = (async () => { try { const data = await S3.send(new CreateBucketCommand(
|
|
|
15
15
|
export let pipeline = { execute: execute }
|
|
16
16
|
|
|
17
17
|
|
|
18
|
+
export function log(...args) {
|
|
19
|
+
let res = []
|
|
20
|
+
args.forEach(arg => res.push(typeof arg === "object" ? JSON.stringify(arg,null,'\t') : arg))
|
|
21
|
+
console.log(...res)
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
|
|
18
25
|
export function uid() {
|
|
19
26
|
return ObjectId.ObjectId()
|
|
20
27
|
}
|
|
@@ -219,7 +226,8 @@ export const excludeMiddleware = function(middleware, ...paths) {
|
|
|
219
226
|
|
|
220
227
|
export function parseMob(mob, code) {
|
|
221
228
|
code = code ?? "IN"
|
|
222
|
-
|
|
229
|
+
if (isEmpty(mob))
|
|
230
|
+
return mob
|
|
223
231
|
mob = mob.trim().replace(/(,| |-|\+)/g, '') // remove comma, space, hyphen and plus
|
|
224
232
|
mob = mob.startsWith("0") ? mob.replace(/^0*/,'') : mob // remove starting n zeroes
|
|
225
233
|
|