Prefer double quotes over backticks for identifiers
This commit is contained in:
parent
18dddfe436
commit
36771a2dab
1 changed files with 9 additions and 9 deletions
|
@ -11,7 +11,7 @@ const PATH = 'attachments.noindex';
|
||||||
// getPath :: AbsolutePath -> AbsolutePath
|
// getPath :: AbsolutePath -> AbsolutePath
|
||||||
exports.getPath = (userDataPath) => {
|
exports.getPath = (userDataPath) => {
|
||||||
if (!isString(userDataPath)) {
|
if (!isString(userDataPath)) {
|
||||||
throw new TypeError('`userDataPath` must be a string');
|
throw new TypeError('"userDataPath" must be a string');
|
||||||
}
|
}
|
||||||
return path.join(userDataPath, PATH);
|
return path.join(userDataPath, PATH);
|
||||||
};
|
};
|
||||||
|
@ -19,7 +19,7 @@ exports.getPath = (userDataPath) => {
|
||||||
// ensureDirectory :: AbsolutePath -> IO Unit
|
// ensureDirectory :: AbsolutePath -> IO Unit
|
||||||
exports.ensureDirectory = async (userDataPath) => {
|
exports.ensureDirectory = async (userDataPath) => {
|
||||||
if (!isString(userDataPath)) {
|
if (!isString(userDataPath)) {
|
||||||
throw new TypeError('`userDataPath` must be a string');
|
throw new TypeError('"userDataPath" must be a string');
|
||||||
}
|
}
|
||||||
await fse.ensureDir(exports.getPath(userDataPath));
|
await fse.ensureDir(exports.getPath(userDataPath));
|
||||||
};
|
};
|
||||||
|
@ -29,12 +29,12 @@ exports.ensureDirectory = async (userDataPath) => {
|
||||||
// IO (Promise ArrayBuffer)
|
// IO (Promise ArrayBuffer)
|
||||||
exports.createReader = (root) => {
|
exports.createReader = (root) => {
|
||||||
if (!isString(root)) {
|
if (!isString(root)) {
|
||||||
throw new TypeError('`root` must be a path');
|
throw new TypeError('"root" must be a path');
|
||||||
}
|
}
|
||||||
|
|
||||||
return async (relativePath) => {
|
return async (relativePath) => {
|
||||||
if (!isString(relativePath)) {
|
if (!isString(relativePath)) {
|
||||||
throw new TypeError('`relativePath` must be a string');
|
throw new TypeError('"relativePath" must be a string');
|
||||||
}
|
}
|
||||||
|
|
||||||
const absolutePath = path.join(root, relativePath);
|
const absolutePath = path.join(root, relativePath);
|
||||||
|
@ -48,12 +48,12 @@ exports.createReader = (root) => {
|
||||||
// IO (Promise RelativePath)
|
// IO (Promise RelativePath)
|
||||||
exports.createWriter = (root) => {
|
exports.createWriter = (root) => {
|
||||||
if (!isString(root)) {
|
if (!isString(root)) {
|
||||||
throw new TypeError('`root` must be a path');
|
throw new TypeError('"root" must be a path');
|
||||||
}
|
}
|
||||||
|
|
||||||
return async (arrayBuffer) => {
|
return async (arrayBuffer) => {
|
||||||
if (!isArrayBuffer(arrayBuffer)) {
|
if (!isArrayBuffer(arrayBuffer)) {
|
||||||
throw new TypeError('`arrayBuffer` must be an array buffer');
|
throw new TypeError('"arrayBuffer" must be an array buffer');
|
||||||
}
|
}
|
||||||
|
|
||||||
const buffer = Buffer.from(arrayBuffer);
|
const buffer = Buffer.from(arrayBuffer);
|
||||||
|
@ -71,12 +71,12 @@ exports.createWriter = (root) => {
|
||||||
// IO Unit
|
// IO Unit
|
||||||
exports.createDeleter = (root) => {
|
exports.createDeleter = (root) => {
|
||||||
if (!isString(root)) {
|
if (!isString(root)) {
|
||||||
throw new TypeError('`root` must be a path');
|
throw new TypeError('"root" must be a path');
|
||||||
}
|
}
|
||||||
|
|
||||||
return async (relativePath) => {
|
return async (relativePath) => {
|
||||||
if (!isString(relativePath)) {
|
if (!isString(relativePath)) {
|
||||||
throw new TypeError('`relativePath` must be a string');
|
throw new TypeError('"relativePath" must be a string');
|
||||||
}
|
}
|
||||||
|
|
||||||
const absolutePath = path.join(root, relativePath);
|
const absolutePath = path.join(root, relativePath);
|
||||||
|
@ -93,7 +93,7 @@ exports.createName = () => {
|
||||||
// getRelativePath :: String -> IO Path
|
// getRelativePath :: String -> IO Path
|
||||||
exports.getRelativePath = (name) => {
|
exports.getRelativePath = (name) => {
|
||||||
if (!isString(name)) {
|
if (!isString(name)) {
|
||||||
throw new TypeError('`name` must be a string');
|
throw new TypeError('"name" must be a string');
|
||||||
}
|
}
|
||||||
|
|
||||||
const prefix = name.slice(0, 2);
|
const prefix = name.slice(0, 2);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue