diff --git a/package.json b/package.json index 4c504c9..3e4b7b3 100644 --- a/package.json +++ b/package.json @@ -52,8 +52,8 @@ "@nodesecure/js-x-ray": "^7.3.0", "@nodesecure/npm-types": "^1.0.0", "@nodesecure/vuln": "^1.7.0", + "@openally/config": "^1.0.1", "@openally/result": "^1.2.1", - "@slimio/config": "^1.2.0", "lodash.merge": "^4.6.2", "type-fest": "^4.23.0" }, diff --git a/src/functions/read.ts b/src/functions/read.ts index ec73b01..54bc4c5 100644 --- a/src/functions/read.ts +++ b/src/functions/read.ts @@ -3,7 +3,7 @@ import path from "node:path"; import { once } from "node:events"; // Import Third-party Dependencies -import Config from "@slimio/config"; +import { AsynchronousConfig } from "@openally/config"; import { Ok, Err, Result } from "@openally/result"; import { RequireAtLeastOne } from "type-fest"; @@ -44,8 +44,8 @@ export async function read( const { createIfDoesNotExist = Boolean(options.createMode), createMode, memoize: memoizeRc = false } = options; const cfgPath = path.join(location, CONSTANTS.CONFIGURATION_NAME); - const cfg = new Config(cfgPath, { - defaultSchema: JSONSchema, + const cfg = new AsynchronousConfig(cfgPath, { + jsonSchema: JSONSchema, createOnNoEntry: createIfDoesNotExist }); diff --git a/src/functions/write.ts b/src/functions/write.ts index 02c2c50..970d753 100644 --- a/src/functions/write.ts +++ b/src/functions/write.ts @@ -2,7 +2,7 @@ import path from "path"; // Import Third-party Dependencies -import Config from "@slimio/config"; +import { AsynchronousConfig } from "@openally/config"; import { Ok, Err, Result } from "@openally/result"; // Import Internal Dependencies @@ -34,8 +34,8 @@ export async function write( const { payload, partialUpdate = false } = options; const cfgPath = path.join(location, CONSTANTS.CONFIGURATION_NAME); - const cfg = new Config(cfgPath, { - defaultSchema: JSONSchema + const cfg = new AsynchronousConfig(cfgPath, { + jsonSchema: JSONSchema }); await cfg.read(); diff --git a/test/fixtures/.nodesecurerc b/test/fixtures/.nodesecurerc index 2735042..d4fbaec 100644 --- a/test/fixtures/.nodesecurerc +++ b/test/fixtures/.nodesecurerc @@ -1,6 +1,6 @@ { - "version": "2.1.0", - "i18n": "french", - "strategy": "none", - "registry": "https://registry.npmjs.org" + "version": "2.1.0", + "i18n": "french", + "strategy": "none", + "registry": "https://registry.npmjs.org" } \ No newline at end of file