New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@getty.io/taskapp

Package Overview
Dependencies
Maintainers
6
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@getty.io/taskapp - npm Package Compare versions

Comparing version 1.2.3 to 1.2.4

49

lib/mixpanel.js
const Mixpanel = require('mixpanel');
const {getOptions, getParams} = require('./utils.js');
const {getOptions, getParams, checkNested} = require('./utils.js');
const chalk = require('chalk');
let init = true;
let callback = false;
let hasError = false;

@@ -16,30 +17,34 @@ function mixPanelCallback(e) {

const createEvent = (msg, username) => {
const token = getOptions().taskapp.mixpanel.token;
if (token && token.length > 0) {
const mixpanel = Mixpanel.init(token);
const project = getOptions().name;
const {scope, task, spent } = getParams(msg);
mixpanel.people.set(username, {}, mixPanelCallback);
if (checkNested(getOptions(), 'token')){
const token = getOptions().taskapp.mixpanel.token;
if (token && token.length > 0) {
const mixpanel = Mixpanel.init(token);
const project = getOptions().name;
const {scope, task, spent } = getParams(msg);
mixpanel.people.set(username, {}, mixPanelCallback);
let stateCheck = setInterval(() => {
if (callback) {
clearInterval(stateCheck);
if (init) {
mixpanel.track(project, {
distinct_id: username,
scope: scope,
task: task,
spent: spent
});
let stateCheck = setInterval(() => {
if (callback) {
clearInterval(stateCheck);
if (init) {
mixpanel.track(project, {
distinct_id: username,
scope: scope,
task: task,
spent: spent
});
}
}
}
}, 0);
}, 0);
}else{
hasError = true;
}
} else {
console.warn(chalk.yellow('INFO: Mixpanel token not found. Please insert the token in the package.json.\nMore info: https://www.npmjs.com/package/@getty.io/taskapp'));
hasError = true;
}
if (hasError) console.warn(chalk.yellow('INFO: Mixpanel token not found. Please insert the token in the package.json.\nMore info: https://www.npmjs.com/package/@getty.io/taskapp'));
}
module.exports = createEvent;

@@ -22,2 +22,14 @@ const findRoot = require('find-root');

function checkNested(obj) {
var args = Array.prototype.slice.call(arguments, 1);
for (var i = 0; i < args.length; i++) {
if (!obj || !obj.hasOwnProperty(args[i])) {
return false;
}
obj = obj[args[i]];
}
return true;
}
const getOptions = () => {

@@ -45,3 +57,4 @@ try {

getOptions,
getParams
getParams,
checkNested
}
{
"name": "@getty.io/taskapp",
"version": "1.2.3",
"version": "1.2.4",
"description": "Getty/IO commit-msg hook validator",

@@ -5,0 +5,0 @@ "main": "index.js",

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