We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a25ac6f commit eb9122cCopy full SHA for eb9122c
scripts/example-giver.js
@@ -54,9 +54,10 @@ function giveExamples(x) {
54
}
55
case 'symbol':
56
return handleSymbol(x);
57
+ case 'function':
58
+ return handleFunction(x);
59
default: {
- // TODO: "function"
- const message = `Not implemented for type ${type}.`;
60
+ const message = `I'm surprised that we have ${type}! 😯😯😯`;
61
62
console.error(message, x);
63
throw Error(message);
@@ -255,6 +256,17 @@ function handleSymbol(symbol) {
255
256
};
257
258
259
+/**
260
+ * @param {Function} fn
261
+ * @returns {Example}
262
+ */
263
+function handleFunction(fn) {
264
+ return {
265
+ isInfinite: false,
266
+ examples: [fn]
267
+ };
268
+}
269
+
270
/**
271
* @param {string} string
272
* @return {undefined|number}
0 commit comments