Socket
Socket
Sign inDemoInstall

@vonage/vvd-core

Package Overview
Dependencies
Maintainers
14
Versions
124
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vonage/vvd-core - npm Package Compare versions

Comparing version 0.5.0 to 0.6.0

CHANGELOG.md

10

package.json
{
"name": "@vonage/vvd-core",
"version": "0.5.0",
"version": "0.6.0",
"description": "> TODO: description",

@@ -27,7 +27,7 @@ "author": "yinonov <yinon@hotmail.com>",

"dependencies": {
"@vonage/vvd-fonts": "^0.5.0",
"@vonage/vvd-scheme": "^0.5.0",
"tslib": "^2.0.0"
"@vonage/vvd-fonts": "^0.6.0",
"@vonage/vvd-scheme": "^0.6.0",
"tslib": "^2.0.1"
},
"gitHead": "5f43688d123fda159d4a0c15bfcf5011075a82d4"
"gitHead": "d55fb00c43d48e3f8b0f3de170e4cb6949acbfd8"
}

@@ -1,9 +0,1 @@

export declare function validateInitParameters(services: Record<string, unknown>): void;
/**
* Internal initialiser
* this API is an internal initialiser of the core services
*
* @param services a map of the services requested to be initialised, where the key is the name of the service and the value is the parameter/s to be passed to the service initialisation function
* @returns compound Promise of all inidividual service initialisation Promises
*/
export declare function init(services?: Record<string, unknown>): Promise<void[]>;
export declare const coreReady: Promise<unknown>;

@@ -0,39 +1,20 @@

import configuration from './config-resolver.js';
import fonts from '@vonage/vvd-fonts/vvd-fonts.js';
import scheme from '@vonage/vvd-scheme';
const servicesRegistry = {
'fonts': {
defaultInitParam: null,
initialiser: fonts.init
},
'scheme': {
defaultInitParam: null,
initialiser: scheme.init
}
};
export function validateInitParameters(services) {
const knownServices = Object.keys(servicesRegistry);
const unknownService = Object.keys(services).find(serviceKey => !knownServices.includes(serviceKey));
if (unknownService) {
throw new Error(`unknown service key '${unknownService}' specified for init API`);
}
import schemeService from '@vonage/vvd-scheme';
let initResolver, initRejector;
export const coreReady = new Promise((resolve, reject) => {
initResolver = resolve;
initRejector = reject;
});
console.debug('effective config', JSON.stringify(configuration));
init(configuration);
async function init({ scheme }) {
Promise
.all([
fonts.init(),
schemeService.set(scheme)
])
.then(initResolver)
.catch(initRejector);
}
/**
* Internal initialiser
* this API is an internal initialiser of the core services
*
* @param services a map of the services requested to be initialised, where the key is the name of the service and the value is the parameter/s to be passed to the service initialisation function
* @returns compound Promise of all inidividual service initialisation Promises
*/
export async function init(services) {
if (services) {
validateInitParameters(services);
}
else {
services = servicesRegistry;
}
const serviceInitPromises = Object
.entries(services)
.map(([serviceKey, initParams]) => servicesRegistry[serviceKey].initialiser(initParams));
return await Promise.all(serviceInitPromises);
}
//# sourceMappingURL=vvd-core.js.map

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