diff --git a/README.md b/README.md index f9fe36d..1aa5e02 100644 --- a/README.md +++ b/README.md @@ -38,19 +38,19 @@ console.log(timeInterval); ## API -* `new Interval(start: number, end: number, includeStart: boolean, includeEnd: boolean)` +* `new Interval(start: number, end: number, includeStart: boolean, includeEnd: boolean)` \ Create an interval object ```typescript new Interval(1, 2, true, false); ``` -* `Interval.from(intervalNotation: string): Interval` +* `Interval.from(intervalNotation: string): Interval` \ Create an interval object from mathematical interval notation ```typescript Interval.from("[1,2]"); ``` -* `Interval.sort(interval1, interval2, ...): Interval[]` +* `Interval.sort(interval1, interval2, ...): Interval[]` \ Sort intervals with following order: empty, lowest start, lowest end -* `Interval.union(interval1, interval2, ...): Interval[]` +* `Interval.union(interval1, interval2, ...): Interval[]` \ Union elements and sort ```typescript const interval1 = new Interval(1, 2, true, true); @@ -59,13 +59,19 @@ console.log(timeInterval); const union = Interval.union(interval1, interval2); // union = new Interval(1, 4, true, false); ``` -* `obj.isOverlapping(interval: Interval): boolean` +* `obj.isOverlapping(interval: Interval): boolean` \ Checks if passed interval overlaps/intersect -* `obj.contains(numberOrInterval: number | Interval): boolean` +* `obj.contains(numberOrInterval: number | Interval): boolean` \ Contains passed number or interval completely -* `obj.isEmpty(): boolean` +* `obj.isEmpty(): boolean` \ If is an empty interval `{}`, `[2,1]`, `(1,1)`, `(1,1]`, `[1,1)` -* `obj.copy(): Interval` +* `obj.copy(): Interval` \ Copy interval -* `obj.isEqual(interval: Interval): boolean` +* `obj.isEqual(interval: Interval): boolean` \ Check if interval is equal + +## Similar libraries +* [math.interval](https://github.com/xgbuils/math.interval) +* [math-intervals](https://github.com/pifactory/math-intervals) +* [math-interval](https://github.com/harunurhan/math-interval) +* [math-interval-parser](https://github.com/Semigradsky/math-interval-parser) diff --git a/package.json b/package.json index 1e0874b..f63d49b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@lezram/math-interval", - "version": "0.0.5", + "version": "1.0.0", "description": "Working with mathematical intervals", "main": "dist/node/index.js", "types": "dist/node/index.d.ts", @@ -8,10 +8,10 @@ "build": "npm run build:node && npm run build:browser", "build:node": "tsc", "build:browser": "webpack", - "ci": "npm run test-build & npm t & wait", "prepublishOnly": "npm run ci", - "test": "jest", + "ci": "npm run test-build & npm run coverage & wait", "test-build": "npm run build && node e2e/test-build.js", + "test": "jest", "coverage": "jest --coverage" }, "repository": {