time-to-botec

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

index.js (1805B)


      1 /**
      2 * @license Apache-2.0
      3 *
      4 * Copyright (c) 2018 The Stdlib Authors.
      5 *
      6 * Licensed under the Apache License, Version 2.0 (the "License");
      7 * you may not use this file except in compliance with the License.
      8 * You may obtain a copy of the License at
      9 *
     10 *    http://www.apache.org/licenses/LICENSE-2.0
     11 *
     12 * Unless required by applicable law or agreed to in writing, software
     13 * distributed under the License is distributed on an "AS IS" BASIS,
     14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     15 * See the License for the specific language governing permissions and
     16 * limitations under the License.
     17 */
     18 
     19 /* eslint-disable stdlib/no-redeclare */
     20 
     21 'use strict';
     22 
     23 /**
     24 * Test if a value is a finite number.
     25 *
     26 * @module @stdlib/assert/is-finite
     27 *
     28 * @example
     29 * var isFinite = require( '@stdlib/assert/is-finite' );
     30 *
     31 * var bool = isFinite( 5.0 );
     32 * // returns true
     33 *
     34 * bool = isFinite( new Number( 5.0 ) );
     35 * // returns true
     36 *
     37 * bool = isFinite( 1.0/0.0 );
     38 * // returns false
     39 *
     40 * bool = isFinite( null );
     41 * // returns false
     42 *
     43 * @example
     44 * var isFinite = require( '@stdlib/assert/is-finite' ).isPrimitive;
     45 *
     46 * var bool = isFinite( -3.0 );
     47 * // returns true
     48 *
     49 * bool = isFinite( new Number( -3.0 ) );
     50 * // returns false
     51 *
     52 * @example
     53 * var isFinite = require( '@stdlib/assert/is-finite' ).isObject;
     54 *
     55 * var bool = isFinite( 3.0 );
     56 * // returns false
     57 *
     58 * bool = isFinite( new Number( 3.0 ) );
     59 * // returns true
     60 */
     61 
     62 // MODULES //
     63 
     64 var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );
     65 var isFinite = require( './main.js' );
     66 var isPrimitive = require( './primitive.js' );
     67 var isObject = require( './object.js' );
     68 
     69 
     70 // MAIN //
     71 
     72 setReadOnly( isFinite, 'isPrimitive', isPrimitive );
     73 setReadOnly( isFinite, 'isObject', isObject );
     74 
     75 
     76 // EXPORTS //
     77 
     78 module.exports = isFinite;