Comparing version 0.5.0 to 0.6.0
@@ -6,2 +6,16 @@ # Change Log | ||
# [0.6.0](https://github.com/AlexanderLapygin/dags/compare/@dags/dag@0.4.1...@dags/dag@0.6.0) (2020-10-29) | ||
### Features | ||
- merge with dag-split-impl by local copy between branches | ||
([f067d9b](https://github.com/AlexanderLapygin/dags/commit/f067d9b7228325a3706773e0cd8052f8e2d8f9d5)) | ||
- rearrange arguments in setParenthood and removeParenthood | ||
([ec339ce](https://github.com/AlexanderLapygin/dags/commit/ec339cef10d0da925aae3f3814b6820445df42e7)) | ||
# Change Log | ||
All notable changes to this project will be documented in this file. See | ||
[Conventional Commits](https://conventionalcommits.org) for commit guidelines. | ||
## [0.4.1](https://github.com/AlexanderLapygin/dags/compare/@dags/dag@0.4.0...@dags/dag@0.4.1) (2020-10-27) | ||
@@ -8,0 +22,0 @@ |
@@ -88,5 +88,5 @@ "use strict"; | ||
expect(dag.getParents(current)).not.toContain(parent); | ||
dag.setParenthood(current, parent); | ||
dag.setParenthood(parent, current); | ||
expect(dag.getParents(current)).toContain(parent); | ||
dag.removeParenthood(current, parent); | ||
dag.removeParenthood(parent, current); | ||
expect(dag.getParents(current)).not.toContain(parent); | ||
@@ -103,7 +103,7 @@ }); | ||
it('Should return this dag', function () { | ||
expect(dag.setParenthood(child, parent)).toBe(dag); | ||
expect(dag.setParenthood(parent, child)).toBe(dag); | ||
}); | ||
it('Should add the given parent to the given parent set', function () { | ||
expect(dag.getParents(child)).not.toContain(parent); | ||
dag.setParenthood(child, parent); | ||
dag.setParenthood(parent, child); | ||
expect(dag.getParents(child)).toContain(parent); | ||
@@ -113,3 +113,3 @@ }); | ||
expect(dag.getChildren(parent)).not.toContain(child); | ||
dag.setParenthood(child, parent); | ||
dag.setParenthood(parent, child); | ||
expect(dag.getChildren(parent)).toContain(child); | ||
@@ -123,10 +123,10 @@ }); | ||
it('Should throw an error when parenthood establishing leads to a cycle', function () { | ||
dag.setParenthood(child, parent); | ||
dag.setParenthood(parent, child); | ||
expect(function () { | ||
return dag.setParenthood(parent, child); | ||
return dag.setParenthood(child, parent); | ||
}).toThrowError('The Parent-child relationship is not possible: this parenthood establishing leads to a cycle'); | ||
var grandson = dag.newNode(); | ||
dag.setParenthood(grandson, child); | ||
dag.setParenthood(child, grandson); | ||
expect(function () { | ||
return dag.setParenthood(parent, grandson); | ||
return dag.setParenthood(grandson, parent); | ||
}).toThrowError('The Parent-child relationship is not possible: this parenthood establishing leads to a cycle'); | ||
@@ -143,11 +143,11 @@ }); | ||
anotherParent = dag.newNode(); | ||
dag.setParenthood(child, parent); | ||
dag.setParenthood(child, anotherParent); | ||
dag.setParenthood(parent, child); | ||
dag.setParenthood(anotherParent, child); | ||
}); | ||
it('Should return this dag', function () { | ||
expect(dag.removeParenthood(child, parent)).toBe(dag); | ||
expect(dag.removeParenthood(parent, child)).toBe(dag); | ||
}); | ||
it('Should remove the given parent from the given parent set', function () { | ||
expect(dag.getParents(child)).toContain(parent); | ||
dag.removeParenthood(child, parent); | ||
dag.removeParenthood(parent, child); | ||
expect(dag.getParents(child)).not.toContain(parent); | ||
@@ -157,3 +157,3 @@ }); | ||
expect(dag.getChildren(parent)).toContain(child); | ||
dag.removeParenthood(child, parent); | ||
dag.removeParenthood(parent, child); | ||
expect(dag.getChildren(parent)).not.toContain(child); | ||
@@ -171,5 +171,5 @@ }); | ||
expect(dag.getChildren(current)).not.toContain(child); | ||
dag.setParenthood(child, current); | ||
dag.setParenthood(current, child); | ||
expect(dag.getChildren(current)).toContain(child); | ||
dag.removeParenthood(child, current); | ||
dag.removeParenthood(current, child); | ||
expect(dag.getChildren(current)).not.toContain(child); | ||
@@ -186,4 +186,4 @@ }); | ||
grandson = dag.newNode(); | ||
dag.setParenthood(son, node); | ||
dag.setParenthood(grandson, son); | ||
dag.setParenthood(node, son); | ||
dag.setParenthood(son, grandson); | ||
}); | ||
@@ -190,0 +190,0 @@ it('Should return false on arbitrary new node pair', function () { |
@@ -72,4 +72,4 @@ "use strict"; | ||
_proto.setParenthood = function setParenthood(child, parent) { | ||
this._dagBase.setParenthood(child, parent); | ||
_proto.setParenthood = function setParenthood(parent, child) { | ||
this._dagBase.setParenthood(parent, child); | ||
@@ -85,4 +85,4 @@ return this; | ||
_proto.removeParenthood = function removeParenthood(child, parent) { | ||
this._dagBase.removeParenthood(child, parent); | ||
_proto.removeParenthood = function removeParenthood(parent, child) { | ||
this._dagBase.removeParenthood(parent, child); | ||
@@ -89,0 +89,0 @@ return this; |
@@ -84,5 +84,5 @@ import { Dag } from '../dag'; // eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
expect(dag.getParents(current)).not.toContain(parent); | ||
dag.setParenthood(current, parent); | ||
dag.setParenthood(parent, current); | ||
expect(dag.getParents(current)).toContain(parent); | ||
dag.removeParenthood(current, parent); | ||
dag.removeParenthood(parent, current); | ||
expect(dag.getParents(current)).not.toContain(parent); | ||
@@ -99,7 +99,7 @@ }); | ||
it('Should return this dag', () => { | ||
expect(dag.setParenthood(child, parent)).toBe(dag); | ||
expect(dag.setParenthood(parent, child)).toBe(dag); | ||
}); | ||
it('Should add the given parent to the given parent set', () => { | ||
expect(dag.getParents(child)).not.toContain(parent); | ||
dag.setParenthood(child, parent); | ||
dag.setParenthood(parent, child); | ||
expect(dag.getParents(child)).toContain(parent); | ||
@@ -109,3 +109,3 @@ }); | ||
expect(dag.getChildren(parent)).not.toContain(child); | ||
dag.setParenthood(child, parent); | ||
dag.setParenthood(parent, child); | ||
expect(dag.getChildren(parent)).toContain(child); | ||
@@ -117,7 +117,7 @@ }); | ||
it('Should throw an error when parenthood establishing leads to a cycle', () => { | ||
dag.setParenthood(child, parent); | ||
expect(() => dag.setParenthood(parent, child)).toThrowError('The Parent-child relationship is not possible: this parenthood establishing leads to a cycle'); | ||
dag.setParenthood(parent, child); | ||
expect(() => dag.setParenthood(child, parent)).toThrowError('The Parent-child relationship is not possible: this parenthood establishing leads to a cycle'); | ||
var grandson = dag.newNode(); | ||
dag.setParenthood(grandson, child); | ||
expect(() => dag.setParenthood(parent, grandson)).toThrowError('The Parent-child relationship is not possible: this parenthood establishing leads to a cycle'); | ||
dag.setParenthood(child, grandson); | ||
expect(() => dag.setParenthood(grandson, parent)).toThrowError('The Parent-child relationship is not possible: this parenthood establishing leads to a cycle'); | ||
}); | ||
@@ -133,11 +133,11 @@ }); | ||
anotherParent = dag.newNode(); | ||
dag.setParenthood(child, parent); | ||
dag.setParenthood(child, anotherParent); | ||
dag.setParenthood(parent, child); | ||
dag.setParenthood(anotherParent, child); | ||
}); | ||
it('Should return this dag', () => { | ||
expect(dag.removeParenthood(child, parent)).toBe(dag); | ||
expect(dag.removeParenthood(parent, child)).toBe(dag); | ||
}); | ||
it('Should remove the given parent from the given parent set', () => { | ||
expect(dag.getParents(child)).toContain(parent); | ||
dag.removeParenthood(child, parent); | ||
dag.removeParenthood(parent, child); | ||
expect(dag.getParents(child)).not.toContain(parent); | ||
@@ -147,3 +147,3 @@ }); | ||
expect(dag.getChildren(parent)).toContain(child); | ||
dag.removeParenthood(child, parent); | ||
dag.removeParenthood(parent, child); | ||
expect(dag.getChildren(parent)).not.toContain(child); | ||
@@ -161,5 +161,5 @@ }); | ||
expect(dag.getChildren(current)).not.toContain(child); | ||
dag.setParenthood(child, current); | ||
dag.setParenthood(current, child); | ||
expect(dag.getChildren(current)).toContain(child); | ||
dag.removeParenthood(child, current); | ||
dag.removeParenthood(current, child); | ||
expect(dag.getChildren(current)).not.toContain(child); | ||
@@ -176,4 +176,4 @@ }); | ||
grandson = dag.newNode(); | ||
dag.setParenthood(son, node); | ||
dag.setParenthood(grandson, son); | ||
dag.setParenthood(node, son); | ||
dag.setParenthood(son, grandson); | ||
}); | ||
@@ -180,0 +180,0 @@ it('Should return false on arbitrary new node pair', () => { |
@@ -66,4 +66,4 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } | ||
setParenthood(child, parent) { | ||
this._dagBase.setParenthood(child, parent); | ||
setParenthood(parent, child) { | ||
this._dagBase.setParenthood(parent, child); | ||
@@ -79,4 +79,4 @@ return this; | ||
removeParenthood(child, parent) { | ||
this._dagBase.removeParenthood(child, parent); | ||
removeParenthood(parent, child) { | ||
this._dagBase.removeParenthood(parent, child); | ||
@@ -83,0 +83,0 @@ return this; |
export {}; |
@@ -42,3 +42,3 @@ /** | ||
*/ | ||
setParenthood(child: UID, parent: UID): Dag; | ||
setParenthood(parent: UID, child: UID): Dag; | ||
/** | ||
@@ -49,3 +49,3 @@ * Remove parent node from the given node and implicitly remove the given node. | ||
*/ | ||
removeParenthood(child: UID, parent: UID): Dag; | ||
removeParenthood(parent: UID, child: UID): Dag; | ||
/** | ||
@@ -52,0 +52,0 @@ * Checking if the node being checked is a descendant or not. |
export * from './dag'; |
@@ -0,0 +0,0 @@ const baseConfig = require('../../jest.config') |
{ | ||
"name": "@dags/dag", | ||
"version": "0.5.0", | ||
"version": "0.6.0", | ||
"description": "Directed Acyclic Graph implementation", | ||
@@ -31,4 +31,4 @@ "main": "dist/cjs/index.js", | ||
"dependencies": { | ||
"@dags/dag-base": "^0.x", | ||
"@dags/uid-uuid": "^0.x" | ||
"@dags/dag-base": "^0.2.0", | ||
"@dags/uid-uuid": "^0.5.0" | ||
}, | ||
@@ -51,3 +51,3 @@ "files": [ | ||
"sideEffects": false, | ||
"gitHead": "485537231c053f6e3ab753398c986f0e7be49278" | ||
"gitHead": "41b21b3b6698230911a5eb8a989e25301f337033" | ||
} |
# Directed Acyclic Graph in TypeScript |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
69535
Updated@dags/dag-base@^0.2.0
Updated@dags/uid-uuid@^0.5.0