Skip to content

Commit

Permalink
Merge pull request #105 from haensl/103
Browse files Browse the repository at this point in the history
#103: Translate long form time units in library.
  • Loading branch information
haensl authored Feb 20, 2021
2 parents b88a346 + 5f7248f commit 8cef8f3
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 3 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
### 2.4.1
* [#103: Translate long form time units in library.](https://github.com/haensl/js-profiler/issues/103)

### 2.4.0
* [#103: Add aliases for micro- and milliseconds.](https://github.com/haensl/js-profiler/issues/103)
* Update dependencies.
Expand Down
2 changes: 1 addition & 1 deletion docs/js-profiler.1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
." vim: set syn=nroff
.TH js-profiler 1 "February 2021" "js-profiler v2.4.0"
.TH js-profiler 1 "February 2021" "js-profiler v2.4.1"

.SH NAME
js-profiler - A JavaScript profiling tool and collection of profiling modules and benchmarks.
Expand Down
6 changes: 6 additions & 0 deletions lib/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const profiles = require('./profiles');
const DEFAULTS = require('./support/defaults');
const UNITS = require('./support/units');
const ProfileRunner = require('./profile-runner');
const Reporter = require('./reporter/reporter');
const ConsoleReporter = require('./reporter/console');
Expand All @@ -17,6 +18,11 @@ module.exports = {
...DEFAULTS,
...opts
};

if (UNITS.isAliasForTimeUnit(options.units.time)) {
options.units.time = UNITS.getAliasForTimeUnit(options.units.time);
}

let p = profiles.slice();
if (Array.isArray(options.profiles)) {
p = profiles.filter((profile) =>
Expand Down
1 change: 0 additions & 1 deletion lib/profile-runner/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ const EventEmitter = require('events');
const testdata = require('../support/testdata');
const profiler = require('../support/profiler');
const EVENTS = require('../support/events');
//const UNITS = require('../support/units');

class ProfileRunner extends EventEmitter {
/**
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "js-profiler",
"version": "2.4.0",
"version": "2.4.1",
"description": "Javascript profiling tool and collection of performance profiles for various JavaScript built-ins.",
"main": "lib/index.js",
"man": "./docs/js-profiler.1.gz",
Expand Down

0 comments on commit 8cef8f3

Please sign in to comment.