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.
@@ -1,3 +1,6 @@
1
+
2
+ // Found at https://gist.github.com/ally-commits/9073ff23fc7f96fab1290fdec22775bc
3
+
1
4
  export const codes = {
2
5
  AD: { code: 'AD', label: 'Andorra', phone: '376', phoneLength: 6 },
3
6
  AE: {
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
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "corebasic",
3
3
  "type": "module",
4
- "version": "1.0.142",
4
+ "version": "1.0.144",
5
5
  "description": "",
6
6
  "main": "index.js",
7
7
  "scripts": {