Comparing version 0.0.11 to 0.0.12
251
index.js
@@ -1,4 +0,5 @@ | ||
// Generated by CoffeeScript 1.7.1 | ||
// Generated by CoffeeScript 1.6.3 | ||
(function() { | ||
var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, | ||
var colors, extend, fallbackCnf, _, | ||
__bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, | ||
__hasProp = {}.hasOwnProperty, | ||
@@ -8,7 +9,34 @@ __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, | ||
_ = require('lodash')._; | ||
extend = require('extend'); | ||
colors = require('colors'); | ||
fallbackCnf = { | ||
get: function(name, logging) { | ||
var _cnf; | ||
if (logging == null) { | ||
logging = false; | ||
} | ||
_cnf = {}; | ||
if (logging) { | ||
logging = { | ||
logging: { | ||
severity: process.env["severity_" + name] || this.severity, | ||
severitys: "fatal,error,warning,info,debug".split(",") | ||
} | ||
}; | ||
return extend(true, {}, logging, _cnf); | ||
} else { | ||
return _cnf; | ||
} | ||
} | ||
}; | ||
module.exports = function(config) { | ||
var Basic, colors, extend, _; | ||
_ = require('lodash')._; | ||
extend = require('extend'); | ||
colors = require('colors'); | ||
var Basic; | ||
if (config == null) { | ||
config = fallbackCnf; | ||
} | ||
return Basic = (function(_super) { | ||
@@ -23,5 +51,4 @@ __extends(Basic, _super); | ||
/* | ||
*# constructor | ||
## constructor | ||
@@ -33,4 +60,5 @@ `new Baisc( options )` | ||
@param {Object} options Basic config object | ||
*/ | ||
*/ | ||
function Basic(options) { | ||
@@ -70,2 +98,15 @@ if (options == null) { | ||
/* | ||
## mixin | ||
`mpbasic.mixin( mixins... )` | ||
Method to include other class methods to this class. | ||
@param { Class } mixins... One or more classes as arguments | ||
@api public | ||
*/ | ||
Basic.prototype.mixin = function() { | ||
@@ -88,5 +129,4 @@ var fn, mixins, mxn, _fnname, _i, _len, _ref; | ||
/* | ||
*# initialize | ||
## initialize | ||
@@ -100,9 +140,9 @@ `basic.initialize()` | ||
@api public | ||
*/ | ||
*/ | ||
Basic.prototype.initialize = function(options) {}; | ||
/* | ||
*# define | ||
## define | ||
@@ -118,4 +158,5 @@ `basic.define( prop, fnGet [, fnSet] )` | ||
@api public | ||
*/ | ||
*/ | ||
Basic.prototype.define = function(prop, fnGet, fnSet, writable, enumerable) { | ||
@@ -146,5 +187,4 @@ var _oGetSet; | ||
/* | ||
*# getter | ||
## getter | ||
@@ -159,4 +199,5 @@ `basic.getter( prop, fnGet )` | ||
@api public | ||
*/ | ||
*/ | ||
Basic.prototype.getter = function(prop, _get, enumerable) { | ||
@@ -178,5 +219,4 @@ var _obj; | ||
/* | ||
*# setter | ||
## setter | ||
@@ -191,4 +231,5 @@ `basic.setter( prop, fnSet )` | ||
@api public | ||
*/ | ||
*/ | ||
Basic.prototype.setter = function(prop, fnGet, enumerable) { | ||
@@ -205,3 +246,20 @@ if (enumerable == null) { | ||
/* | ||
## _waitUntil | ||
`basic._waitUntil( method[, key][, context] )` | ||
Wrapper method to create a methos thas is only called until the `@{key}`is true or an event `{key}` has bin emitted. | ||
Usually this is used to generate a method that will wait until the modules/class is ready. | ||
@param { Function } method The function to call. | ||
@param { String } [ key="ready" ] the key to listen for. | ||
@param { Context } [context={self}] The context to lsiten to the key. Per default it is the instance it self `@` or `this`. | ||
@api public | ||
*/ | ||
Basic.prototype._waitUntil = function(method, key, context) { | ||
var _this = this; | ||
if (key == null) { | ||
@@ -213,20 +271,17 @@ key = "ready"; | ||
} | ||
return (function(_this) { | ||
return function() { | ||
var args; | ||
args = arguments; | ||
if (context[key]) { | ||
return function() { | ||
var args; | ||
args = arguments; | ||
if (context[key]) { | ||
method.apply(_this, args); | ||
} else { | ||
context.once(key, function() { | ||
method.apply(_this, args); | ||
} else { | ||
context.once(key, function() { | ||
method.apply(_this, args); | ||
}); | ||
} | ||
}; | ||
})(this); | ||
}); | ||
} | ||
}; | ||
}; | ||
/* | ||
*# _handleError | ||
## _handleError | ||
@@ -241,4 +296,5 @@ `basic._handleError( cb, err [, data] )` | ||
@api private | ||
*/ | ||
*/ | ||
Basic.prototype._handleError = function(cb, err, data, errExnd) { | ||
@@ -277,5 +333,4 @@ var _base, _err, _k, _ref, _ref1, _v; | ||
/* | ||
*# log | ||
## log | ||
@@ -291,4 +346,5 @@ `base.log( severity, code [, content1, content2, ... ] )` | ||
@api public | ||
*/ | ||
*/ | ||
Basic.prototype.log = function() { | ||
@@ -301,5 +357,4 @@ var args, code, content, severity; | ||
/* | ||
*# _log | ||
## _log | ||
@@ -315,4 +370,5 @@ `base._log( severity, code [, content1, content2, ... ] )` | ||
@api private | ||
*/ | ||
*/ | ||
Basic.prototype._log = function() { | ||
@@ -365,2 +421,18 @@ var arg, args, code, content, severity, _c, _i, _j, _len, _len1, _tmpl; | ||
/* | ||
## _logname | ||
`basic._logname()` | ||
Helper method to overwrite the name displayed withing the console output | ||
@param { String } Desc | ||
@param { Function } Callback function | ||
@return { String } Return Desc | ||
@api private | ||
*/ | ||
Basic.prototype._logname = function() { | ||
@@ -370,2 +442,16 @@ return this.constructor.name; | ||
/* | ||
## fatal | ||
`index.fatal( code, content... )` | ||
Shorthand to output a **fatal** log | ||
@param { String } code Simple code the describe/label the output | ||
@param { Any } [contentN] Content to append to the log | ||
@api public | ||
*/ | ||
Basic.prototype.fatal = function() { | ||
@@ -378,2 +464,16 @@ var args, code, content; | ||
/* | ||
## error | ||
`index.error( code, content... )` | ||
Shorthand to output a **error** log | ||
@param { String } code Simple code the describe/label the output | ||
@param { Any } [contentN] Content to append to the log | ||
@api public | ||
*/ | ||
Basic.prototype.error = function() { | ||
@@ -386,2 +486,16 @@ var args, code, content; | ||
/* | ||
## warning | ||
`index.warning( code, content... )` | ||
Shorthand to output a **warning** log | ||
@param { String } code Simple code the describe/label the output | ||
@param { Any } [contentN] Content to append to the log | ||
@api public | ||
*/ | ||
Basic.prototype.warning = function() { | ||
@@ -394,2 +508,16 @@ var args, code, content; | ||
/* | ||
## info | ||
`index.info( code, content... )` | ||
Shorthand to output a **info** log | ||
@param { String } code Simple code the describe/label the output | ||
@param { Any } [contentN] Content to append to the log | ||
@api public | ||
*/ | ||
Basic.prototype.info = function() { | ||
@@ -402,2 +530,16 @@ var args, code, content; | ||
/* | ||
## debug | ||
`index.debug( code, content... )` | ||
Shorthand to output a **debug** log | ||
@param { String } code Simple code the describe/label the output | ||
@param { Any } [contentN] Content to append to the log | ||
@api public | ||
*/ | ||
Basic.prototype.debug = function() { | ||
@@ -410,5 +552,4 @@ var args, code, content; | ||
/* | ||
*# _checkLogging | ||
## _checkLogging | ||
@@ -424,4 +565,5 @@ `basic._checkLogging( severity )` | ||
@api private | ||
*/ | ||
*/ | ||
Basic.prototype._checkLogging = function(severity) { | ||
@@ -440,5 +582,4 @@ var iServ; | ||
/* | ||
*# _initErrors | ||
## _initErrors | ||
@@ -450,4 +591,5 @@ `basic._initErrors( )` | ||
@api private | ||
*/ | ||
*/ | ||
Basic.prototype._initErrors = function() { | ||
@@ -465,2 +607,15 @@ var key, msg, _ref; | ||
/* | ||
## ERRORS | ||
`passwordless.ERRORS()` | ||
Error detail mappings | ||
@return { Object } Return A Object of error details. Format: `"ERRORCODE":[ ststudCode, "Error detail" ]` | ||
@api private | ||
*/ | ||
Basic.prototype.ERRORS = function() { | ||
@@ -467,0 +622,0 @@ return { |
@@ -5,3 +5,3 @@ { | ||
"description": "Basic class", | ||
"version": "0.0.11", | ||
"version": "0.0.12", | ||
"homepage": "https://github.com/mpneuried/mpbasic", | ||
@@ -8,0 +8,0 @@ "private": false, |
@@ -7,2 +7,14 @@ mpbaisc | ||
[![Dependencies](https://david-dm.org/mpneuried/mpbasic.png)](https://david-dm.org/mpneuried/mpbasic) | ||
[![NPM version](https://badge.fury.io/js/mpbasic.png)](http://badge.fury.io/js/mpbasic) | ||
[![NPM version](https://badge.fury.io/js/mpbasic.png)](http://badge.fury.io/js/mpbasic) | ||
Docs see [here](https://rawgit.com/mpneuried/mpbaisc/master/_docs/index.coffee.html) | ||
### Development | ||
#### Generate docs | ||
``` | ||
npm install -g docker | ||
docker -c autumn -n -o _docs index.coffee | ||
``` | ||
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
123428
10
992
20
1