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

@randlabs/js-config-reader

Package Overview
Dependencies
Maintainers
2
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@randlabs/js-config-reader - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

dist/index.d.ts

21

package.json
{
"name": "@randlabs/js-config-reader",
"version": "1.0.1",
"version": "1.0.2",
"description": "Configuration settings loader",
"main": "lib/index.js",
"types": "lib/index.d.ts",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"files": [
"dist",
"src/**/*.ts"
],
"scripts": {
"build": "rimraf lib && tsc",
"build": "rimraf dist && rollup -c",
"prepack": "npm run build",

@@ -32,3 +36,2 @@ "test": "npm run build && node ./node_modules/ava/cli.js --verbose"

"dependencies": {
"@types/json5": "0.0.30",
"ajv": "^6.12.5",

@@ -39,10 +42,18 @@ "ajv-formats-draft2019": "^1.4.3",

"devDependencies": {
"@rollup/plugin-commonjs": "^15.1.0",
"@rollup/plugin-json": "^4.1.0",
"@rollup/plugin-node-resolve": "^9.0.0",
"@types/json5": "0.0.30",
"@types/node": "^14.11.2",
"@typescript-eslint/eslint-plugin": "^3.10.1",
"@typescript-eslint/parser": "^3.10.1",
"@wessberg/rollup-plugin-ts": "^1.3.5",
"ava": "^3.13.0",
"eslint": "^7.10.0",
"rimraf": "^3.0.2",
"rollup": "^2.32.0",
"rollup-plugin-terser": "^7.0.2",
"tslib": "^2.0.3",
"typescript": "^4.0.3"
}
}

@@ -52,3 +52,4 @@ import Ajv from "ajv";

* @param {Options} options - Initialization options including the settings' source. Can be a filename or url depending on the used loader.
* @param {string} options.source - Source location of the configuration settings.
* Optional.
* @param {string} options.source - Source location of the configuration settings. Optional.
* @param {string} options.envVar - Environment variable name used to find the source. Optional.

@@ -64,8 +65,13 @@ * @param {string} options.cmdLineParam - Command-line parameter to use to find the source. Optional.

*/
export async function initialize<S = DefaultSettings>(options: Options<S>): Promise<S> {
export async function initialize<S = DefaultSettings>(options?: Options<S>): Promise<S> {
let source: string | undefined;
if (!options) {
throw new Error("Options not set");
if (typeof options !== "undefined") {
if (typeof options !== "object" || Array.isArray(options)) {
throw new Error("Options not set");
}
}
else {
options = {};
}

@@ -72,0 +78,0 @@ // if a source was passed, use it

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