Skip to content

Commit

Permalink
perf: drop isobject check (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
wtgtybhertgeghgtwtg authored Jun 10, 2018
1 parent 46bee61 commit 8805c46
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
3 changes: 0 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@
"bugs": {
"url": "https://github.com/wtgtybhertgeghgtwtg/get-certain/issues"
},
"dependencies": {
"isobject": "^3.0.1"
},
"description": "Assert a Map has a given key and return the value for it.",
"devDependencies": {
"@babel/core": "^7.0.0-beta.46",
Expand Down
5 changes: 1 addition & 4 deletions src/getCertain.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
// @flow
import assert from 'assert';
import isobject from 'isobject';

export default function getCertain<Key, Value>(
map: Map<Key, Value>,
key: Key,
message: string = '"map" does not have an entry for "key".',
): Value {
assert(
isobject(map) &&
typeof map.get === 'function' &&
typeof map.has === 'function',
map && typeof map.get === 'function' && typeof map.has === 'function',
// Or at least look like a Map.
'"map" must be a Map.',
);
Expand Down

0 comments on commit 8805c46

Please # to comment.