Socket
Socket
Sign inDemoInstall

githulk

Package Overview
Dependencies
72
Maintainers
5
Versions
27
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.2.1 to 1.3.0

26

endpoints/repository.js

@@ -157,2 +157,28 @@ 'use strict';

/**
* Get the long SHA of a specific commit for a given repo
*
* @param {String} project The project details.
* @param {Object} options Optional options.
* @param {function} fn The callback.
* @returns {Assign}
* @api public
*/
Repository.prototype.commitSha = function commitSha(args) {
args = this.api.args(arguments);
var options = args.options = this.options(args.options);
var project = this.api.project(args.str);
return this.send(
['repos', project.user, project.repo, 'commits', options.sha],
args.options,
function handler(err, data) {
if (err) return args.fn(err);
args.fn(null, data.length && data.length > 0 ? data[0]['sha'] : null);
}
);
};
/**
* Get the README contents of an project.

@@ -159,0 +185,0 @@ *

2

index.js

@@ -29,3 +29,3 @@ 'use strict';

mana.extend({
initialise: function initalise(options) {
initialise: function initialise(options) {
options = options || {};

@@ -32,0 +32,0 @@

{
"name": "githulk",
"version": "1.2.1",
"version": "1.3.0",
"description": "Small but powerful Github client",

@@ -9,6 +9,3 @@ "main": "index.js",

},
"repository": {
"type": "git",
"url": "http://github/3rd-Eden/githulk"
},
"repository": "githulks/githulk",
"keywords": [

@@ -15,0 +12,0 @@ "github",

@@ -57,2 +57,16 @@ describe('githulk.repository', function () {

describe('.commitSha', function () {
it('get the LONG SHA for a specific commit', function (next) {
githulk.repository.commitSha('twbs/bootstrap', { sha: 'f2e912b' }, function (err, longSha) {
if (err) return next(err);
assume(longSha).is.a('string');
assume(longSha).equals('f2e912bb0e5041fead48bdbcaaa23de1c40291d5');
next();
});
});
});
describe('.contents', function () {

@@ -59,0 +73,0 @@ it('returns an error when getting files from an unknown repo', function (next) {

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc