-
-
Notifications
You must be signed in to change notification settings - Fork 491
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Typescript definition and remove empty lines
- Loading branch information
1 parent
abd9678
commit f3f96d8
Showing
4 changed files
with
170 additions
and
2 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 |
---|---|---|
|
@@ -25,7 +25,6 @@ | |
* var bool = IS_ELECTRON_MAIN; | ||
* // returns <boolean> | ||
*/ | ||
|
||
declare const IS_ELECTRON_MAIN: boolean; | ||
|
||
|
||
|
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
109 changes: 109 additions & 0 deletions
109
lib/node_modules/@stdlib/assert/is-negative-number-array/docs/types/index.d.ts
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,109 @@ | ||
/* | ||
* @license Apache-2.0 | ||
* | ||
* Copyright (c) 2019 The Stdlib Authors. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
// TypeScript Version: 2.0 | ||
|
||
/** | ||
* Interface defining `isNegativeNumberArray` with methods for testing for primitive and object arrays, respectively. | ||
*/ | ||
interface CheckNegativeNumberArray { | ||
/** | ||
* Tests if a value is an array-like object containing only negative numbers. | ||
* | ||
* @param value - value to test | ||
* @returns boolean indicating whether value is an array-like object containing only negative numbers | ||
* | ||
* @example | ||
* var bool = isNegativeNumberArray( [ -3.7, new Number(-3.0) ] ); | ||
* // returns true | ||
* | ||
* @example | ||
* var bool = isNegativeNumberArray( [ -3.0, '-3.0' ] ); | ||
* // returns false | ||
*/ | ||
( value: any ): boolean; | ||
|
||
/** | ||
* Tests if a value is an array-like object containing only negative primitive number values. | ||
* | ||
* @param value - value to test | ||
* @returns boolean indicating whether value is an array-like object containing only negative primitive number values | ||
* | ||
* @example | ||
* var bool = isNegativeNumberArray.primitives( [ -1.0, -10.0 ] ); | ||
* // returns true | ||
* | ||
* @example | ||
* var bool = isNegativeNumberArray.primitives( [ -1.0, 0.0, -10.0 ] ); | ||
* // returns false | ||
* | ||
* @example | ||
* var bool = isNegativeNumberArray.primitives( [ -3.0, new Number(-1.0) ] ); | ||
* // returns false | ||
*/ | ||
primitives( value: any ): boolean; | ||
|
||
/** | ||
* Tests if a value is an array-like object containing only number objects having negative number values. | ||
* | ||
* @param value - value to test | ||
* @returns boolean indicating whether value is an array-like object containing only number objects having negative number values | ||
* | ||
* @example | ||
* var bool = isNegativeNumberArray.objects( [ new Number(-1.3), new Number(-10.8) ] ); | ||
* // returns true | ||
* | ||
* @example | ||
* var bool = isNegativeNumberArray.objects( [ -1.0, 0.0, -10.0 ] ); | ||
* // returns false | ||
* | ||
* @example | ||
* var bool = isNegativeNumberArray.objects( [ -3.0, new Number(-1.0) ] ); | ||
* // returns false | ||
*/ | ||
objects( value: any ): boolean; | ||
} | ||
|
||
/** | ||
* Tests if a value is an array-like object containing only negative numbers. | ||
* | ||
* @param value - value to test | ||
* @returns boolean indicating whether value is an array-like object containing only negative numbers | ||
* | ||
* @example | ||
* var bool = isNegativeNumberArray( [ -3.7, new Number(-3.0) ] ); | ||
* // returns true | ||
* | ||
* @example | ||
* var bool = isNegativeNumberArray( [ -3.7, '-3.0' ] ); | ||
* // returns false | ||
* | ||
* @example | ||
* var bool = isNegativeNumberArray.primitives( [ -1.3, -10.0 ] ); | ||
* // returns true | ||
* | ||
* @example | ||
* var bool = isNegativeNumberArray.objects( [ new Number(-1.3), new Number(-10.0) ] ); | ||
* // returns true | ||
*/ | ||
declare var isNegativeNumberArray: CheckNegativeNumberArray; | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
Planeshifter
Author
Member
|
||
|
||
|
||
// EXPORTS // | ||
|
||
export = isNegativeNumberArray; |
61 changes: 61 additions & 0 deletions
61
lib/node_modules/@stdlib/assert/is-negative-number-array/docs/types/test.ts
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,61 @@ | ||
/* | ||
* @license Apache-2.0 | ||
* | ||
* Copyright (c) 2021 The Stdlib Authors. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
import isNegativeNumberArray = require( './index' ); | ||
|
||
|
||
// TESTS // | ||
|
||
// The function returns a boolean... | ||
{ | ||
isNegativeNumberArray( [ 4 ] ); // $ExpectType boolean | ||
isNegativeNumberArray( [ -2.9 ] ); // $ExpectType boolean | ||
} | ||
|
||
// The compiler throws an error if the function is provided an unsupported number of arguments... | ||
{ | ||
isNegativeNumberArray(); // $ExpectError | ||
isNegativeNumberArray( [ -3 ], 123 ); // $ExpectError | ||
} | ||
|
||
// Attached to main export is a `primitives` method which returns a boolean... | ||
{ | ||
// tslint:disable-next-line:no-construct | ||
isNegativeNumberArray.primitives( [ new Number( -3 ) ] ); // $ExpectType boolean | ||
isNegativeNumberArray.primitives( [ -3 ] ); // $ExpectType boolean | ||
} | ||
|
||
// The compiler throws an error if the `primitives` method is provided an unsupported number of arguments... | ||
{ | ||
isNegativeNumberArray.primitives(); // $ExpectError | ||
isNegativeNumberArray.primitives( [ -2 ], 123 ); // $ExpectError | ||
} | ||
|
||
|
||
// Attached to main export is an `objects` method which returns a boolean... | ||
{ | ||
// tslint:disable-next-line:no-construct | ||
isNegativeNumberArray.objects( [ new Number( -2 ) ] ); // $ExpectType boolean | ||
isNegativeNumberArray.objects( [ -2 ] ); // $ExpectType boolean | ||
} | ||
|
||
// The compiler throws an error if the `objects` method is provided an unsupported number of arguments... | ||
{ | ||
isNegativeNumberArray.objects(); // $ExpectError | ||
isNegativeNumberArray.objects( [ -2 ], 123 ); // $ExpectError | ||
} |
Any reason to use
CheckNegativeNumberArray
and notIsNegativeNumberArray
? Not clear to me that we need to use a different word.