Skip to content

Commit 4d46f90

Browse files
committed
[Robustness] use a null object cache
1 parent 10b3f6c commit 4d46f90

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
'use strict';
99

1010
var url = require('url');
11-
var cache = {};
11+
var cache = { __proto__: null };
1212

1313
function isChecksum(str) {
1414
return (/^[a-f0-9]{40}$/i).test(str);

test/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ var test = require('tape');
55
var gh = require('../');
66

77
test('parse-github-url', function (t) {
8+
t.equal(gh('toString').href, 'toString');
9+
810
t.test('gets the user:', function (assert) {
911
assert.equal(gh(''), null);
1012
assert.equal(gh('https://github.com/jonschlinkert/micromatch').owner, 'jonschlinkert');

0 commit comments

Comments
 (0)