Use double quotes for identifiers in error messages

This commit is contained in:
Daniel Gasienica
2018-03-23 18:24:50 -04:00
parent 06e7bca276
commit 867f73b80a
6 changed files with 15 additions and 15 deletions

View File

@@ -121,12 +121,12 @@ exports.hasData = attachment =>
// IO (Promise Attachment)
exports.loadData = (readAttachmentData) => {
if (!isFunction(readAttachmentData)) {
throw new TypeError('`readAttachmentData` must be a function');
throw new TypeError('"readAttachmentData" must be a function');
}
return async (attachment) => {
if (!exports.isValid(attachment)) {
throw new TypeError('`attachment` is not valid');
throw new TypeError('"attachment" is not valid');
}
const isAlreadyLoaded = exports.hasData(attachment);
@@ -135,7 +135,7 @@ exports.loadData = (readAttachmentData) => {
}
if (!isString(attachment.path)) {
throw new TypeError('`attachment.path` is required');
throw new TypeError('"attachment.path" is required');
}
const data = await readAttachmentData(attachment.path);
@@ -148,12 +148,12 @@ exports.loadData = (readAttachmentData) => {
// IO Unit
exports.deleteData = (deleteAttachmentData) => {
if (!isFunction(deleteAttachmentData)) {
throw new TypeError('`deleteAttachmentData` must be a function');
throw new TypeError('"deleteAttachmentData" must be a function');
}
return async (attachment) => {
if (!exports.isValid(attachment)) {
throw new TypeError('`attachment` is not valid');
throw new TypeError('"attachment" is not valid');
}
const hasDataInMemory = exports.hasData(attachment);
@@ -162,7 +162,7 @@ exports.deleteData = (deleteAttachmentData) => {
}
if (!isString(attachment.path)) {
throw new TypeError('`attachment.path` is required');
throw new TypeError('"attachment.path" is required');
}
await deleteAttachmentData(attachment.path);

View File

@@ -13,7 +13,7 @@ const omit = require('lodash/omit');
// Promise Attachment
exports.migrateDataToFileSystem = async (attachment, { writeAttachmentData } = {}) => {
if (!isFunction(writeAttachmentData)) {
throw new TypeError('`writeAttachmentData` must be a function');
throw new TypeError('"writeAttachmentData" must be a function');
}
const { data } = attachment;

View File

@@ -81,10 +81,10 @@ exports.initializeSchemaVersion = (message) => {
// SchemaVersion -> UpgradeStep -> UpgradeStep
exports._withSchemaVersion = (schemaVersion, upgrade) => {
if (!SchemaVersion.isValid(schemaVersion)) {
throw new TypeError('`schemaVersion` is invalid');
throw new TypeError('"schemaVersion" is invalid');
}
if (!isFunction(upgrade)) {
throw new TypeError('`upgrade` must be a function');
throw new TypeError('"upgrade" must be a function');
}
return async (message, context) => {