Marketplace móvil para negocios locales mexicanos. Estructura inicial: - apps/backend (NestJS API) - apps/frontend (React Web) - apps/mobile (Expo/React Native) - apps/mcp-server (Claude MCP Server) - apps/whatsapp-service (WhatsApp Business API) - database/ (PostgreSQL DDL) - docs/ (Documentación) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
45 lines
1.2 KiB
JavaScript
45 lines
1.2 KiB
JavaScript
// copied from https://github.com/nodejs/node/blob/v15.3.0/lib/internal/modules/package_json_reader.js
|
|
'use strict';
|
|
|
|
const { SafeMap } = require('./node-primordials');
|
|
const { internalModuleReadJSON } = require('./node-internalBinding-fs');
|
|
const { pathToFileURL } = require('url');
|
|
const { toNamespacedPath } = require('path');
|
|
// const { getOptionValue } = require('./node-options');
|
|
|
|
const cache = new SafeMap();
|
|
|
|
let manifest;
|
|
|
|
/**
|
|
* @param {string} jsonPath
|
|
* @return {{string: string, containsKeys: boolean}}
|
|
*/
|
|
function read(jsonPath) {
|
|
if (cache.has(jsonPath)) {
|
|
return cache.get(jsonPath);
|
|
}
|
|
|
|
const [string, containsKeys] = internalModuleReadJSON(
|
|
toNamespacedPath(jsonPath)
|
|
);
|
|
const result = { string, containsKeys };
|
|
if (string !== undefined) {
|
|
if (manifest === undefined) {
|
|
// manifest = getOptionValue('--experimental-policy') ?
|
|
// require('internal/process/policy').manifest :
|
|
// null;
|
|
// disabled for now. I am not sure if/how we should support this
|
|
manifest = null;
|
|
}
|
|
if (manifest !== null) {
|
|
const jsonURL = pathToFileURL(jsonPath);
|
|
manifest.assertIntegrity(jsonURL, string);
|
|
}
|
|
}
|
|
cache.set(jsonPath, result);
|
|
return result;
|
|
}
|
|
|
|
module.exports = { read };
|