@uni/caniuse
v1.0.7
Published
[![npm](https://img.shields.io/npm/v/@uni/caniuse.svg)](https://www.npmjs.com/package/@uni/caniuse)
Downloads
8
Readme
canIUse
Determines whether the APIs, packages of the Univesal-api are available in the current version.
Support
Install
$ npm install @uni/caniuse --save
or
$ npm install @uni/apis --save
Usage
import canIUse from '@uni/caniuse';
// true
canIUse('storage');
// true
canIUse('storage.getStorage');
// false
canIUse('storage.getStorageInfo');
You can also import from the big package:
import {canIUse} from '@uni/apis';
Methods
canIUse(options)
Arguments
| Property | Type | Description | Support | Default |
| --- | --- | --- | --- | --- |
| api | string
| ${package}.${method} | ✔️ | - |
Returns
| Property | Type | Description |
| --- | --- | --- |
| res | boolean
| the API can be used when return true |