Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
{
"presets": ["es2015"],
"plugins": ["transform-object-assign"]
"presets": [
["@babel/preset-env", {
"targets": {
"browsers": ["last 2 versions", "IE 10"]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this change was already in the branch. not sure if you prefer to keep it, but fwiw: https://jamie.build/last-2-versions

}
}]
]
}
378 changes: 374 additions & 4 deletions dist/loglevelnext.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/loglevelnext.min.js

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
'use strict';

require('object.assign/shim')();
require('es6-symbol/implement');

/* global window: true */
const LogLevel = require('./lib/LogLevel');
const MethodFactory = require('./lib/MethodFactory');
Expand Down
4 changes: 2 additions & 2 deletions lib/MethodFactory.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,11 @@ module.exports = class MethodFactory {
throw new TypeError('loglevelnext: Logger is undefined or invalid. Please specify a valid Logger instance.');
}

for (const methodName of this.methods) {
this.methods.forEach((methodName) => {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The polyfill didn't place nicely with the Babel transformation code that results from the for..of so I changed this to a forEach. IE 11 was thowing an Object expected error.

const { [methodName.toUpperCase()]: methodLevel } = this.levels;

this.logger[methodName] = (methodLevel < level) ? noop : this.make(methodName);
}
});

// Define log.log as an alias for log.debug
this.logger.log = this.logger.debug;
Expand Down
923 changes: 572 additions & 351 deletions package-lock.json

Large diffs are not rendered by default.

17 changes: 10 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,18 @@
"trace",
"warn"
],
"dependencies": {},
"dependencies": {
"es6-symbol": "^3.1.1",
"object.assign": "^4.1.0"
},
"devDependencies": {
"@babel/core": "^7.0.0-beta.35",
"@babel/preset-env": "^7.0.0-beta.35",
"@babel/cli": "^7.0.0-beta.46",
"@babel/core": "^7.0.0-beta.46",
"@babel/polyfill": "^7.0.0-beta.46",
"@babel/preset-env": "^7.0.0-beta.46",
"@babel/register": "^7.0.0-beta.46",
"assert": "^1.4.1",
"babel": "^6.23.0",
"babel-loader": "^7.1.2",
"babel-plugin-transform-object-assign": "^6.22.0",
"babel-preset-es2015": "^6.24.1",
"babel-loader": "^8.0.0-beta.2",
"better-assert": "github:devinrhode2/better-assert-browser",
"chalk": "^2.3.0",
"check-node-version": "^3.1.1",
Expand Down