New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

o-system

Package Overview
Dependencies
Maintainers
1
Versions
133
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

o-system

queryable data structure

latest
npmnpm
Version
2.0.45
Version published
Maintainers
1
Created
Source

Install

npm install --save o-system

Use it

var service = require('o-system').Service;

class AppCode{
    constructor(){
        this.id = Math.random();
    }
}

class TestA{
    constructor(){
        this.id = Math.random();
    }
}

class TestB {
    constructor(testa,appCode){
        this.id = Math.random();
        this.testa = testa;
        this.appCode = appCode;
    }
}


class TestC {
    constructor(testb,testa){
        this.id = Math.random();
        this.testa = testa;
        this.testb = testb;
    }
}

  const container = service.createContainer();

    container.add('test.a',TestA)
                 .transient();
    container.add('app.code',AppCode)
                 .scoped();

    container.add('test.b',TestB)
                .args('test.a','app.code');
    container.add('test.c',TestC)
                 .args('test.b','test.a')
                 .scoped();

    var provider = container.build();
    let testc = provider.get('test.c');
    let testa = provider.get('test.a');
    assert.equal(testc.testa.id,testc.testb.testa.id); // true
    assert.notEqual(testa.id,testc.testa.id); // true

Keywords

dependency

FAQs

Package last updated on 22 Apr 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts