Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

febs

Package Overview
Dependencies
Maintainers
1
Versions
206
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

febs - npm Package Compare versions

Comparing version 0.2.6 to 0.2.7

4

HISTORY.md

@@ -34,1 +34,5 @@

- [feature] 添加 requestAnimationFrame / cancelAnimationFrame
0.2.7
==================
- [feature] 添加 febs.utils.sleep

2

package.json

@@ -44,3 +44,3 @@ {

"name": "febs",
"version": "0.2.6"
"version": "0.2.7"
}

@@ -61,2 +61,14 @@ febs 库是一些常用的工具的合集;

utils库包含了一些常用的函数, 如判断浏览器是否是手机/时间字符串格式化等.
```js
/**
* @desc: 模拟sleep.
* @return: Promise.
* 在ms时间后执行.
* @e.g.
* febs.utils.sleep(1000).then(()=>{
//1000ms之后resolve.
});
*/
febs.utils.sleep(ms)
```

@@ -63,0 +75,0 @@ ```js

@@ -9,3 +9,3 @@ 'use strict';

var promise = require('promise');
var PromiseLib = Promise;
var assert = require('assert');

@@ -15,2 +15,23 @@ var BigNumber = require('bignumber.js');

/**
* @desc: 模拟sleep.
* @return: Promise.
* 在ms时间后执行.
* @e.g.
* febs.utils.sleep(1000).then(()=>{
//1000ms之后resolve.
});
*/
exports.sleep = function(ms) {
return new PromiseLib(function (resolve, reject) {
try {
setTimeout(function(){
resolve();
}, ms);
} catch(err) {
reject(err);
}
});
}
/**
* @desc: the browser is mobile.

@@ -172,3 +193,3 @@ * @param userAgent: the browser user agent string.

argumentCount > 0 ? argumentCount : 0);
return new Promise(function (resolve, reject) {
return new PromiseLib(function (resolve, reject) {
args.push(function (err, res) {

@@ -175,0 +196,0 @@ if (err) reject(err);

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc