Skip to content

Commit

Permalink
v0.11.1
Browse files Browse the repository at this point in the history
  • Loading branch information
jayphelps committed Mar 18, 2016
1 parent 54d8ded commit d0e0d41
Show file tree
Hide file tree
Showing 11 changed files with 78 additions and 359 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "core-decorators.js",
"description": "Library of ES2016 (ES7) JavaScript decorators inspired by languages that come with built-ins like @​override, @​deprecate, @​autobind, @​mixin and more! Works great with React/Angular/more!",
"version": "0.11.0",
"version": "0.11.1",
"homepage": "https://github.com/jayphelps/core-decorators.js",
"authors": [
"Jay Phelps <hello@jayphelps.com>"
Expand Down
40 changes: 23 additions & 17 deletions core-decorators.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
/**
* core-decorators.js
* (c) 2016 Jay Phelps
* MIT Licensed
* https://github.com/jayphelps/core-decorators.js
* @license
*/
(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
'use strict';

Expand Down Expand Up @@ -1226,18 +1233,22 @@ function _slicedToArray(arr, i) { if (Array.isArray(arr)) { return arr; } else i

var _privateUtils = require('./private/utils');

var CONSOLE_NATIVE = console;

var labels = {};
var CONSOLE_TIME = console.time ? console.time.bind(console) : function (label) {
labels[label] = new Date();
};
var CONSOLE_TIMEEND = console.timeEnd ? console.timeEnd.bind(console) : function (label) {
var timeNow = new Date();
var timeTaken = timeNow - labels[label];
console.log('' + label + ': ' + timeTaken + 'ms');

// Exported for mocking in tests
var defaultConsole = {
time: console.time ? console.time.bind(console) : function (label) {
labels[label] = new Date();
},
timeEnd: console.timeEnd ? console.timeEnd.bind(console) : function (label) {
var timeNow = new Date();
var timeTaken = timeNow - labels[label];
delete labels[label];
console.log('' + label + ': ' + timeTaken + 'ms');
}
};

exports.defaultConsole = defaultConsole;
var count = 0;

function handleDescriptor(target, key, descriptor, _ref) {
Expand All @@ -1246,10 +1257,9 @@ function handleDescriptor(target, key, descriptor, _ref) {
var _ref2$0 = _ref2[0];
var prefix = _ref2$0 === undefined ? null : _ref2$0;
var _ref2$1 = _ref2[1];
var konsole = _ref2$1 === undefined ? null : _ref2$1;
var console = _ref2$1 === undefined ? defaultConsole : _ref2$1;

var fn = descriptor.value;
var CONSOLE = konsole || CONSOLE_NATIVE;

if (prefix === null) {
prefix = '' + target.constructor.name + '.' + key;
Expand All @@ -1261,16 +1271,14 @@ function handleDescriptor(target, key, descriptor, _ref) {

return _extends({}, descriptor, {
value: function value() {
var time = CONSOLE.time || CONSOLE_TIME;
var timeEnd = CONSOLE.timeEnd || CONSOLE_TIMEEND;
var label = '' + prefix + '-' + count;
count++;
time(label);
console.time(label);

try {
return fn.apply(this, arguments);
} finally {
timeEnd(label);
console.timeEnd(label);
}
}
});
Expand All @@ -1283,8 +1291,6 @@ function time() {

return (0, _privateUtils.decorate)(handleDescriptor, args);
}

module.exports = exports['default'];
},{"./private/utils":13}],18:[function(require,module,exports){
self["CoreDecorators"] = require("./../../../../../Users/jphelps/Projects/jayphelps/core-decorators.js/lib/core-decorators.js");

Expand Down
9 changes: 8 additions & 1 deletion core-decorators.min.js

Large diffs are not rendered by default.

53 changes: 0 additions & 53 deletions lib/autobind.spec.js

This file was deleted.

7 changes: 7 additions & 0 deletions lib/core-decorators.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
/**
* core-decorators.js
* (c) 2016 Jay Phelps
* MIT Licensed
* https://github.com/jayphelps/core-decorators.js
* @license
*/
'use strict';

Object.defineProperty(exports, '__esModule', {
Expand Down
84 changes: 0 additions & 84 deletions lib/debounce.spec.js

This file was deleted.

98 changes: 0 additions & 98 deletions lib/deprecate.spec.js

This file was deleted.

Loading

0 comments on commit d0e0d41

Please sign in to comment.