Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@cloudcommerce/config

Package Overview
Dependencies
Maintainers
1
Versions
341
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@cloudcommerce/config - npm Package Compare versions

Comparing version 0.0.126 to 0.0.127

6

lib/config.d.ts

@@ -1,2 +0,3 @@

declare type BaseConfig = {
import type { CmsSettings } from '@cloudcommerce/types';
type BaseConfig = {
lang: string;

@@ -7,8 +8,9 @@ currency: string;

storeId: number;
cmsSettings?: CmsSettings;
};
declare const _default: {
get(): BaseConfig;
set(config: any): void;
set(config: Partial<BaseConfig>): void;
};
export default _default;
export type { BaseConfig };

@@ -32,12 +32,19 @@ import Deepmerge from '@fastify/deepmerge';

set(config) {
const { cmsSettings } = config;
if (cmsSettings) {
config.lang = config.lang || cmsSettings.lang;
config.currency = config.currency || cmsSettings.currency;
config.currencySymbol = config.currencySymbol || cmsSettings.currency_symbol;
config.countryCode = config.currencySymbol || cmsSettings.country_code;
}
self.config = deepmerge(self.config, config);
if (config.storeId) {
_env.ECOM_STORE_ID = config.storeId;
_env.ECOM_LANG = _env.ECOM_LANG || self.config.lang;
_env.ECOM_CURRENCY = _env.ECOM_CURRENCY || self.config.currency;
_env.ECOM_CURRENCY_SYMBOL = _env.ECOM_CURRENCY_SYMBOL || self.config.currencySymbol;
_env.ECOM_COUNTRY_CODE = _env.ECOM_COUNTRY_CODE || self.config.countryCode;
}
_env.ECOM_LANG = _env.ECOM_LANG || self.config.lang;
_env.ECOM_CURRENCY = _env.ECOM_CURRENCY || self.config.currency;
_env.ECOM_CURRENCY_SYMBOL = _env.ECOM_CURRENCY_SYMBOL || self.config.currencySymbol;
_env.ECOM_COUNTRY_CODE = _env.ECOM_COUNTRY_CODE || self.config.countryCode;
},
};
// # sourceMappingURL=config.js.map

@@ -1,2 +0,2 @@

declare type Env = {
type Env = {
storeId: number;

@@ -3,0 +3,0 @@ apiAuth: {

{
"name": "@cloudcommerce/config",
"type": "module",
"version": "0.0.126",
"version": "0.0.127",
"description": "E-Com Plus Cloud Commerce base config",

@@ -24,7 +24,7 @@ "main": "lib/config.js",

"dependencies": {
"@cloudcommerce/api": "0.0.126",
"@fastify/deepmerge": "^1.1.0"
"@fastify/deepmerge": "^1.2.0",
"@cloudcommerce/api": "0.0.127"
},
"devDependencies": {
"@cloudcommerce/types": "0.0.126"
"@cloudcommerce/types": "0.0.127"
},

@@ -31,0 +31,0 @@ "scripts": {

@@ -0,1 +1,2 @@

import type { CmsSettings } from '@cloudcommerce/types';
import Deepmerge from '@fastify/deepmerge';

@@ -15,2 +16,3 @@ import {

storeId: number,
cmsSettings?: CmsSettings,
};

@@ -45,11 +47,18 @@

},
set(config) {
set(config: Partial<BaseConfig>) {
const { cmsSettings } = config;
if (cmsSettings) {
config.lang = config.lang || cmsSettings.lang;
config.currency = config.currency || cmsSettings.currency;
config.currencySymbol = config.currencySymbol || cmsSettings.currency_symbol;
config.countryCode = config.currencySymbol || cmsSettings.country_code;
}
self.config = deepmerge(self.config, config);
if (config.storeId) {
_env.ECOM_STORE_ID = config.storeId;
_env.ECOM_LANG = _env.ECOM_LANG || self.config.lang;
_env.ECOM_CURRENCY = _env.ECOM_CURRENCY || self.config.currency;
_env.ECOM_CURRENCY_SYMBOL = _env.ECOM_CURRENCY_SYMBOL || self.config.currencySymbol;
_env.ECOM_COUNTRY_CODE = _env.ECOM_COUNTRY_CODE || self.config.countryCode;
}
_env.ECOM_LANG = _env.ECOM_LANG || self.config.lang;
_env.ECOM_CURRENCY = _env.ECOM_CURRENCY || self.config.currency;
_env.ECOM_CURRENCY_SYMBOL = _env.ECOM_CURRENCY_SYMBOL || self.config.currencySymbol;
_env.ECOM_COUNTRY_CODE = _env.ECOM_COUNTRY_CODE || self.config.countryCode;
},

@@ -56,0 +65,0 @@ };

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