@fullstackunicorn/initialize 1.0.1 → 1.0.2

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/index.js +10 -1
  2. package/package.json +17 -14
package/index.js CHANGED
@@ -62,6 +62,12 @@ globalThis.F3.replacer = (string = '', values = {}) => {
62
62
  return newString
63
63
  }
64
64
 
65
+ globalThis.F3.promise = async (func, data) => {
66
+ return new Promise((resolve, reject) => {
67
+ func(data, (error, output) => { if (error) reject(error); else resolve(output) })
68
+ })
69
+ }
70
+
65
71
  globalThis.F3.res = {}
66
72
  globalThis.F3.res.isGood = res => {
67
73
  if (F3.isNil(res)) return false
@@ -95,7 +101,10 @@ globalThis.F3.err.is500 = status => !!status && status >= 500
95
101
  globalThis.F3.err.is400 = status => !!status && status >= 400 && status < 500
96
102
 
97
103
  globalThis.F3.catch = {}
98
- globalThis.F3.catch.throw = error => { throw error }
104
+ globalThis.F3.catch.throw = (error, ...rest) => {
105
+ if (rest.length > 0) console.log(...rest)
106
+ throw error
107
+ }
99
108
  globalThis.F3.catch.log = (...args) => console.log(...args)
100
109
  globalThis.F3.catch.res = (first, ...rest) => {
101
110
  if (rest.length > 0) console.log(...rest)
package/package.json CHANGED
@@ -1,22 +1,12 @@
1
1
  {
2
+ "version": "1.0.2",
2
3
  "name": "@fullstackunicorn/initialize",
3
- "author": "lucanigido[](https://fullstackunicorn.dev/author/lucanigido)",
4
- "version": "1.0.1",
4
+ "author": "lucanigido (https://fullstackunicorn.dev/author/lucanigido)",
5
+ "description": "A collection of global utility functions for JavaScript/Node.js projects (type checks, string helpers, logging, etc.). Side-effect import extends globals.",
6
+ "readme": "README.md",
5
7
  "main": "index.js",
6
8
  "type": "module",
7
9
  "license": "MIT",
8
- "private": false,
9
- "description": "A collection of global utility functions for JavaScript/Node.js projects (type checks, string helpers, logging, etc.). Side-effect import extends globals.",
10
- "readme": "README.md",
11
- "keywords": [
12
- "utilities",
13
- "helpers",
14
- "global",
15
- "javascript",
16
- "node",
17
- "type-checks",
18
- "logging"
19
- ],
20
10
  "repository": {
21
11
  "type": "git",
22
12
  "url": "https://gitlab.com/fullstackunicorn/initialize.git"
@@ -27,6 +17,19 @@
27
17
  "sideEffects": [
28
18
  "index.js"
29
19
  ],
20
+ "keywords": [
21
+ "utilities",
22
+ "helpers",
23
+ "global",
24
+ "javascript",
25
+ "node",
26
+ "type-checks",
27
+ "logging"
28
+ ],
29
+ "imports": {
30
+ "#@": "./",
31
+ "#@/*": "./*"
32
+ },
30
33
  "scripts": {
31
34
  "test": "echo \"Error: no test specified\" && exit 1"
32
35
  }