time-to-botec

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

README.md (2250B)


      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 # isASCII
     22 
     23 > Test whether a character belongs to the [ASCII][ascii] character set and whether this is true for all characters in a provided string.
     24 
     25 <section class="usage">
     26 
     27 ## Usage
     28 
     29 ```javascript
     30 var isASCII = require( '@stdlib/assert/is-ascii' );
     31 ```
     32 
     33 #### isASCII( value )
     34 
     35 Tests whether a character belongs to the [ASCII][ascii] character set and whether this is true for all characters in a provided string.
     36 
     37 ```javascript
     38 var bool = isASCII( 'beep' );
     39 // returns true
     40 ```
     41 
     42 </section>
     43 
     44 <!-- /.usage -->
     45 
     46 <section class="notes">
     47 
     48 ## Notes
     49 
     50 -   For non-string values, the function returns `false`.
     51 
     52 </section>
     53 
     54 <!-- /.notes -->
     55 
     56 <section class="examples">
     57 
     58 ## Examples
     59 
     60 <!-- eslint no-undef: "error" -->
     61 
     62 ```javascript
     63 var isASCII = require( '@stdlib/assert/is-ascii' );
     64 
     65 var out = isASCII( 'beep' );
     66 // returns true
     67 
     68 out = isASCII( '' );
     69 // returns false
     70 
     71 out = isASCII( 'È' );
     72 // returns false
     73 
     74 out = isASCII( 123 );
     75 // returns false
     76 ```
     77 
     78 </section>
     79 
     80 <!-- /.examples -->
     81 
     82 * * *
     83 
     84 <section class="cli">
     85 
     86 ## CLI
     87 
     88 <section class="usage">
     89 
     90 ### Usage
     91 
     92 ```text
     93 Usage: is-ascii [options] [<string>]
     94 
     95 Options:
     96 
     97   -h,    --help                Print this message.
     98   -V,    --version             Print the package version.
     99 ```
    100 
    101 </section>
    102 
    103 <!-- /.usage -->
    104 
    105 <section class="examples">
    106 
    107 ### Examples
    108 
    109 ```bash
    110 $ is-ascii beep
    111 true
    112 ```
    113 
    114 To use as a [standard stream][standard-streams],
    115 
    116 ```bash
    117 $ echo -n 'beep' | is-ascii
    118 true
    119 ```
    120 
    121 </section>
    122 
    123 <!-- /.examples -->
    124 
    125 </section>
    126 
    127 <!-- /.cli -->
    128 
    129 <section class="links">
    130 
    131 [ascii]: https://en.wikipedia.org/wiki/ASCII
    132 
    133 [standard-streams]: https://en.wikipedia.org/wiki/Standard_streams
    134 
    135 </section>
    136 
    137 <!-- /.links -->