From 6a63e427c8ac0305198cac5fa95fe3ebe9d4f7fc Mon Sep 17 00:00:00 2001 From: Daniel Gasienica Date: Mon, 9 Apr 2018 18:38:44 -0400 Subject: [PATCH] Use `is` instead of Lodash `is*` --- js/modules/types/attachment.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/js/modules/types/attachment.js b/js/modules/types/attachment.js index 06298b284..25e58bb95 100644 --- a/js/modules/types/attachment.js +++ b/js/modules/types/attachment.js @@ -1,4 +1,4 @@ -const { isFunction, isString } = require('lodash'); +const is = require('@sindresorhus/is'); const MIME = require('./mime'); const { arrayBufferToBlob, blobToArrayBuffer, dataURLToBlob } = require('blob-util'); @@ -76,7 +76,7 @@ const INVALID_CHARACTERS_PATTERN = new RegExp( // which currently doesn’t support async testing: // https://github.com/leebyron/testcheck-js/issues/45 exports._replaceUnicodeOrderOverridesSync = (attachment) => { - if (!isString(attachment.fileName)) { + if (!is.string(attachment.fileName)) { return attachment; } @@ -115,7 +115,7 @@ exports.hasData = attachment => // Attachment -> // IO (Promise Attachment) exports.loadData = (readAttachmentData) => { - if (!isFunction(readAttachmentData)) { + if (!is.function(readAttachmentData)) { throw new TypeError("'readAttachmentData' must be a function"); } @@ -129,7 +129,7 @@ exports.loadData = (readAttachmentData) => { return attachment; } - if (!isString(attachment.path)) { + if (!is.string(attachment.path)) { throw new TypeError("'attachment.path' is required"); } @@ -142,7 +142,7 @@ exports.loadData = (readAttachmentData) => { // Attachment -> // IO Unit exports.deleteData = (deleteAttachmentData) => { - if (!isFunction(deleteAttachmentData)) { + if (!is.function(deleteAttachmentData)) { throw new TypeError("'deleteAttachmentData' must be a function"); } @@ -156,7 +156,7 @@ exports.deleteData = (deleteAttachmentData) => { return; } - if (!isString(attachment.path)) { + if (!is.string(attachment.path)) { throw new TypeError("'attachment.path' is required"); }