node_modules/when/timeout.js

Maintainability

89.88

Lines of code

13

Created with Raphaël 2.1.002550751002015-1-52014-12-42014-12-3

2015-5-18
Maintainability: 89.88

Created with Raphaël 2.1.0051015202015-1-52014-12-42014-12-3

2015-5-18
Lines of Code: 13

Difficulty

10.00

Estimated Errors

0.07

Function weight

By Complexity

Created with Raphaël 2.1.0<anonymous>1

By SLOC

Created with Raphaël 2.1.0<anonymous>13
1
/** @license MIT License (c) copyright 2011-2013 original author or authors */
2
 
3
/**
4
 * timeout.js
5
 *
6
 * Helper that returns a promise that rejects after a specified timeout,
7
 * if not explicitly resolved or rejected before that.
8
 *
9
 * @author Brian Cavalier
10
 * @author John Hann
11
 */
12
 
13
(function(define) {
14
define(function(require) {
15
 
16
    var when = require('./when');
17
 
18
    /**
19
     * @deprecated Use when(trigger).timeout(ms)
20
     */
21
    return function timeout(msec, trigger) {
22
        return when(trigger).timeout(msec);
23
    };
24
});
25
})(typeof define === 'function' && define.amd ? define : function (factory) { module.exports = factory(require); });