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

@contember/config-loader

Package Overview
Dependencies
Maintainers
5
Versions
267
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@contember/config-loader - npm Package Compare versions

Comparing version 1.2.0-alpha.18 to 1.2.0-alpha.19

12

dist/src/config/Loader.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const path_1 = require("path");
const fs_1 = require("fs");
const node_path_1 = require("node:path");
const fs = require("node:fs/promises");
const YamlAdapter_1 = require("./adapters/YamlAdapter");

@@ -16,3 +16,3 @@ const JsonAdapter_1 = require("./adapters/JsonAdapter");

async load(filename) {
const ext = (0, path_1.extname)(filename);
const ext = (0, node_path_1.extname)(filename);
if (!ext) {

@@ -25,5 +25,5 @@ throw new Loader.UnresolvedAdapterError(`File ${filename} does not have an extension.`);

}
const file = await fs_1.promises.readFile(filename, { encoding: 'utf8' });
const file = await fs.readFile(filename, { encoding: 'utf8' });
const config = this.adapters[extWithoutDot].parse(file);
return await this.includeConfigs(config, (0, path_1.dirname)(filename));
return await this.includeConfigs(config, (0, node_path_1.dirname)(filename));
}

@@ -51,3 +51,3 @@ async loadString(content, adapter) {

return Merger_1.default.merge(...(await Promise.all((_include || []).map(async (file) => {
const nestedConfig = await this.load((0, path_1.join)(baseDir, file));
const nestedConfig = await this.load((0, node_path_1.join)(baseDir, file));
if (typeof nestedConfig !== 'object' || nestedConfig === null) {

@@ -54,0 +54,0 @@ throw new Loader.InvalidConfigError(`Only object configs can be included`);

{
"name": "@contember/config-loader",
"version": "1.2.0-alpha.18",
"version": "1.2.0-alpha.19",
"license": "Apache-2.0",

@@ -5,0 +5,0 @@ "main": "dist/src/index.js",

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

import { dirname, extname, join } from 'path'
import { promises as fs } from 'fs'
import { dirname, extname, join } from 'node:path'
import * as fs from 'node:fs/promises'
import { YamlAdapter } from './adapters/YamlAdapter'

@@ -4,0 +4,0 @@ import { JsonAdapter } from './adapters/JsonAdapter'

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