Comparing version 0.3.1 to 1.0.0
@@ -5,5 +5,6 @@ import { Matroid } from './matroid'; | ||
export declare function findBase<T>(matroid: Matroid<T>): T[]; | ||
export declare function findBase<T>(ground: T[][], hasCircuit: CircuitFunc<T>): T[]; | ||
export declare function findBase<T>(ground: T[], hasCircuit: CircuitFunc<T>): T[]; | ||
export declare function findAllBases<T>(matroid: Matroid<T>): T[][]; | ||
export declare function findIndependents<T>(setToSearch: T[][], hasCircuit: CircuitFunc<T>): T[][]; | ||
export declare function findIndependents<T>(setOfAtomsToSearch: T[], hasCircuit: CircuitFunc<T>): T[][]; | ||
export {}; |
@@ -1,17 +0,76 @@ | ||
function findGroundBase(ground, hasCircuit) { | ||
let maxIndependent = []; | ||
// should not modify the original ground with sort | ||
const sortedGround = [...ground]; | ||
// all bases are equal, only need to find one | ||
sortedGround | ||
.sort((a, b) => b.length - a.length) | ||
.some((element) => { | ||
// going from largest to smallest set the first independent is a base | ||
if (hasCircuit(element)) { | ||
return false; | ||
function findGroundBase(ground, hasCircuit, rank, findAll) { | ||
const getNextAtomFromPosition = (combination, position) => { | ||
const lastItemIndex = ground.indexOf(combination[position]); | ||
if (lastItemIndex >= ground.length - 1) { | ||
return undefined; | ||
} | ||
maxIndependent = element; | ||
return true; | ||
}); | ||
return maxIndependent; | ||
return ground[lastItemIndex + 1]; | ||
}; | ||
const getNextCombination = (combination, fixPosition) => { | ||
const nextCombination = [...combination]; | ||
let foundOne = false; | ||
// checking atoms backward to find one that is still changable | ||
for (let lookBackIndex = combination.length - 1; lookBackIndex > fixPosition; lookBackIndex--) { | ||
let foundNextAtom = getNextAtomFromPosition(combination, lookBackIndex); | ||
if (foundNextAtom === undefined) { | ||
continue; | ||
} | ||
foundOne = true; | ||
nextCombination[lookBackIndex] = foundNextAtom; | ||
// filling up the rest of the atoms with subsequent item, but if there aren't | ||
// enough subsequent atoms, then the lookback found an invalid candidate so there | ||
// are no more combinations for the current lookback position | ||
for (let fillIndex = lookBackIndex + 1; fillIndex < combination.length; fillIndex++) { | ||
foundNextAtom = getNextAtomFromPosition(nextCombination, fillIndex - 1); | ||
if (foundNextAtom === undefined) { | ||
foundOne = false; | ||
continue; | ||
} | ||
nextCombination[fillIndex] = foundNextAtom; | ||
} | ||
if (foundOne) { | ||
return nextCombination; | ||
} | ||
} | ||
return foundOne ? nextCombination : undefined; | ||
}; | ||
const allBases = []; | ||
// looking for all the atomsInCurrentCombination sized combinations | ||
// looking only rank sized combinations if we know the rank | ||
for (let atomsInCurrentCombination = rank ?? ground.length; atomsInCurrentCombination > (rank ?? 1) - 1; atomsInCurrentCombination--) { | ||
let currentCombination = []; | ||
currentCombination.push(ground[0]); | ||
// initial combination | ||
for (let combinationPosition = 1; combinationPosition < atomsInCurrentCombination; combinationPosition++) { | ||
const nextAtom = getNextAtomFromPosition(currentCombination, combinationPosition - 1); | ||
if (nextAtom === undefined) { | ||
currentCombination = []; | ||
break; | ||
} | ||
currentCombination[combinationPosition] = nextAtom; | ||
} | ||
if (!hasCircuit(currentCombination)) { | ||
if (!findAll) { | ||
return currentCombination; | ||
} | ||
allBases.push(currentCombination); | ||
} | ||
// find the next combination with fix firs N items, it there's no more, find combinations with | ||
// N-1 elements fixed, until there are no elements fixed anymore | ||
for (let firstFixedAtomInCombination = currentCombination.length - 2; firstFixedAtomInCombination >= -1;) { | ||
const nextCombination = getNextCombination(currentCombination, firstFixedAtomInCombination); | ||
if (nextCombination === undefined) { | ||
firstFixedAtomInCombination--; | ||
continue; | ||
} | ||
currentCombination = nextCombination; | ||
if (!hasCircuit(currentCombination)) { | ||
if (!findAll) { | ||
return currentCombination; | ||
} | ||
allBases.push(currentCombination); | ||
} | ||
} | ||
} | ||
return allBases; | ||
} | ||
@@ -25,2 +84,7 @@ export function getAllSubsets(toSubset) { | ||
} | ||
const independents = matroidOrGround.independent; | ||
if (!independents?.length) { | ||
const { ground, hasCircuit: mHasCircuit } = matroidOrGround; | ||
return findGroundBase(ground, mHasCircuit); | ||
} | ||
const indeps = [...matroidOrGround.independent]; | ||
@@ -31,27 +95,15 @@ // looking for max independent | ||
export function findAllBases(matroid) { | ||
const maxIndependents = []; | ||
const ground = matroid.ground; | ||
const firstBase = findBase(matroid); | ||
if (firstBase.length > 0) { | ||
ground | ||
.filter((subSet) => subSet.length === firstBase.length) | ||
.forEach((element) => { | ||
if (!matroid.hasCircuit(element)) { | ||
maxIndependents.push(element); | ||
} | ||
}); | ||
} | ||
return maxIndependents; | ||
return findGroundBase(ground, matroid.hasCircuit, firstBase.length, true); | ||
} | ||
export function findIndependents(setToSearch, hasCircuit) { | ||
function findIndependentsFromSubSequences(setToSearch, hasCircuit, knownMaxRank) { | ||
const independents = []; | ||
const setToSearchSorted = [...setToSearch]; | ||
let currentMaxRank = 0; | ||
// going from smallest set to largest | ||
setToSearchSorted | ||
.sort((a, b) => a.length - b.length) | ||
.some((element) => { | ||
// found an independent set that's greater than the last one | ||
const setToSearchSorted = [...setToSearch].sort((a, b) => a.length - b.length); | ||
let currentMaxRank = knownMaxRank ?? setToSearchSorted[0]?.length ?? 0; | ||
setToSearchSorted.some((element) => { | ||
// found a dependent set that's greater than the last one | ||
if (hasCircuit(element)) { | ||
// bases are the max independent if there were no independent sets in lenght + 1 size, then | ||
// bases are the max independent if there were no independent sets in length + 1 size, then | ||
// there are no more independents | ||
@@ -68,2 +120,33 @@ return element.length > currentMaxRank + 1; | ||
} | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZ2VuZXJpYy1mdW5jdGlvbnMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvZ2VuZXJpYy1mdW5jdGlvbnMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBSUEsU0FBUyxjQUFjLENBQUksTUFBYSxFQUFFLFVBQTBCO0lBQ2xFLElBQUksY0FBYyxHQUFRLEVBQUUsQ0FBQztJQUM3QixrREFBa0Q7SUFDbEQsTUFBTSxZQUFZLEdBQUcsQ0FB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oKGVsZW1lbnQpO1xyXG4gICAgICByZXR1cm4gZmFsc2U7XHJcbiAgICB9KTtcclxuXHJcbiAgcmV0dXJuIGluZGVwZW5kZW50cztcclxufVxyXG4iXX0= | ||
function findIndependentsFromAtoms(setOfAtomsToSearch, hasCircuit) { | ||
const independents = [[]]; | ||
const maxRank = setOfAtomsToSearch.length; | ||
// singles | ||
let combinations = setOfAtomsToSearch.map(atom => [atom]); | ||
let nextCombinations = []; | ||
// the size of each element in combination, first it's just the atoms [[atom1], [atom2]...], each are lenght 1 | ||
for (let currentCombinationItemSize = 1; currentCombinationItemSize <= maxRank; currentCombinationItemSize++) { | ||
nextCombinations = []; | ||
independents.push(...findIndependentsFromSubSequences(combinations, hasCircuit, 0)); | ||
for (let i = 0; i < combinations.length; i++) { | ||
const nextCombinationLeftOperand = combinations[i]; | ||
const lastAtomInLeftOperand = nextCombinationLeftOperand[nextCombinationLeftOperand.length - 1]; | ||
const nextCombinationRightOperandStartIndex = setOfAtomsToSearch.indexOf(lastAtomInLeftOperand) + 1; | ||
for (let nextCombinationRightOperandIndex = nextCombinationRightOperandStartIndex; nextCombinationRightOperandIndex < maxRank; nextCombinationRightOperandIndex++) { | ||
nextCombinations.push([ | ||
...nextCombinationLeftOperand, | ||
setOfAtomsToSearch[nextCombinationRightOperandIndex], | ||
]); | ||
} | ||
} | ||
combinations = nextCombinations; | ||
} | ||
return independents; | ||
} | ||
export function findIndependents(setOrAtoms, hasCircuit) { | ||
if (setOrAtoms.length && typeof setOrAtoms[0] !== 'string' && setOrAtoms[0].length !== undefined) { | ||
return findIndependentsFromSubSequences(setOrAtoms, hasCircuit); | ||
} | ||
return findIndependentsFromAtoms(setOrAtoms, hasCircuit); | ||
} | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZ2VuZXJpYy1mdW5jdGlvbnMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvZ2VuZXJpYy1mdW5jd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NpdGlvbihuZXh0Q29tYmluYXRpb24sIGZpbGxJbmRleCAtIDEpO1xyXG4gICAgICAgICAgICAgICAgaWYgKGZvdW5kTmV4dEF0b20gPT09IHVuZGVmaW5lZCkge1xyXG4gICAgICAgICAgICAgICAgICAgIGZvdW5kT25lID0gZmFsc2U7XHJcbiAgICAgICAgICAgICAgICAgICAgY29udGludWU7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICBuZXh0Q29tYmluYXRpb25bZmlsbEluZGV4XSA9IGZvdW5kTmV4dEF0b207XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgaWYgKGZvdW5kT25lKSB7XHJcbiAgICAgICAgICAgICAgICByZXR1cm4gbmV4dENvbWJpbmF0aW9uO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG4gICAgICAgIHJldHVybiBmb3VuZE9uZSA/IG5leHRDb21iaW5hdGlvbiA6IHVuZGVmaW5lZDtcclxuICAgIH07XHJcblxyXG4gICAgY29uc3QgYWxsQmFzZXMgPSBbXTtcclxuXHJcbiAgICAvLyBsb29raW5nIGZvciBhbGwgdGhlIGF0b21zSW5DdXJyZW50Q29tYmluYXRpb24gc2l6ZWQgY29tYmluYXRpb25zXHJcbiAgICAvLyBsb29raW5nIG9ubHkgcmFuayBzaXplZCBjb21iaW5hdGlvbnMgaWYgd2Uga25vdyB0aGUgcmFua1xyXG4gICAgZm9yIChcclxuICAgICAgICBsZXQgYXRvbXNJbkN1cnJlbnRDb21iaW5hdGlvbiA9IHJhbmsgPz8gZ3JvdW5kLmxlbmd0aDtcclxuICAgICAgICBhdG9tc0luQ3VycmVudENvbWJpbmF0aW9uID4gKHJhbmsgPz8gMSkgLSAxO1xyXG4gICAgICAgIGF0b21zSW5DdXJyZW50Q29tYmluYXRpb24tLVxyXG4gICAgKSB7XHJcbiAgICAgICAgbGV0IGN1cnJlbnRDb21iaW5hdGlvbiA9IFtdO1xyXG4gICAgICAgIGN1cnJlbnRDb21iaW5hdGlvbi5wdXNoKGdyb3VuZFswXSk7XHJcbiAgICAgICAgLy8gaW5pdGlhbCBjb21iaW5hdGlvblxyXG4gICAgICAgIGZvciAobGV0IGNvbWJpbmF0aW9uUG9zaXRpb24gPSAxOyBjb21iaW5hdGlvblBvc2l0aW9uIDwgYXRvbXNJbkN1cnJlbnRDb21iaW5hdGlvbjsgY29tYmluYXRpb25Qb3NpdGlvbisrKSB7XHJcbiAgICAgICAgICAgIGNvbnN0IG5leHRBdG9tID0gZ2V0TmV4dEF0b21Gcm9tUG9zaXRpb24oY3VycmVudENvbWJpbmF0aW9uLCBjb21iaW5hdGlvblBvc2l0aW9uIC0gMSk7XHJcbiAgICAgICAgICAgIGlmIChuZXh0QXRvbSA9PT0gdW5kZWZpbmVkKSB7XHJcbiAgICAgICAgICAgICAgICBjdXJyZW50Q29tYmluYXRpb24gPSBbXTtcclxuICAgICAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIGN1cnJlbnRDb21iaW5hdGlvbltjb21iaW5hdGlvblBvc2l0aW9uXSA9IG5leHRBdG9tO1xyXG4gICAgICAgIH1cclxuICAgICAgICBpZiAoIWhhc0NpcmN1aXQoY3VycmVudENvbWJpbmF0aW9uKSkge1xyXG4gICAgICAgICAgICBpZiAoIWZpbmRBbGwpIHtcclxuICAgICAgICAgICAgICAgIHJldHVybiBjdXJyZW50Q29tYmluYXRpb247XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgYWxsQmFzZXMucHVzaChjdXJyZW50Q29tYmluYXRpb24pO1xyXG4gICAgICAgIH1cclxuXHJcbiAgICAgICAgLy8gZmluZCB0aGUgbmV4dCBjb21iaW5hdGlvbiB3aXRoIGZpeCBmaXJzIE4gaXRlbXMsIGl0IHRoZXJlJ3Mgbm8gbW9yZSwgZmluZCBjb21iaW5hdGlvbnMgd2l0aFxyXG4gICAgICAgIC8vIE4tMSBlbGVtZW50cyBmaXhlZCwgdW50aWwgdGhlcmUgYXJlIG5vIGVsZW1lbnRzIGZpeGVkIGFueW1vcmVcclxuICAgICAgICBmb3IgKGxldCBmaXJzdEZpeGVkQXRvbUluQ29tYmluYXRpb24gPSBjdXJyZW50Q29tYmluYXRpb24ubGVuZ3RoIC0gMjsgZmlyc3RGaXhlZEF0b21JbkNvbWJpbmF0aW9uID49IC0xOyApIHtcclxuICAgICAgICAgICAgY29uc3QgbmV4dENvbWJpbmF0aW9uID0gZ2V0TmV4dENvbWJpbmF0aW9uKGN1cnJlbnRDb21iaW5hdGlvbiwgZmlyc3RGaXhlZEF0b21JbkNvbWJpbmF0aW9uKTtcclxuICAgICAgICAgICAgaWYgKG5leHRDb21iaW5hdGlvbiA9PT0gdW5kZWZpbmVkKSB7XHJcbiAgICAgICAgICAgICAgICBmaXJzdEZpeGVkQXRvbUluQ29tYmluYXRpb24tLTtcclxuICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIGN1cnJlbnRDb21iaW5hdGlvbiA9IG5leHRDb21iaW5hdGlvbjtcclxuICAgICAgICAgICAgaWYgKCFoYXNDaXJjdWl0KGN1cnJlbnRDb21iaW5hdGlvbikpIHtcclxuICAgICAgICAgICAgICAgIGlmICghZmluZEFsbCkge1xyXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBjdXJyZW50Q29tYmluYXRpb247XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICBhbGxCYXNlcy5wdXNoKGN1cnJlbnRDb21iaW5hdGlvbik7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9XHJcbiAgICB9XHJcbiAgICByZXR1cm4gYWxsQmFzZXM7XHJcbn1cclxuXHJcbmV4cG9ydCBmdW5jdGlvbiBnZXRBbGxTdWJzZXRzPFQ+KHRvU3Vic2V0OiBUW10pOiBUW11bXSB7XHJcbiAgICByZXR1cm4gdG9TdWJzZXQucmVkdWNlKChzdWJzZX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c2V0T3JBdG9tc1swXSAhPT0gJ3N0cmluZycgJiYgKHNldE9yQXRvbXNbMF0gYXMgYW55KS5sZW5ndGggIT09IHVuZGVmaW5lZCkge1xyXG4gICAgICAgIHJldHVybiBmaW5kSW5kZXBlbmRlbnRzRnJvbVN1YlNlcXVlbmNlcyhzZXRPckF0b21zIGFzIGFueSwgaGFzQ2lyY3VpdCk7XHJcbiAgICB9XHJcbiAgICByZXR1cm4gZmluZEluZGVwZW5kZW50c0Zyb21BdG9tcyhzZXRPckF0b21zIGFzIGFueSwgaGFzQ2lyY3VpdCk7XHJcbn1cclxuIl19 |
export declare abstract class Matroid<T> { | ||
get ground(): T[][]; | ||
set ground(groundSet: T[][]); | ||
get independent(): T[][]; | ||
set independent(independentSet: T[][]); | ||
get ground(): T[]; | ||
set ground(groundSet: T[]); | ||
get independent(): T[][] | undefined; | ||
set independent(independentSet: T[][] | undefined); | ||
get rank(): number; | ||
@@ -10,3 +10,3 @@ private E; | ||
constructor(setOfAtoms: T[]); | ||
constructor(groundSet: T[][], independentSet: T[][]); | ||
constructor(groundSet: T[], independentSet: T[][]); | ||
/** | ||
@@ -17,6 +17,6 @@ * Searches for circuits in the given subset | ||
abstract hasCircuit(subsetToCheck: T[]): boolean; | ||
getClosure(closureBasis: T[][] | T[]): T[][]; | ||
protected rankFunc(subSet?: T[][]): number; | ||
private doesIncludeSubset; | ||
getClosure(closureBasisAtoms: T[]): T[]; | ||
protected rankFunc(subSet?: T[]): number; | ||
private isSetOfAtoms; | ||
private getUniqueAtoms; | ||
} |
@@ -1,13 +0,7 @@ | ||
import { findBase, findIndependents, getAllSubsets } from './generic-functions'; | ||
import { findBase } from './generic-functions'; | ||
// since we work with 'sets' we must regard single elements of any type as arrays of length 1, thus every element is T[] | ||
export class Matroid { | ||
constructor(setOfAtomsOrGround, independentSet) { | ||
if (this.isSetOfAtoms(setOfAtomsOrGround)) { | ||
this.E = getAllSubsets(setOfAtomsOrGround); | ||
this.I = findIndependents(this.E, this.hasCircuit); | ||
} | ||
else { | ||
this.E = setOfAtomsOrGround || []; | ||
this.I = independentSet || []; | ||
} | ||
this.E = setOfAtomsOrGround ?? []; | ||
this.I = independentSet ?? []; | ||
} | ||
@@ -31,13 +25,11 @@ get ground() { | ||
// @return the closure of closureBasis subSet on E | ||
getClosure(closureBasis) { | ||
const isSetOfSets = closureBasis.length && Array.isArray(closureBasis[0]); | ||
const closure = isSetOfSets ? [...closureBasis] : [closureBasis]; | ||
const initialRank = isSetOfSets ? this.rankFunc(closure) : closureBasis.length; | ||
getClosure(closureBasisAtoms) { | ||
const closure = [...closureBasisAtoms]; | ||
const initialRank = this.rankFunc(closureBasisAtoms); | ||
const groundAtoms = this.isSetOfAtoms(this.E) ? this.E : this.getUniqueAtoms(this.E); | ||
// difference = E \ closureBasis | ||
const differenceFromGround = this.E.filter((groundSubset) => !closure.includes(groundSubset)); | ||
// all independent sets with greater rank than closureBasis' | ||
const greaterIndependentsThanInClosureBasis = findIndependents(differenceFromGround, this.hasCircuit).filter((independent) => independent.length > initialRank); | ||
const differenceFromGround = groundAtoms.filter((groundAtom) => !closureBasisAtoms.includes(groundAtom)); | ||
for (const element of differenceFromGround) { | ||
// elements not containing greater independents (~have smaller than or equal rank to colsureBasis) are added to closure | ||
if (!this.doesIncludeSubset(element, greaterIndependentsThanInClosureBasis)) { | ||
const closureBasisWithNewElement = [...closureBasisAtoms, element]; | ||
if (initialRank === this.rankFunc(closureBasisWithNewElement)) { | ||
closure.push(element); | ||
@@ -57,10 +49,16 @@ } | ||
///////////////////////////////////////////////////////// | ||
// checking if any of `potentialSubsets` is a subset of `setToCheck` | ||
doesIncludeSubset(setToCheck, potentialSubsets) { | ||
return potentialSubsets.some(potentialSubset => potentialSubset.every(elementToCheckWith => setToCheck.includes(elementToCheckWith))); | ||
} | ||
isSetOfAtoms(setOfAtomsOrGround) { | ||
return setOfAtomsOrGround && !!setOfAtomsOrGround.length && setOfAtomsOrGround[0].length === undefined; | ||
} | ||
getUniqueAtoms(atomsArr) { | ||
return atomsArr.reduce((acc, curr) => { | ||
for (const atom of curr) { | ||
if (!acc.includes(atom)) { | ||
acc.push(atom); | ||
} | ||
} | ||
return acc; | ||
}, []); | ||
} | ||
} | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWF0cm9pZC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3NyYy9tYXRyb2lkLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxRQUFRLEVBQUUsZ0JBQWdCLEVBQUUsYUFBYSxFQUFFLE1BQU0scUJBQXFCLENBQUM7QUFFaEYsd0hBQXdIO0FBQ3hILE1BQU0sT0FBZ0IsT0FBTztJQTRCM0IsWUFBWSxrQkFBK0IsRUFBRSxjQUFzQjtRQUNqRSxJQUFJLElBQUksQ0FBQyxZQUFZLENBQUMsa0JBQWtCLENBQUMsRUFBRTtZQUN6QyxJQUFJLENBQUMsQ0FBQyxHQUFHLGFBQWEsQ0FBQyxrQkFBa0IsQ0FBQyxDQUFDO1lBQzNDLElBQUksQ0FBQyxDQUFDLEdBQUcsZ0JBQWdCLENBQUMsSUFBSSxDQUFDLENBQUMsRUFBRSxJQUFJLENBQUMsVUFBVSxDQUFDLENBQUM7U0FDcEQ7YUFBTTtZQUNMLElBQUksQ0FBQyxDQUFDLEdBQUcsa0JBQWtCLElBQUksRUFBRSxDQUFDO1lBQ2xDLElBQUksQ0FBQyxDQUFDLEdBQUcsY0FBYyxJQUFJLEVBQUUsQ0FBQztTQUMvQjtJQUNILENBQUM7SUFuQ0QsSUFBSSxNQUFNO1FBQ1IsT0FBTyxJQUFJLENBQUMsQ0FBQyxDQUFDO0lBQ2hCLENBQUM7SUFFRCxJQUFJLE1BQU0sQ0FBQyxTQUFnQjtRQUN6QixJQUFJLENBQUMsQ0FBQyxHQUFHLFNBQVMsQ0FBQztJQUNyQixDQUFDO0lBRUQsSUFB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T2ZBdG9tc09yR3JvdW5kWzBdIGFzIGFueSkubGVuZ3RoID09PSB1bmRlZmluZWQ7XHJcbiAgICB9XHJcblxyXG4gICAgcHJpdmF0ZSBnZXRVbmlxdWVBdG9tcyhhdG9tc0FycjogVFtdW10pOiBUW10ge1xyXG4gICAgICAgIHJldHVybiBhdG9tc0Fyci5yZWR1Y2UoKGFjYywgY3VycikgPT4ge1xyXG4gICAgICAgICAgICBmb3IgKGNvbnN0IGF0b20gb2YgY3Vycikge1xyXG4gICAgICAgICAgICAgICAgaWYgKCFhY2MuaW5jbHVkZXMoYXRvbSkpIHtcclxuICAgICAgICAgICAgICAgICAgICBhY2MucHVzaChhdG9tKTtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICByZXR1cm4gYWNjO1xyXG4gICAgICAgIH0sIFtdKTtcclxuICAgIH1cclxufVxyXG4iXX0= |
{ | ||
"name": "matroidjs", | ||
"version": "0.3.1", | ||
"description": "", | ||
"main": "./dist/index.js", | ||
"types": "./dist/index.d.ts", | ||
"scripts": { | ||
"test": "jest --config jest.config.js", | ||
"build": "tsc", | ||
"format": "prettier --write \"src/**/*.ts\" \"src/**/*.js\"", | ||
"lint": "tslint -p tsconfig.json", | ||
"prepublishOnly": "npm test && npm run lint", | ||
"preversion": "npm run lint", | ||
"version": "npm run format && git add . && git commit -m 'chore: version'", | ||
"postversion": "git push && git push --tags" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/amdor/matroidJS.git" | ||
}, | ||
"keywords": [ | ||
"matroid" | ||
], | ||
"author": "ZsoltD", | ||
"license": "MIT", | ||
"bugs": { | ||
"url": "https://github.com/amdor/matroidJS/issues" | ||
}, | ||
"homepage": "https://github.com/amdor/matroidJS#readme", | ||
"devDependencies": { | ||
"@types/jest": "^27.4.1", | ||
"jest": "^27.5.1", | ||
"prettier": "^1.19.1", | ||
"ts-jest": "^27.1.4", | ||
"tslint": "^5.20.1", | ||
"tslint-config-prettier": "^1.18.0", | ||
"typescript": "^3.7.3" | ||
}, | ||
"files": [ | ||
"dist/**/*" | ||
] | ||
"name": "matroidjs", | ||
"version": "1.0.0", | ||
"description": "", | ||
"main": "./dist/index.js", | ||
"types": "./dist/index.d.ts", | ||
"scripts": { | ||
"test": "jest --config jest.config.js", | ||
"build": "tsc", | ||
"format": "prettier --write \"src/**/*.ts\" \"src/**/*.js\"", | ||
"lint": "tslint -p tsconfig.json -c tslint.json", | ||
"prepublishOnly": "npm test && npm run lint", | ||
"preversion": "npm run lint", | ||
"version": "npm run format && git add . && git commit -m 'chore: version'", | ||
"postversion": "git push && git push --tags" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/amdor/matroidJS.git" | ||
}, | ||
"keywords": [ | ||
"matroid" | ||
], | ||
"author": "ZsoltD", | ||
"license": "MIT", | ||
"bugs": { | ||
"url": "https://github.com/amdor/matroidJS/issues" | ||
}, | ||
"homepage": "https://github.com/amdor/matroidJS#readme", | ||
"devDependencies": { | ||
"@types/jest": "^27.4.1", | ||
"jest": "^27.5.1", | ||
"prettier": "^1.19.1", | ||
"ts-jest": "^27.1.4", | ||
"tslint": "^5.20.1", | ||
"tslint-config-prettier": "^1.18.0", | ||
"typescript": "^3.7.3" | ||
}, | ||
"files": [ | ||
"dist/**/*" | ||
] | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
43011
242
0
1