Socket
Socket
Sign inDemoInstall

husky-pivotal

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

husky-pivotal - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

4

lib/__tests__/ckbranch.test.js

@@ -11,2 +11,6 @@ const ckbranch = require('../ckbranch');

test('matches feature/{feature}_{story} branch style', () => {
expect(ckbranch('feature/greatStuff_123456')).toBe('123456');
});
test('matches branch names with long numbers', () => {

@@ -13,0 +17,0 @@ expect(ckbranch('123456789101112-great-stuff')).toBe('123456789101112');

@@ -19,1 +19,5 @@ const mkmsg = require('../mkmsg');

});
test('appends content without removing existing content', () => {
expect(mkmsg('Commit message', '123456-feature-name').split('\n').pop()).toBe('[#123456]');
});

2

lib/ckbranch.js

@@ -7,4 +7,4 @@ /**

module.exports = branch => {
const matches = branch.match(/\b(\d{6,})/);
const matches = branch.match(/(?:\b|_)(\d{6,})/);
return matches ? matches[1] : false;
};

@@ -10,2 +10,5 @@ /**

// Returns true if the provided commit contains non-comment lines
const hasBody = msg => !!String(msg).match(/^\b[^#].+/m)
module.exports = (msg, branch) => {

@@ -19,3 +22,3 @@ // Early escape for messages that already contain a Story ID

// Construct message addition
const prepend = story ? [
const extra = (story ? [
'',

@@ -32,5 +35,9 @@ '',

'#',
];
]).join('\n');
return `${prepend.join('\n')}${msg}`;
// If the existing commit message contains text then the extras
// should be appended to it, otherwise they should be prepended
return hasBody(msg)
? `${msg}${extra}`
: `${extra}${msg}`;
};
{
"name": "husky-pivotal",
"version": "1.0.1",
"version": "1.0.2",
"description": "Husky Git hooks for Pivotal Tracker.",

@@ -36,11 +36,12 @@ "scripts": {

"peerDependencies": {
"husky": ">=0.13.0 <2.0.0"
"husky": ">=0.13.0"
},
"dependencies": {
"chalk": "^2.4.1"
"chalk": "^2.4.0"
},
"devDependencies": {
"eslint": "^4.19.1",
"jest": "^23.0.0"
"eslint": "^6.0.0",
"husky": "^3.0.0",
"jest": "^24.8.0"
}
}

Sorry, the diff of this file is not supported yet

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