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

@128technology/yinz

Package Overview
Dependencies
Maintainers
5
Versions
53
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@128technology/yinz - npm Package Compare versions

Comparing version 4.0.14 to 4.0.15

30

dist/instance/__tests__/DataModelInstance-test.js

@@ -387,2 +387,32 @@ "use strict";

});
it('should handle a choice where a parent node has a true when clause', () => {
const dataModelInstance = getInstance('./data/when/choiceWhenParentTrue.xml');
const whenPath = [
{ name: 'authority' },
{ name: 'router', keys: [{ key: 'name', value: 'athens' }] },
{ name: 'routing', keys: [{ key: 'type', value: 'rt:default-instance' }] },
{ name: 'routing-protocol', keys: [{ key: 'type', value: 'rt:bgp' }] },
{ name: 'neighbor', keys: [{ key: 'neighbor-address', value: '1.1.1.1' }] },
{ name: 'transport' },
{ name: 'local-address' },
{ name: 'source' }
];
const result = dataModelInstance.evaluateWhenCondition(whenPath);
chai_1.expect(result).to.equal(true);
});
it('should handle a choice where a parent node has a false when clause', () => {
const dataModelInstance = getInstance('./data/when/choiceWhenParentFalse.xml');
const whenPath = [
{ name: 'authority' },
{ name: 'router', keys: [{ key: 'name', value: 'athens' }] },
{ name: 'routing', keys: [{ key: 'type', value: 'rt:default-instance' }] },
{ name: 'routing-protocol', keys: [{ key: 'type', value: 'rt:foo' }] },
{ name: 'neighbor', keys: [{ key: 'neighbor-address', value: '1.1.1.1' }] },
{ name: 'transport' },
{ name: 'local-address' },
{ name: 'source' }
];
const result = dataModelInstance.evaluateWhenCondition(whenPath);
chai_1.expect(result).to.equal(false);
});
});

@@ -389,0 +419,0 @@ describe('LeafRef Evaluation', () => {

10

dist/instance/DataModelInstance.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const _ = require("lodash");
const enum_1 = require("../enum");

@@ -47,7 +46,6 @@ const _1 = require("./");

}
const searchPath = model instanceof model_1.Choice ? _.initial(path) : path;
const xPath = util_1.getPathXPath(searchPath);
const xPath = util_1.getPathXPath(path);
let exists = true;
try {
this.getInstance(searchPath);
this.getInstance(path);
}

@@ -59,3 +57,3 @@ catch (e) {

if (!exists) {
instance = util_1.addEmptyTree(searchPath, this.model, instance);
instance = util_1.addEmptyTree(path, this.model, instance);
}

@@ -68,3 +66,3 @@ let instanceRoot = instance.get(xPath);

const { condition, context } = when;
const contextNode = context === enum_1.ContextNode.parent ? instanceRoot.parent() : instanceRoot;
const contextNode = context === enum_1.ContextNode.parent || modelRoot instanceof model_1.Choice ? instanceRoot.parent() : instanceRoot;
const result = contextNode.get(condition, this.model.namespaces);

@@ -71,0 +69,0 @@ if (!result) {

2

package.json
{
"name": "@128technology/yinz",
"version": "4.0.14",
"version": "4.0.15",
"description": "A module for injesting a YIN datamodel and handling instance data.",

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

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