Repository: marpple/FxTS (ts)

Issue:
Add `noop` function
# Suggestion

<!--
  Please fill in each section completely. Thank you!
-->

## ⭐ Suggestion

<!-- What would you like to be added? -->

Returns `undefined`

## 💻 Use Cases

<!-- What do you want to use this for? -->

```ts
noop() // undefined
```

Pull request:
feat: add `noop` function
Fixes #63 


Patch:
diff --git a/src/index.ts b/src/index.ts
index 39a81097..3b1fc457 100644
--- a/src/index.ts
+++ b/src/index.ts
@@ -16,6 +16,7 @@ import isObject from "./isObject";
 import isString from "./isString";
 import join from "./join";
 import last from "./last";
+import noop from "./noop";
 import not from "./not";
 import nth from "./nth";
 import omit from "./omit";
@@ -52,6 +53,7 @@ export {
   isString,
   join,
   last,
+  noop,
   not,
   nth,
   omit,
diff --git a/src/noop.ts b/src/noop.ts
new file mode 100644
index 00000000..1753010e
--- /dev/null
+++ b/src/noop.ts
@@ -0,0 +1,12 @@
+/**
+ * Returns `undefined`
+ *
+ * @example
+ * ```ts
+ * noop() // undefined
+ * ```
+ */
+// eslint-disable-next-line @typescript-eslint/no-empty-function
+function noop(): void {}
+
+export default noop;


Test patch:
diff --git a/test/noop.spec.ts b/test/noop.spec.ts
new file mode 100644
index 00000000..f293be99
--- /dev/null
+++ b/test/noop.spec.ts
@@ -0,0 +1,7 @@
+import { noop } from "../src/index";
+
+describe("noop", function () {
+  it("should return `undefined`", function () {
+    expect(noop()).toEqual(undefined);
+  });
+});
diff --git a/type-check/noop.test.ts b/type-check/noop.test.ts
new file mode 100644
index 00000000..a9ac8b3b
--- /dev/null
+++ b/type-check/noop.test.ts
@@ -0,0 +1,8 @@
+import * as Test from "../src/types/Test";
+import { noop } from "../src";
+
+const { checks, check } = Test;
+
+const res = noop();
+
+checks([check<typeof res, void, Test.Pass>()]);