From 515b5ba900d9c3ec07462765dab23c6bc419ae06 Mon Sep 17 00:00:00 2001 From: Gleb Bahmutov Date: Sun, 10 Dec 2017 22:40:22 -0500 Subject: [PATCH] fix: string snapshots --- src/utils.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/utils.js b/src/utils.js index 9b6c807..6a307d9 100644 --- a/src/utils.js +++ b/src/utils.js @@ -2,11 +2,7 @@ const sd = require('@wildpeaks/snapshot-dom') const beautify = require('js-beautify').html function isJqueryElement (x) { - // had to work around "switchcase" bug - function isObject (x) { - return x instanceof Object - } - return x && isObject(x) && 'wrap' in x + return x && typeof x !== 'string' && 'wrap' in x } // converts DOM element to a JSON object