🚀 Socket Launch Week 🚀 Day 1: Introducing .NET Support in Socket.Learn More

extract-github

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

extract-github - npm Package Compare versions

Comparing version

to
0.0.2

@@ -30,3 +30,7 @@ 'use strict';

if ('string' === type && ~data.indexOf(contains)) return data;
if ('string' === type) {
if (!contains) return data;
else if (~data.indexOf(contains)) return data;
}
if ('object' === type) {

@@ -33,0 +37,0 @@ if ('url' in data && (match = url(data.url, contains))) return match;

{
"name": "extract-github",
"version": "0.0.1",
"version": "0.0.2",
"description": "Extract the Github project / repository URL from a given object",

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

@@ -64,2 +64,9 @@ describe('extract-github', function () {

});
it('has optional string matching', function () {
expect(extract.url({ url: 'google.com', web: 'github.com'})).to.equal('google.com');
expect(extract.url('google.com')).to.equal('google.com');
expect(extract.url({ foo: 'foo' })).to.equal(undefined);
expect(extract.url({ url: {} })).to.equal(undefined);
});
});

@@ -66,0 +73,0 @@