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
5
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.0.11 to 1.2.1

lib/mixpanel.js

34

lib/taskapp.js

@@ -8,4 +8,24 @@ 'use strict'

const userName = require('git-user-name');
const createEvent = require('./mixpanel.js');
const username = userName();
console.warn(chalk.green('username: '+username));
const factoryTime = (spent) => {
let hour = 0;
let min = 0;
if (/h/.test(spent)) {
hour = parseInt(spent.match(/\d+(?=h)/g)[0]);
}
if (/m/.test(spent)) {
min = spent.match(/\d+(?=m)/g)
if (spent.match(/\d+(?=m)/g)) min = min[0];
min = (min*1)/60;
}
return (hour+min).toFixed(2);
}
const getOptions = () => {

@@ -21,4 +41,6 @@ try {

const messageValidator = (msg)=> {
const messageValidator = (msg) => {
const project = getOptions().name;
let hasError = false;
let scope, task, spent = '';

@@ -54,9 +76,15 @@ if (!(/task/.test(msg))) {

} else {
scope = msg.match(/(^\S+:)/g)[0].slice(0, -1);
task = msg.match(/task:.+,/g)[0].replace('task:', '').trim().slice(0, -1);
spent = msg.match(/spent:.+/g)[0].replace('spent:', '').trim();
createEvent(project, username, scope, task, factoryTime(spent));
console.warn(chalk.green(`Thanks ${username}, your task was validated with success! Great job! Your earned 2 points!`));
// TODO: send to api
process.exit(0);
// process.exit(0);
}
}
const validator = (message)=> {
const validator = (message = 'feat: Mixpanel event, task: https://trello.com/c/cmsTXwve/1-mixpanel-event, spent: 33m') => {
try {

@@ -63,0 +91,0 @@ messageValidator(message)

5

package.json
{
"name": "@getty.io/taskapp",
"version": "1.0.11",
"version": "1.2.1",
"description": "Getty/IO commit-msg hook validator",

@@ -22,6 +22,5 @@ "main": "index.js",

"find-root": "^1.0.0",
"fs": "^0.0.1-security",
"git-user-name": "^2.0.0",
"husky": "^0.15.0-beta.16",
"path": "^0.12.7"
"mixpanel": "^0.8.0"
},

@@ -28,0 +27,0 @@ "husky": {

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