Use single quotes for identifiers

This commit is contained in:
Daniel Gasienica
2018-04-11 15:44:52 -04:00
parent 819671a23a
commit 24f4ad53bc
15 changed files with 73 additions and 73 deletions

View File

@@ -116,12 +116,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);
@@ -130,7 +130,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);
@@ -143,12 +143,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);
@@ -157,7 +157,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

@@ -15,7 +15,7 @@ const {
// Promise Attachment
exports.migrateDataToFileSystem = async (attachment, { writeNewAttachmentData } = {}) => {
if (!isFunction(writeNewAttachmentData)) {
throw new TypeError('"writeNewAttachmentData" must be a function');
throw new TypeError("'writeNewAttachmentData' 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) => {
@@ -192,12 +192,12 @@ exports.createAttachmentLoader = (loadAttachmentData) => {
// IO (Promise Message)
exports.createAttachmentDataWriter = (writeExistingAttachmentData) => {
if (!isFunction(writeExistingAttachmentData)) {
throw new TypeError('"writeExistingAttachmentData" must be a function');
throw new TypeError("'writeExistingAttachmentData' must be a function");
}
return async (rawMessage) => {
if (!exports.isValid(rawMessage)) {
throw new TypeError('"rawMessage" is not valid');
throw new TypeError("'rawMessage' is not valid");
}
const message = exports.initializeSchemaVersion(rawMessage);
@@ -217,11 +217,11 @@ exports.createAttachmentDataWriter = (writeExistingAttachmentData) => {
attachments.forEach((attachment) => {
if (!Attachment.hasData(attachment)) {
throw new TypeError('"attachment.data" is required during message import');
throw new TypeError("'attachment.data' is required during message import");
}
if (!isString(attachment.path)) {
throw new TypeError('"attachment.path" is required during message import');
throw new TypeError("'attachment.path' is required during message import");
}
});