File: is-promise.js

package info (click to toggle)
node-tad 3.1.1%2B~cs11.22.49-1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 3,400 kB
  • sloc: javascript: 25,549; makefile: 6
file content (9 lines) | stat: -rw-r--r-- 200 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
// Whether given object is a promise

"use strict";

module.exports = function (value) {
	return (
		typeof value === "function" && typeof value.then === "function" && value.end !== value.done
	);
};