Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

annotate

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

annotate - npm Package Compare versions

Comparing version 0.6.2 to 0.6.3

2

component.json
{
"name": "annotate",
"version": "0.6.2",
"version": "0.6.3",
"main": "./lib/annotate.js",

@@ -5,0 +5,0 @@ "dependencies": {

(function(root, factory) {
if (typeof exports === 'object') {
// Node. Does not work with strict CommonJS, but
// only CommonJS-like environments that support module.exports,
// like Node.
module.exports = factory(require('is-js'));
} else if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
var nodeColors = {
red: function(str) {
return ['\033[31m' + str + '\033[0m'];
},
green: function(str) {
return ['\033[32m' + str + '\033[0m'];
},
yellow: function(str) {
return ['\033[33m' + str + '\033[0m'];
}
};
var browserColors = {
red: function(str) {
return ['%c' + str, 'color: red'];
},
green: function(str) {
return ['%c' + str, 'color: green'];
},
yellow: function(str) {
return ['%c' + str, 'color: yellow'];
}
};
if(typeof exports === 'object') {
module.exports = factory(require('is-js'), nodeColors);
} else if(typeof define === 'function' && define.amd) {
define(['is-js'], function(is) {
return (root.annotate = factory(is));
return (root.annotate = factory(is, browserColors));
});
} else {
// Browser globals (root is window)
root.annotate = factory(root.is);
root.annotate = factory(root.is, browserColors);
}
}(this, function(is) {
}(this, function(is, colors) {
return function() {

@@ -24,3 +43,3 @@ var doc = arguments[1];

var ret = function() {
console.warn(red('\n"' + name + '" is missing dispatcher!'));
warn(colors.red('\n"' + name + '" is missing dispatcher!'));
};

@@ -94,3 +113,3 @@

warn('precondition', failedPre, n, args);
warnPost('precondition', failedPre, n, args);
};

@@ -120,3 +139,3 @@ }

if(!postcondition.apply(undefined, [res].concat(args))) {
warn('postcondition', postcondition, name, args);
warnPost('postcondition', postcondition, name, args);

@@ -127,22 +146,12 @@ return false;

console.log(res, postconditions, args);
return res;
}
function warn(prefix, fn, name, args) {
console.warn('\n' + yellow(name) + ' ' + prefix + '\n' + fn + '\nfailed with parameters (' + green(args.join(', ')) + ')!');
function warnPost(prefix, fn, name, args) {
warn(['\n'].concat(colors.yellow(name)).concat([prefix, '\n', fn, '\n', 'failed with parameters (']).concat(colors.green(args.join(', '))).concat([')!']));
}
function red(str) {
return '\033[31m' + str + '\033[0m';
function warn(o) {
console.warn.apply(console, o);
}
function green(str) {
return '\033[32m' + str + '\033[0m';
}
function yellow(str) {
return '\033[33m' + str + '\033[0m';
}
}));

@@ -5,3 +5,3 @@ {

"author": "Juho Vepsalainen <bebraw@gmail.com>",
"version": "0.6.2",
"version": "0.6.3",

@@ -8,0 +8,0 @@ "dependencies": {

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc