{"_id":"@adartem/adlib-utils","_rev":"3-a3e74e19c8fb8ded500ac4deb7f0cfd6","name":"@adartem/adlib-utils","dist-tags":{"latest":"0.1.0"},"versions":{"0.0.0":{"name":"@adartem/adlib-utils","version":"0.0.0","keywords":["adlib","adartem","utils","dom","helpers"],"license":"MIT","_id":"@adartem/adlib-utils@0.0.0","maintainers":[{"name":"joshua-divialle","email":"divialle.joshua2@gmail.com"}],"dist":{"shasum":"41b87e46fde1f425f4c2f92ae853786124aa400f","tarball":"https://registry.npmjs.org/@adartem/adlib-utils/-/adlib-utils-0.0.0.tgz","fileCount":9,"integrity":"sha512-r2HVukq+A5rm0LHyP5NsWsfq+/LMlS195rjA7j4UiKrgXwqqpAPUnc3seLH06RWLH3xBLqQyWbUYYNQbTbfh0w==","signatures":[{"sig":"MEUCIEf4/WG9CgyEMy9S6WPUD/P41Hclo0MhooV6UaTeqeG3AiEAx/UVVGbSHYCdUrm5CacOHwrxYcOCTPVgZAkcGtYGf8s=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":17266},"main":"./dist/index.cjs","type":"module","_from":"file:adartem-adlib-utils-0.0.0.tgz","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=20"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js","require":"./dist/index.cjs"}},"private":false,"scripts":{"dev":"tsup --config tsup.config.ts --watch","lint":"eslint . --ext .ts","test":"vitest run","build":"tsup --config tsup.config.ts","format":"prettier -w .","lint:fix":"eslint . --ext .ts --fix","typecheck":"tsc -p tsconfig.json --noEmit"},"_npmUser":{"name":"joshua-divialle","email":"divialle.joshua2@gmail.com"},"_resolved":"/tmp/73a4a0b0291fa4b3969a56cd911af8f6/adartem-adlib-utils-0.0.0.tgz","_integrity":"sha512-r2HVukq+A5rm0LHyP5NsWsfq+/LMlS195rjA7j4UiKrgXwqqpAPUnc3seLH06RWLH3xBLqQyWbUYYNQbTbfh0w==","_npmVersion":"10.8.2","description":"Utilitaires transverses pour AdLib (DOM, parsing d'attributs, helpers, types).","directories":{},"sideEffects":false,"_nodeVersion":"20.19.6","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/adlib-utils_0.0.0_1766518912604_0.5798695714480775","host":"s3://npm-registry-packages-npm-production"},"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.1.0":{"name":"@adartem/adlib-utils","version":"0.1.0","keywords":["adlib","adartem","utils","dom","helpers"],"license":"MIT","_id":"@adartem/adlib-utils@0.1.0","maintainers":[{"name":"joshua-divialle","email":"divialle.joshua2@gmail.com"}],"dist":{"shasum":"cbd1b7359137be9b27bf3c839b4c3d78096182e2","tarball":"https://registry.npmjs.org/@adartem/adlib-utils/-/adlib-utils-0.1.0.tgz","fileCount":9,"integrity":"sha512-PMWoaqhLCPoV9Wkw9Mq0ppeUE+w7WjIcqmKKXngfWTij3fmMGx0IwHz8tyXuwY76Jefq6lX3SkGUH3F/2FzQEQ==","signatures":[{"sig":"MEUCIGCLoZ05TCuUccboAg6PstYVv+5XbdM4Q53qEFzMy+zcAiEA/A567KQHJ31BBhEvNevlSsqSBNa41LPXDo2ogZxt99Q=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":17266},"main":"./dist/index.cjs","type":"module","_from":"file:adartem-adlib-utils-0.1.0.tgz","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=20"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js","require":"./dist/index.cjs"}},"private":false,"scripts":{"dev":"tsup --config tsup.config.ts --watch","lint":"eslint . --ext .ts","test":"vitest run","build":"tsup --config tsup.config.ts","format":"prettier -w .","lint:fix":"eslint . --ext .ts --fix","typecheck":"tsc -p tsconfig.json --noEmit"},"_npmUser":{"name":"joshua-divialle","email":"divialle.joshua2@gmail.com"},"_resolved":"/tmp/b00524f68570d8d88d036a77ec9ef07a/adartem-adlib-utils-0.1.0.tgz","_integrity":"sha512-PMWoaqhLCPoV9Wkw9Mq0ppeUE+w7WjIcqmKKXngfWTij3fmMGx0IwHz8tyXuwY76Jefq6lX3SkGUH3F/2FzQEQ==","_npmVersion":"10.8.2","description":"Utilitaires transverses pour AdLib (DOM, parsing d'attributs, helpers, types).","directories":{},"sideEffects":false,"_nodeVersion":"20.19.6","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/adlib-utils_0.1.0_1766519319313_0.8679767211258","host":"s3://npm-registry-packages-npm-production"},"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."}},"time":{"created":"2025-12-23T19:41:52.507Z","modified":"2026-01-31T23:49:34.536Z","0.0.0":"2025-12-23T19:41:52.747Z","0.1.0":"2025-12-23T19:48:39.454Z"},"license":"MIT","keywords":["adlib","adartem","utils","dom","helpers"],"description":"Utilitaires transverses pour AdLib (DOM, parsing d'attributs, helpers, types).","maintainers":[{"name":"joshua-divialle","email":"divialle.joshua2@gmail.com"}],"readme":"# @adartem/adlib-utils\n\n`@adartem/adlib-utils` regroupe les **utilitaires transverses** de la plateforme **AdLib**.\n\nCe package fournit des **helpers purs et réutilisables**, sans dépendance au\nruntime, au loader ou au navigateur global.\n\n👉 Il **n’initialise rien**, **ne charge rien** et **n’expose aucune API globale**.\n\n---\n\n## 🎯 Rôle et périmètre\n\n- Utilitaires DOM  \n- Guards et helpers de typage  \n- Parsing et normalisation d’attributs  \n- Helpers d’environnement (browser / server)  \n- Fonctions sans effet de bord  \n\n❌ Pas de runtime  \n❌ Pas de loader  \n❌ Pas d’accès à `window.AdLibAttributes`  \n\n---\n\n## 📦 Modules disponibles\n\n> La structure exacte peut évoluer, mais le périmètre reste strictement utilitaire.\n\n---\n\n### `attributes/`\n\nHelpers liés aux attributs HTML `ad-*`.\n\n- Détection de clés de module (`ad-*`)  \n- Normalisation (`ad-*` / `data-ad-*`)  \n\n```ts\nimport {\n  isModuleKey,\n  normalizeAttributeName,\n} from '@adartem/adlib-utils';\n\nisModuleKey('ad-click');                 // true\nnormalizeAttributeName('data-ad-click'); // 'ad-click'\n```\n\n---\n\n### `dom/`\n\nHelpers DOM génériques.\n\n#### Scan DOM\nCollecte des modules déclarés dans un arbre DOM :\n\n```ts\nimport { collectModuleKeysFromDOM } from '@adartem/adlib-utils';\n\nconst keys = collectModuleKeysFromDOM(document);\n// → ['ad-click', ...]\n```\n\n#### Guards DOM\nHelpers de type-safe access :\n\n```ts\nimport { hasQuerySelectorAll } from '@adartem/adlib-utils';\n\nif (hasQuerySelectorAll(root)) {\n  root.querySelectorAll('*');\n}\n```\n\n---\n\n### `env/`\n\nDétection de l’environnement d’exécution.\n\n```ts\nimport { isBrowser, isServer } from '@adartem/adlib-utils';\n\nif (isBrowser()) {\n  // code navigateur\n}\n```\n\n---\n\n### `guards/`\n\nGuards génériques pour sécuriser les accès dynamiques :\n\n- Évite l’usage de `any`  \n- Centralise les raffinements de types  \n- Utilisé massivement par le runtime et le core  \n\n---\n\n### `strings/`, `parse/` (selon contenu)\n\nHelpers purs pour :\n- Parsing d’options  \n- Normalisation de chaînes  \n- Lecture et interprétation d’attributs  \n\nGaranties :\n- Synchrones  \n- Sans état  \n- Sans dépendance externe  \n\n---\n\n## 🧩 Principes de conception\n\n- **Pure functions** autant que possible  \n- Aucun effet de bord  \n- Réutilisable côté runtime, modules, tests ou tooling  \n- Compatible navigateur et Node.js  \n- TypeScript strict  \n  (`noImplicitAny`, `exactOptionalPropertyTypes`, etc.)  \n\n---\n\n## 🧪 Tests & build\n\n```bash\npnpm -r --filter @adartem/adlib-utils build\npnpm -r typecheck\n```\n\n---\n\n## 📦 Distribution\n\n- Package **ESM**  \n- Import direct via bundler ou Node.js  \n- Pas de bundle CDN autonome  \n  (utilisé indirectement par les autres packages)  \n\n---\n\n## 🪪 Licence\n\nMIT © ADARTEM","readmeFilename":"README.md"}