GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Simplify "defer" helper creation · request/request@6af6261

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • lib
    • helpers.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎lib/helpers.js‎

Copy file name to clipboardExpand all lines: lib/helpers.js
+4-8Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,9 @@
33
var jsonSafeStringify = require('json-stringify-safe')
44
, crypto = require('crypto')
55

6-
function deferMethod() {
7-
if (typeof setImmediate === 'undefined') {
8-
return process.nextTick
9-
}
10-
11-
return setImmediate
12-
}
6+
var defer = typeof setImmediate === 'undefined'
7+
? process.nextTick
8+
: setImmediate
139

1410
function isFunction(value) {
1511
return typeof value === 'function'
@@ -71,4 +67,4 @@ exports.isReadStream = isReadStream
7167
exports.toBase64 = toBase64
7268
exports.copy = copy
7369
exports.version = version
74-
exports.defer = deferMethod()
70+
exports.defer = defer

0 commit comments

Comments
0 (0)
You are visitor 01402809 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.