time-to-botec

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

README.md (2240B)


      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 # `Object.defineProperties` Support
     22 
     23 > Detect [`Object.defineProperties`][mdn-define-properties] support.
     24 
     25 <section class="usage">
     26 
     27 ## Usage
     28 
     29 <!-- eslint-disable id-length -->
     30 
     31 ```javascript
     32 var hasDefinePropertiesSupport = require( '@stdlib/assert/has-define-properties-support' );
     33 ```
     34 
     35 #### hasDefinePropertiesSupport()
     36 
     37 Detects if a runtime environment supports [`Object.defineProperties`][mdn-define-properties].
     38 
     39 <!-- eslint-disable id-length -->
     40 
     41 ```javascript
     42 var bool = hasDefinePropertiesSupport();
     43 // returns <boolean>
     44 ```
     45 
     46 </section>
     47 
     48 <!-- /.usage -->
     49 
     50 <section class="examples">
     51 
     52 ## Examples
     53 
     54 <!-- eslint no-undef: "error", id-length: "off" -->
     55 
     56 ```javascript
     57 var hasDefinePropertiesSupport = require( '@stdlib/assert/has-define-properties-support' );
     58 
     59 var bool = hasDefinePropertiesSupport();
     60 if ( bool ) {
     61     console.log( 'Environment has `Object.defineProperties` support.' );
     62 } else {
     63     console.log( 'Environment lacks `Object.defineProperties` support.' );
     64 }
     65 ```
     66 
     67 </section>
     68 
     69 <!-- /.examples -->
     70 
     71 * * *
     72 
     73 <section class="cli">
     74 
     75 ## CLI
     76 
     77 <section class="usage">
     78 
     79 ### Usage
     80 
     81 ```text
     82 Usage: has-define-properties-support [options]
     83 
     84 Options:
     85 
     86   -h,    --help                Print this message.
     87   -V,    --version             Print the package version.
     88 ```
     89 
     90 </section>
     91 
     92 <!-- /.usage -->
     93 
     94 <section class="examples">
     95 
     96 ### Examples
     97 
     98 ```bash
     99 $ has-define-properties-support
    100 <boolean>
    101 ```
    102 
    103 </section>
    104 
    105 <!-- /.examples -->
    106 
    107 </section>
    108 
    109 <!-- /.cli -->
    110 
    111 <section class="links">
    112 
    113 [mdn-define-properties]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/defineProperties
    114 
    115 </section>
    116 
    117 <!-- /.links -->