New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@app-config/utils

Package Overview
Dependencies
Maintainers
2
Versions
48
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@app-config/utils - npm Package Compare versions

Comparing version 2.8.2 to 2.8.3

2

dist/es/index.d.ts

@@ -15,3 +15,3 @@ export declare const isBrowser: boolean;

export declare function isPrimitive(obj: Json): obj is JsonPrimitive;
export declare function generateModuleText(fullConfig: Json, { environment, useGlobalNamespace, validationFunctionCode, esmValidationCode, }: {
export declare function generateModuleText(fullConfig: Json | undefined, { environment, useGlobalNamespace, validationFunctionCode, esmValidationCode, }: {
environment: string | undefined;

@@ -18,0 +18,0 @@ useGlobalNamespace: boolean;

@@ -15,8 +15,22 @@ export const isBrowser = typeof window === 'object' && typeof document === 'object' && document.nodeType === 9;

const privateEnvName = '_appConfigEnvironment';
const config = JSON.stringify(fullConfig);
let generatedText = '';
if (useGlobalNamespace) {
if (fullConfig === undefined) {
generatedText += `
const globalNamespace = (typeof window === 'undefined' ? globalThis : window) || {};
const config = globalNamespace.${privateName};
if (typeof config === 'undefined') {
throw new Error('Config is not loaded in ${privateName}');
}
export { config };
export default config;
`;
}
else if (useGlobalNamespace) {
const config = JSON.stringify(fullConfig);
generatedText += `
const globalNamespace = (typeof window === 'undefined' ? globalThis : window) || {};
const configValue = ${config};

@@ -40,2 +54,3 @@

else {
const config = JSON.stringify(fullConfig);
generatedText += `

@@ -42,0 +57,0 @@ const config = ${config};

@@ -15,3 +15,3 @@ export declare const isBrowser: boolean;

export declare function isPrimitive(obj: Json): obj is JsonPrimitive;
export declare function generateModuleText(fullConfig: Json, { environment, useGlobalNamespace, validationFunctionCode, esmValidationCode, }: {
export declare function generateModuleText(fullConfig: Json | undefined, { environment, useGlobalNamespace, validationFunctionCode, esmValidationCode, }: {
environment: string | undefined;

@@ -18,0 +18,0 @@ useGlobalNamespace: boolean;

@@ -20,8 +20,22 @@ "use strict";

const privateEnvName = '_appConfigEnvironment';
const config = JSON.stringify(fullConfig);
let generatedText = '';
if (useGlobalNamespace) {
if (fullConfig === undefined) {
generatedText += `
const globalNamespace = (typeof window === 'undefined' ? globalThis : window) || {};
const config = globalNamespace.${privateName};
if (typeof config === 'undefined') {
throw new Error('Config is not loaded in ${privateName}');
}
export { config };
export default config;
`;
}
else if (useGlobalNamespace) {
const config = JSON.stringify(fullConfig);
generatedText += `
const globalNamespace = (typeof window === 'undefined' ? globalThis : window) || {};
const configValue = ${config};

@@ -45,2 +59,3 @@

else {
const config = JSON.stringify(fullConfig);
generatedText += `

@@ -47,0 +62,0 @@ const config = ${config};

{
"name": "@app-config/utils",
"description": "Common utilities used in @app-config",
"version": "2.8.2",
"version": "2.8.3",
"license": "MPL-2.0",

@@ -6,0 +6,0 @@ "author": {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc