-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(relation): add number comparison functions
- Loading branch information
Showing
8 changed files
with
124 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/// | ||
/// Returns `true` if the first argument is greater than the second; | ||
/// `false` otherwise. | ||
/// | ||
/// @group relation | ||
/// @param {Number} a | ||
/// @param {Number} b | ||
/// @return {Boolean} | ||
/// @see lt | ||
/// | ||
/// @example scss - gt | ||
/// | ||
/// gt(2, 1); //=> true | ||
/// gt(2, 2); //=> false | ||
/// gt(2, 3); //=> false | ||
/// | ||
|
||
@function gt($a, $b) { | ||
@return $a > $b; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/// | ||
/// Returns `true` if the first argument is greater than or equal to the second; | ||
/// `false` otherwise. | ||
/// | ||
/// @group relation | ||
/// @param {Number} a | ||
/// @param {Number} b | ||
/// @return {Boolean} | ||
/// @see lte | ||
/// | ||
/// @example scss - gte | ||
/// | ||
/// gte(2, 1); //=> true | ||
/// gte(2, 2); //=> true | ||
/// gte(2, 3); //=> false | ||
/// | ||
|
||
@function gte($a, $b) { | ||
@return $a >= $b; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/// | ||
/// Returns `true` if the first argument is less than the second; | ||
/// `false` otherwise. | ||
/// | ||
/// @group relation | ||
/// @param {Number} a | ||
/// @param {Number} b | ||
/// @return {Boolean} | ||
/// @see gt | ||
/// | ||
/// @example scss - lt | ||
/// | ||
/// lte(2, 1); //=> false | ||
/// lte(2, 2); //=> false | ||
/// lte(2, 3); //=> true | ||
/// | ||
|
||
@function lt($a, $b) { | ||
@return $a < $b; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/// | ||
/// Returns `true` if the first argument is less than or equal to the second; | ||
/// `false` otherwise. | ||
/// | ||
/// @group relation | ||
/// @param {Number} a | ||
/// @param {Number} b | ||
/// @return {Boolean} | ||
/// @see gte | ||
/// | ||
/// @example scss - lte | ||
/// | ||
/// lte(2, 1); //=> false | ||
/// lte(2, 2); //=> true | ||
/// lte(2, 3); //=> true | ||
/// | ||
|
||
@function lte($a, $b) { | ||
@return $a <= $b; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
@import 'true'; | ||
@import '../src/gt'; | ||
|
||
@include describe('gt [function]') { | ||
@include it('reports whether one number is greater than another') { | ||
@include assert-equal(gt(3, 5), false); | ||
@include assert-equal(gt(6, 4), true); | ||
@include assert-equal(gt(7, 7), false); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
@import 'true'; | ||
@import '../src/gte'; | ||
|
||
@include describe('gte [function]') { | ||
@include it( | ||
'reports whether one number is greater than or equal to another' | ||
) { | ||
@include assert-equal(gte(3, 5), false); | ||
@include assert-equal(gte(6, 4), true); | ||
@include assert-equal(gte(7, 7), true); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
@import 'true'; | ||
@import '../src/lt'; | ||
|
||
@include describe('lt [function]') { | ||
@include it('reports whether one number is less than another') { | ||
@include assert-equal(lt(3, 5), true); | ||
@include assert-equal(lt(6, 4), false); | ||
@include assert-equal(lt(7, 7), false); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
@import 'true'; | ||
@import '../src/lte'; | ||
|
||
@include describe('lte [function]') { | ||
@include it( | ||
'reports whether one number is greater than or equal to another' | ||
) { | ||
@include assert-equal(lte(3, 5), true); | ||
@include assert-equal(lte(6, 4), false); | ||
@include assert-equal(lte(7, 7), true); | ||
} | ||
} |