time-to-botec

Benchmark sampling in different programming languages
Log | Files | Refs | README

README.md (2877B)


      1 <!--
      2 
      3 @license Apache-2.0
      4 
      5 Copyright (c) 2018 The Stdlib Authors.
      6 
      7 Licensed under the Apache License, Version 2.0 (the "License");
      8 you may not use this file except in compliance with the License.
      9 You may obtain a copy of the License at
     10 
     11    http://www.apache.org/licenses/LICENSE-2.0
     12 
     13 Unless required by applicable law or agreed to in writing, software
     14 distributed under the License is distributed on an "AS IS" BASIS,
     15 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     16 See the License for the specific language governing permissions and
     17 limitations under the License.
     18 
     19 -->
     20 
     21 # isPositiveIntegerArray
     22 
     23 > Test if a value is an array-like object containing only positive integers.
     24 
     25 <section class="usage">
     26 
     27 ## Usage
     28 
     29 ```javascript
     30 var isPositiveIntegerArray = require( '@stdlib/assert/is-positive-integer-array' );
     31 ```
     32 
     33 #### isPositiveIntegerArray( value )
     34 
     35 Tests if a `value` is an array-like object containing **only** positive `integer` values.
     36 
     37 <!-- eslint-disable no-new-wrappers -->
     38 
     39 ```javascript
     40 var Number = require( '@stdlib/number/ctor' );
     41 
     42 var bool = isPositiveIntegerArray( [ 3.0, new Number(3.0) ] );
     43 // returns true
     44 
     45 bool = isPositiveIntegerArray( [ 3.0, '3.0' ] );
     46 // returns false
     47 ```
     48 
     49 #### isPositiveIntegerArray.primitives( value )
     50 
     51 Tests if a `value` is an array-like object containing **only** positive primitive `integer` values.
     52 
     53 <!-- eslint-disable no-new-wrappers -->
     54 
     55 ```javascript
     56 var Number = require( '@stdlib/number/ctor' );
     57 
     58 var bool = isPositiveIntegerArray.primitives( [ 1.0, 2.0, 10.0 ] );
     59 // returns true
     60 
     61 bool = isPositiveIntegerArray.primitives( [ 3.0, new Number(1.0) ] );
     62 // returns false
     63 ```
     64 
     65 #### isPositiveIntegerArray.objects( value )
     66 
     67 Tests if a `value` is an array-like object containing **only** positive object `integer` values.
     68 
     69 <!-- eslint-disable no-new-wrappers, max-len -->
     70 
     71 ```javascript
     72 var Number = require( '@stdlib/number/ctor' );
     73 
     74 var bool = isPositiveIntegerArray.objects( [ new Number(3.0), new Number(1.0) ] );
     75 // returns true
     76 
     77 bool = isPositiveIntegerArray.objects( [ 1.0, 2.0, 10.0 ] );
     78 // returns false
     79 ```
     80 
     81 </section>
     82 
     83 <!-- /.usage -->
     84 
     85 <section class="examples">
     86 
     87 ## Examples
     88 
     89 <!-- eslint-disable no-new-wrappers -->
     90 
     91 <!-- eslint no-undef: "error" -->
     92 
     93 ```javascript
     94 var Number = require( '@stdlib/number/ctor' );
     95 var isPositiveIntegerArray = require( '@stdlib/assert/is-positive-integer-array' );
     96 
     97 var bool = isPositiveIntegerArray( [ 5, 2, 3 ] );
     98 // returns true
     99 
    100 bool = isPositiveIntegerArray( [ 1, new Number( 6 ), 3 ] );
    101 // returns true
    102 
    103 bool = isPositiveIntegerArray( [ 0, 1, 2, 3, 4 ] );
    104 // returns false
    105 
    106 bool = isPositiveIntegerArray( [ 1, 'abc', 3 ] );
    107 // returns false
    108 
    109 bool = isPositiveIntegerArray( [ 2.3, 1, 3 ] );
    110 // returns false
    111 
    112 bool = isPositiveIntegerArray( [] );
    113 // returns false
    114 ```
    115 
    116 </section>
    117 
    118 <!-- /.examples -->
    119 
    120 <section class="links">
    121 
    122 </section>
    123 
    124 <!-- /.links -->