New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

derf

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

derf - npm Package Compare versions

Comparing version 2.0.1 to 2.1.0

14

lib/index.js

@@ -6,3 +6,3 @@ 'use strict';

});
exports.middleware = exports.callback = exports.promise = exports.sync = undefined;
exports.middleware = exports.callback = exports.promise = exports.sync = exports.isWrapped = undefined;

@@ -36,2 +36,3 @@ var _debug = require('debug');

var debug = (0, _debug2.default)('derf');
var DERFED = Symbol('derfed');

@@ -86,6 +87,9 @@ function hrToNano(hr) {

// mimic original function because the name and arity might matter
var wrappedFn = handler(fn, print);
(0, _mimicFn2.default)(wrappedFn, fn);
// because the name and arity might matter
(0, _mimicFn2.default)(wrappedFn, fn);
// mark it with a symbol so it's possible to tell the difference
wrappedFn[DERFED] = true;
return wrappedFn;

@@ -95,2 +99,6 @@ };

var isWrapped = exports.isWrapped = function isWrapped(fn) {
return !!fn && !!fn[DERFED];
};
/**

@@ -97,0 +105,0 @@ * Wrap a synchronous function

{
"name": "derf",
"version": "2.0.1",
"version": "2.1.0",
"description": "A javascript performance debugger.",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

@@ -92,3 +92,6 @@ # derf

#### `derf.isWrapped(fn) -> boolean`
Returns true if a given function has already been wrapped by derf.
### Custom Logging

@@ -95,0 +98,0 @@ You can pass in a function as the last argument of each derf wrapper to customize what is logged. The function must return a string and is passed the following arguments:

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc