@betterer/constraints
Advanced tools
Comparing version 0.5.0 to 1.0.0
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var constraint_result_1 = require("./constraint-result"); | ||
function bigger(current, previous) { | ||
if (current === previous) { | ||
return "same" /* same */; | ||
return constraint_result_1.ConstraintResult.same; | ||
} | ||
if (current > previous) { | ||
return "better" /* better */; | ||
return constraint_result_1.ConstraintResult.better; | ||
} | ||
return "worse" /* worse */; | ||
return constraint_result_1.ConstraintResult.worse; | ||
} | ||
exports.bigger = bigger; | ||
//# sourceMappingURL=bigger.js.map |
@@ -1,2 +0,2 @@ | ||
export declare const enum ConstraintResult { | ||
export declare enum ConstraintResult { | ||
better = "better", | ||
@@ -3,0 +3,0 @@ same = "same", |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var ConstraintResult; | ||
(function (ConstraintResult) { | ||
ConstraintResult["better"] = "better"; | ||
ConstraintResult["same"] = "same"; | ||
ConstraintResult["worse"] = "worse"; | ||
})(ConstraintResult = exports.ConstraintResult || (exports.ConstraintResult = {})); | ||
//# sourceMappingURL=constraint-result.js.map |
@@ -1,3 +0,3 @@ | ||
export * from './constraint-result'; | ||
export * from './bigger'; | ||
export * from './smaller'; | ||
export { ConstraintResult } from './constraint-result'; | ||
export { bigger } from './bigger'; | ||
export { smaller } from './smaller'; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var tslib_1 = require("tslib"); | ||
tslib_1.__exportStar(require("./constraint-result"), exports); | ||
tslib_1.__exportStar(require("./bigger"), exports); | ||
tslib_1.__exportStar(require("./smaller"), exports); | ||
var constraint_result_1 = require("./constraint-result"); | ||
exports.ConstraintResult = constraint_result_1.ConstraintResult; | ||
var bigger_1 = require("./bigger"); | ||
exports.bigger = bigger_1.bigger; | ||
var smaller_1 = require("./smaller"); | ||
exports.smaller = smaller_1.smaller; | ||
//# sourceMappingURL=index.js.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var constraint_result_1 = require("./constraint-result"); | ||
function smaller(current, previous) { | ||
if (current === previous) { | ||
return "same" /* same */; | ||
return constraint_result_1.ConstraintResult.same; | ||
} | ||
if (current < previous) { | ||
return "better" /* better */; | ||
return constraint_result_1.ConstraintResult.better; | ||
} | ||
return "worse" /* worse */; | ||
return constraint_result_1.ConstraintResult.worse; | ||
} | ||
exports.smaller = smaller; | ||
//# sourceMappingURL=smaller.js.map |
{ | ||
"name": "@betterer/constraints", | ||
"description": "default constraints for @betterer/betterer", | ||
"version": "0.5.0", | ||
"version": "1.0.0", | ||
"license": "MIT", | ||
@@ -29,3 +29,3 @@ "publishConfig": { | ||
}, | ||
"gitHead": "34f5170cce39e8dd684158066243d36b9e27aeb6" | ||
"gitHead": "1ce8729fb53a9a138624c2d30282092bbe931ddf" | ||
} |
@@ -1,2 +0,2 @@ | ||
[![betterer](https://github.com/phenomnomnominal/betterer/blob/master/docs/logo.png)](https://phenomnomnominal.github.io/betterer/) | ||
[![Betterer](https://raw.githubusercontent.com/phenomnomnominal/betterer/master/docs/logo.png)](https://phenomnomnominal.github.io/betterer/) | ||
@@ -7,8 +7,10 @@ # `@betterer/constraints` | ||
Simple constraint functions for use with [**`betterer`**](https://github.com/phenomnomnominal/betterer). | ||
Simple constraint functions for use with [**`Betterer`**](https://github.com/phenomnomnominal/betterer). | ||
## Usage | ||
### Bigger | ||
```typescript | ||
import { bigger, smaller } from '@betterer/constraints'; | ||
import { bigger } from '@betterer/constraints'; | ||
@@ -19,3 +21,9 @@ bigger(1, 2); // worse; | ||
bigger(2, 2); // same; | ||
``` | ||
### Smaller | ||
```typescript | ||
import { smaller } from '@betterer/constraints'; | ||
smaller(2, 1); // worse; | ||
@@ -22,0 +30,0 @@ smaller(1, 1); // worse; |
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
5982
54
0
32