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

@itrocks/compose

Package Overview
Dependencies
Maintainers
0
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@itrocks/compose - npm Package Compare versions

Comparing version 0.0.5 to 0.0.6

2

cjs/compose.d.ts
export type ComposeConfig = Record<string, string | string[]>;
export default compose;
export declare function compose(config: ComposeConfig): void;
export declare function compose(baseDir: string, config: ComposeConfig): void;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.compose = compose;
const app_dir_1 = require("@itrocks/app-dir");
const class_type_1 = require("@itrocks/class-type");

@@ -13,7 +12,7 @@ const uses_1 = require("@itrocks/uses");

const replacements = {};
function configPath(config) {
return (0, path_1.normalize)(require.resolve((config[0] === '/') ? (app_dir_1.default + config) : config));
function configPath(baseDir, config) {
return (0, path_1.normalize)(require.resolve((config[0] === '/') ? (baseDir + '/' + config) : config));
}
exports.default = compose;
function compose(config) {
function compose(baseDir, config) {
// initReplacements

@@ -23,3 +22,3 @@ for (let [module, configReplacements] of Object.entries(config)) {

[module, moduleExport] = module.split(':');
module = configPath(module);
module = configPath(baseDir, module);
moduleExport ??= 'default';

@@ -33,3 +32,3 @@ if (!replacements[module]) {

[replacement, replacementExport] = replacement.split(':');
replacement = configPath(replacement);
replacement = configPath(baseDir, replacement);
replacementExport ??= 'default';

@@ -36,0 +35,0 @@ replacements[module][moduleExport].push({ script: replacement, export: replacementExport });

export type ComposeConfig = Record<string, string | string[]>;
export default compose;
export declare function compose(config: ComposeConfig): void;
export declare function compose(baseDir: string, config: ComposeConfig): void;

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

import appDir from '@itrocks/app-dir';
import { inherits } from '@itrocks/class-type';

@@ -10,7 +9,7 @@ import { Uses } from '@itrocks/uses';

const replacements = {};
function configPath(config) {
return normalize(require.resolve((config[0] === '/') ? (appDir + config) : config));
function configPath(baseDir, config) {
return normalize(require.resolve((config[0] === '/') ? (baseDir + '/' + config) : config));
}
export default compose;
export function compose(config) {
export function compose(baseDir, config) {
// initReplacements

@@ -20,3 +19,3 @@ for (let [module, configReplacements] of Object.entries(config)) {

[module, moduleExport] = module.split(':');
module = configPath(module);
module = configPath(baseDir, module);
moduleExport ??= 'default';

@@ -30,3 +29,3 @@ if (!replacements[module]) {

[replacement, replacementExport] = replacement.split(':');
replacement = configPath(replacement);
replacement = configPath(baseDir, replacement);
replacementExport ??= 'default';

@@ -33,0 +32,0 @@ replacements[module][moduleExport].push({ script: replacement, export: replacementExport });

@@ -7,3 +7,2 @@ {

"dependencies": {
"@itrocks/app-dir": "latest",
"@itrocks/class-type": "latest",

@@ -56,3 +55,3 @@ "@itrocks/uses": "latest"

"types": "./esm/compose.d.ts",
"version": "0.0.5"
"version": "0.0.6"
}
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