From 8805c46cc792ea32f2eda30a7776e663a0cef1b3 Mon Sep 17 00:00:00 2001 From: wtgtybhertgeghgtwtg Date: Sun, 10 Jun 2018 16:24:58 -0700 Subject: [PATCH] perf: drop `isobject` check (#14) --- package.json | 3 --- src/getCertain.js | 5 +---- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/package.json b/package.json index 3d30b81..645cdbd 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/src/getCertain.js b/src/getCertain.js index 78528e3..c5b50cb 100644 --- a/src/getCertain.js +++ b/src/getCertain.js @@ -1,6 +1,5 @@ // @flow import assert from 'assert'; -import isobject from 'isobject'; export default function getCertain( map: Map, @@ -8,9 +7,7 @@ export default function getCertain( 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.', );