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

help-fem

Package Overview
Dependencies
Maintainers
5
Versions
77
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

help-fem - npm Package Compare versions

Comparing version 2.0.2 to 2.0.3

test/fixtures/message.js

65

help-fem.js

@@ -20,2 +20,5 @@ ;(function() {

var clientLog = require('debug')('help-fem:client');
var serverLog = require('debug')('help-fem:server');
// ## HelpFem

@@ -54,17 +57,3 @@ // `HelpFem` is really just a synonym for `module.exports`.

// Toggle debugging
if (options.debug) {
this.debug = true;
} else if (this.inBrowser && window.localStorage.getItem('debug')) {
var deb = window.localStorage.getItem('debug');
this.debug = deb.indexOf('help-fem') > -1 || deb === '*';
} else {
this.debug = this.uri.indexOf('localhost') > -1 || this.uri.indexOf('127.0.0.1') > -1;
}
// Toggle expanding the debug messages
this.debugExpand = _.isBoolean(options.debugExpand) ?
options.debugExpand
: true;
// Set the `organizationId` and `namespace`.

@@ -91,7 +80,12 @@ var org = options.organizationId || options.namespace;

/* istanbul ignore next */
if (this.inBrowser) {
var transports = window.WebSocket && window.WebSocket.CLOSING === 2
? ['websocket', 'polling']
: ['polling'];
} else {
var transports = options.transports || ['websocket', 'polling'];
}
// Connect to the FEMIO server and store the socket information.
var transports = window.WebSocket && window.WebSocket.CLOSING === 2
? ['websocket', 'polling']
: ['polling'];
this.socket = io(this.uri, {

@@ -221,38 +215,9 @@ transports: transports,

log: function log(event, payload) {
if (!this.debug) {
return;
}
var meta = _.result(payload, 'meta', {});
var style = ['padding: 0 0.25em', 'color: #fff'];
if (event.indexOf('server') > -1) {
style.push('background: #1abc9c');
} else if (event.indexOf('client') > -1) {
style.push('background: #3498db');
serverLog('%s: %o', meta.type, payload);
} else {
style.push('background: #f1c40f');
clientLog('%s: %o', meta.type, payload);
}
var meta = _.result(payload, 'meta', {});
// If it's an error or failure, log it as an error.
console[
event.indexOf('server') > -1 &&
meta.type &&
meta.type !== 'connection' &&
(meta.type === 'error' || meta.result !== 'SUCCESS') ?
'error'
: 'log'
](
// The event category
['%c', event].join(''),
style.join('; '),
// The type of message
meta.type,
// If we want the message expanded, stringify it.
this.debugExpand ?
JSON.stringify(payload, false, 2)
: payload
);
},

@@ -259,0 +224,0 @@

{
"name": "help-fem",
"version": "2.0.2",
"version": "2.0.3",
"description": "A Browserify/Node.js client module for the Help.com team's FEM.",

@@ -10,3 +10,3 @@ "main": "help-fem.js",

"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"test": "tap test/unit/*.js --cov"
},

@@ -29,6 +29,11 @@ "repository": {

"dependencies": {
"femio-client": "git+ssh://git@github.com/helpdotcom/femio-client.git#v1.0.2",
"debug": "~2.2.0",
"femio-client": "git+ssh://git@github.com/helpdotcom/femio-client.git#v1.0.3",
"underscore": "^1.8.2",
"uuid": "^2.0.1"
},
"devDependencies": {
"tap": "~2.2.1",
"ws": "~0.8.0"
}
}

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