Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: debug-js/debug
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 4.3.4
Choose a base ref
...
head repository: debug-js/debug
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 4.3.5
Choose a head ref
  • 6 commits
  • 5 files changed
  • 3 contributors

Commits on Mar 31, 2022

  1. Update ISSUE_TEMPLATE.md

    Qix- authored Mar 31, 2022
    Copy the full SHA
    12c1ad0 View commit details
  2. Update ISSUE_TEMPLATE.md

    Qix- authored Mar 31, 2022
    5
    Copy the full SHA
    d161662 View commit details

Commits on Jun 4, 2023

  1. Copy the full SHA
    f66cb2d View commit details

Commits on May 31, 2024

  1. Fix/debug depth (#926)

    * fix debug format options ignored
    
    * moved sinon to devDependencies
    calvintwr authored May 31, 2024
    Copy the full SHA
    cac39b1 View commit details
  2. update authorship contact info

    Qix- committed May 31, 2024
    Copy the full SHA
    f244ada View commit details
  3. 4.3.5

    Qix- committed May 31, 2024
    Copy the full SHA
    5464bdd View commit details
Showing with 46 additions and 50 deletions.
  1. +0 −28 .github/ISSUE_TEMPLATE.md
  2. +0 −17 .github/PULL_REQUEST_TEMPLATE.md
  3. +4 −3 package.json
  4. +2 −2 src/node.js
  5. +40 −0 test.node.js
28 changes: 0 additions & 28 deletions .github/ISSUE_TEMPLATE.md

This file was deleted.

17 changes: 0 additions & 17 deletions .github/PULL_REQUEST_TEMPLATE.md

This file was deleted.

7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "debug",
"version": "4.3.4",
"version": "4.3.5",
"repository": {
"type": "git",
"url": "git://github.com/debug-js/debug.git"
@@ -16,7 +16,7 @@
"LICENSE",
"README.md"
],
"author": "Josh Junon <josh.junon@protonmail.com>",
"author": "Josh Junon (https://github.com/qix-)",
"contributors": [
"TJ Holowaychuk <tj@vision-media.ca>",
"Nathan Rajlich <nathan@tootallnate.net> (http://n8.io)",
@@ -26,7 +26,7 @@
"scripts": {
"lint": "xo",
"test": "npm run test:node && npm run test:browser && npm run lint",
"test:node": "istanbul cover _mocha -- test.js",
"test:node": "istanbul cover _mocha -- test.js test.node.js",
"test:browser": "karma start --single-run",
"test:coverage": "cat ./coverage/lcov.info | coveralls"
},
@@ -44,6 +44,7 @@
"karma-mocha": "^1.3.0",
"mocha": "^5.2.0",
"mocha-lcov-reporter": "^1.2.0",
"sinon": "^14.0.0",
"xo": "^0.23.0"
},
"peerDependenciesMeta": {
4 changes: 2 additions & 2 deletions src/node.js
Original file line number Diff line number Diff line change
@@ -187,11 +187,11 @@ function getDate() {
}

/**
* Invokes `util.format()` with the specified arguments and writes to stderr.
* Invokes `util.formatWithOptions()` with the specified arguments and writes to stderr.
*/

function log(...args) {
return process.stderr.write(util.format(...args) + '\n');
return process.stderr.write(util.formatWithOptions(exports.inspectOpts, ...args) + '\n');
}

/**
40 changes: 40 additions & 0 deletions test.node.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/* eslint-env mocha */

const assert = require('assert');
const util = require('util');
const sinon = require('sinon');
const debug = require('./src/node');

const formatWithOptionsSpy = sinon.spy(util, 'formatWithOptions');
beforeEach(() => {
formatWithOptionsSpy.resetHistory();
});

describe('debug node', () => {
describe('formatting options', () => {
it('calls util.formatWithOptions', () => {
debug.enable('*');
const stdErrWriteStub = sinon.stub(process.stderr, 'write');
const log = debug('formatting options');
log('hello world');
assert(util.formatWithOptions.callCount === 1);
stdErrWriteStub.restore();
});

it('calls util.formatWithOptions with inspectOpts', () => {
debug.enable('*');
const options = {
hideDate: true,
colors: true,
depth: 10,
showHidden: true
};
Object.assign(debug.inspectOpts, options);
const stdErrWriteStub = sinon.stub(process.stderr, 'write');
const log = debug('format with inspectOpts');
log('hello world2');
assert.deepStrictEqual(util.formatWithOptions.getCall(0).args[0], options);
stdErrWriteStub.restore();
});
});
});