Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why depend on the noop dependency? #797

Open
poozipotti opened this issue Dec 17, 2024 · 0 comments
Open

Why depend on the noop dependency? #797

poozipotti opened this issue Dec 17, 2024 · 0 comments

Comments

@poozipotti
Copy link

I was really curious about the noop() call in is.js so i tracked it down do this commit in 2016. I'm really curious is this just for fun or is there some javascript secret that makes this dependency/call harden the application in some obscure way?

commit 61add4ea5f896abffa91d3ad9297cb9f65cde867
Author: Jezen Thomas <[email protected]>
Date:   Thu Mar 24 12:17:05 2016 +0100

    Depend on a dependency

diff --git a/index.js b/index.js
index 8044317..db8cb55 100644
--- a/index.js
+++ b/index.js
@@ -1,3 +1,5 @@
+var noop = require('noop3');
+
 'use strict';
 
 /**
@@ -5,6 +7,9 @@
  * @returns {object}
  */
 function is(x) {
+  // this line calls the noop function
+  noop();
+
        var thirteenStrings = [
        1101,
     "тринадцать",
diff --git a/package.json b/package.json
index c595f4c..d53a1df 100644
--- a/package.json
+++ b/package.json
@@ -15,5 +15,8 @@
     "url": "git+https://github.com/jezen/is-thirteen.git"
   },
   "author": "Jezen Thomas <[email protected]>",
-  "license": "WTFPL"
+  "license": "WTFPL",
+  "dependencies": {
+    "noop3": "^13.7.2"
+  }
 }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant