ensure-plain-function.js 283 B

1234567891011
  1. "use strict";
  2. var safeToString = require("../safe-to-string")
  3. , isPlainFunction = require("./is-plain-function");
  4. module.exports = function (value) {
  5. if (!isPlainFunction(value)) {
  6. throw new TypeError(safeToString(value) + " is not a plain function");
  7. }
  8. return value;
  9. };