@fullstackunicorn/initialize 1.0.9 → 1.0.10
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/index.js +1 -0
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -46,6 +46,7 @@ globalThis.F3.obj.isGood = obj => !!obj && typeof obj === 'object' && Object.key
|
|
|
46
46
|
globalThis.F3.obj.safe = obj => (typeof obj === 'object' && obj !== null) ? obj : {}
|
|
47
47
|
globalThis.F3.obj.isPlain = obj => obj !== null && typeof obj === 'object' && Object.getPrototypeOf(obj) === Object.prototype
|
|
48
48
|
globalThis.F3.obj.inKb = obj => new TextEncoder().encode(JSON.stringify(obj)).length / 1000
|
|
49
|
+
globalThis.F3.obj.get = (o, p) => p ? p.split('.').reduce((a, k) => a?.[k], o) ?? null : o
|
|
49
50
|
globalThis.F3.obj.toStr = obj => {
|
|
50
51
|
if (typeof obj === 'string') return obj
|
|
51
52
|
try { return JSON.stringify(obj, null, 2) } catch { return String(obj) }
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "1.0.
|
|
2
|
+
"version": "1.0.10",
|
|
3
3
|
"name": "@fullstackunicorn/initialize",
|
|
4
4
|
"author": "lucanigido (https://fullstackunicorn.dev/author/lucanigido)",
|
|
5
5
|
"description": "A collection of global utility functions for JavaScript/Node.js projects (type checks, string helpers, logging, etc.). Side-effect import extends globals.",
|