@deephaven/file-explorer 0.49.2-theme-plugins.45 → 0.50.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/FileUtils.d.ts +3 -0
- package/dist/FileUtils.d.ts.map +1 -1
- package/dist/FileUtils.js +29 -1
- package/dist/FileUtils.js.map +1 -1
- package/package.json +8 -8
package/dist/FileUtils.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { FileStorage } from './FileStorage';
|
|
1
2
|
/**
|
|
2
3
|
* A basic list of some common MIME types.
|
|
3
4
|
*/
|
|
@@ -13,6 +14,7 @@ export declare enum MIME_TYPE {
|
|
|
13
14
|
* Collection of utils for operating on file names
|
|
14
15
|
*/
|
|
15
16
|
export declare class FileUtils {
|
|
17
|
+
static fileExists(fileStorage: FileStorage, name: string): Promise<boolean>;
|
|
16
18
|
/**
|
|
17
19
|
* Format file extension
|
|
18
20
|
* @param extension File extension to format, defaults to empty string
|
|
@@ -43,6 +45,7 @@ export declare class FileUtils {
|
|
|
43
45
|
* @returns The file name of the copy
|
|
44
46
|
*/
|
|
45
47
|
static getCopyFileName(originalName: string): string;
|
|
48
|
+
static getUniqueCopyFileName(fileStorage: FileStorage, originalName: string): Promise<string>;
|
|
46
49
|
/**
|
|
47
50
|
* Return a MIME type for the provided file
|
|
48
51
|
* @param name The file name to get the type for
|
package/dist/FileUtils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileUtils.d.ts","sourceRoot":"","sources":["../src/FileUtils.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,oBAAY,SAAS;IACnB,MAAM,kBAAkB;IACxB,UAAU,eAAe;IACzB,MAAM,kBAAkB;IACxB,eAAe,8BAA8B;IAC7C,KAAK,iBAAiB;IACtB,OAAO,KAAK;CACb;AAED;;GAEG;AACH,qBAAa,SAAS;
|
|
1
|
+
{"version":3,"file":"FileUtils.d.ts","sourceRoot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AAC,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;IAOrC;;;;OAIG;IACH,MAAM,CAAC,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,YAAY,SAAK,GAAG,MAAM;IAOhE;;;OAGG;IACH,MAAM,CAAC,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAgCvC;;;;OAIG;IACH,MAAM,CAAC,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE;IAQ7C;;;;;OAKG;IACH,MAAM,CAAC,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM;IAazD;;;;OAIG;IACH,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM;CAGnD;AAED,eAAe,SAAS,CAAC"}
|
package/dist/FileUtils.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
2
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
1
3
|
import { ValidationError } from '@deephaven/utils';
|
|
2
|
-
|
|
4
|
+
import FileNotFoundError from "./FileNotFoundError.js";
|
|
3
5
|
/**
|
|
4
6
|
* A basic list of some common MIME types.
|
|
5
7
|
*/
|
|
@@ -17,6 +19,21 @@ export var MIME_TYPE;
|
|
|
17
19
|
MIME_TYPE["UNKNOWN"] = "";
|
|
18
20
|
})(MIME_TYPE || (MIME_TYPE = {}));
|
|
19
21
|
export class FileUtils {
|
|
22
|
+
static fileExists(fileStorage, name) {
|
|
23
|
+
return _asyncToGenerator(function* () {
|
|
24
|
+
try {
|
|
25
|
+
yield fileStorage.info(name);
|
|
26
|
+
return true;
|
|
27
|
+
} catch (e) {
|
|
28
|
+
// Should probably make sure it's a `FileNotFoundError`, and re-throw the error if it is not
|
|
29
|
+
if (!(e instanceof FileNotFoundError)) {
|
|
30
|
+
throw e;
|
|
31
|
+
}
|
|
32
|
+
return false;
|
|
33
|
+
}
|
|
34
|
+
})();
|
|
35
|
+
}
|
|
36
|
+
|
|
20
37
|
/**
|
|
21
38
|
* Format file extension
|
|
22
39
|
* @param extension File extension to format, defaults to empty string
|
|
@@ -84,6 +101,17 @@ export class FileUtils {
|
|
|
84
101
|
var copyName = name ? "".concat(name, "-copy") : 'Copy';
|
|
85
102
|
return extension !== null ? "".concat(copyName, ".").concat(extension) : copyName;
|
|
86
103
|
}
|
|
104
|
+
static getUniqueCopyFileName(fileStorage, originalName) {
|
|
105
|
+
return _asyncToGenerator(function* () {
|
|
106
|
+
var copyName = FileUtils.getCopyFileName(originalName);
|
|
107
|
+
// await in loop is fine here, this isn't a parallel task
|
|
108
|
+
// eslint-disable-next-line no-await-in-loop
|
|
109
|
+
while (yield FileUtils.fileExists(fileStorage, copyName)) {
|
|
110
|
+
copyName = FileUtils.getCopyFileName(copyName);
|
|
111
|
+
}
|
|
112
|
+
return copyName;
|
|
113
|
+
})();
|
|
114
|
+
}
|
|
87
115
|
|
|
88
116
|
/**
|
|
89
117
|
* Return a MIME type for the provided file
|
package/dist/FileUtils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileUtils.js","names":["ValidationError","MIME_TYPE","FileUtils","fileExtensionToString","extension","length","getDepth","name","hasPath","Error","matches","match","getExtension","components","getBaseName","split","pop","getCopyFileName","originalName","extensionPosition","lastIndexOf","substring","copyName","getMimeType","toLowerCase","GROOVY","PYTHON","PYTHON_COMPILED","SCALA","PLAIN_TEXT","UNKNOWN","getParent","parts","join","getPath","startsWith","isPath","endsWith","makePath","replaceExtension","newExtension","index","nameWithoutExtension","extensionString","validateName","reservedNames","invalidCharsRegex","invalidCharLabels","Map","includes","test","reduce","acc","next","map","char","has","get","reducePaths","paths","folders","filter","path","some","folder","removeRoot","root","filename","addRoot"],"sources":["../src/FileUtils.ts"],"sourcesContent":["import { ValidationError } from '@deephaven/utils';\n\n/**\n * A basic list of some common MIME types.\n */\nexport enum MIME_TYPE {\n GROOVY = 'text/x-groovy',\n PLAIN_TEXT = 'text/plain',\n PYTHON = 'text/x-python',\n PYTHON_COMPILED = 'application/x-python-code',\n SCALA = 'text/x-scala',\n UNKNOWN = '',\n}\n\n/**\n * Collection of utils for operating on file names\n */\nexport class FileUtils {\n /**\n * Format file extension\n * @param extension File extension to format, defaults to empty string\n * @returns Formatted string - '' for no extension, '.' for empty extension, '.ext' for non-empty extension\n */\n static fileExtensionToString(extension = ''): string {\n return extension.length === 0 ? '' : `.${extension}`;\n }\n\n /**\n * Get the depth (how many directories deep it is) of the provided filename with path.\n * @param name The full file name to get the depth of\n */\n static getDepth(name: string): number {\n if (!FileUtils.hasPath(name)) {\n throw new Error(`Invalid path provided: ${name}`);\n }\n const matches = name.match(/\\//g) ?? [];\n return matches.length - 1;\n }\n\n /**\n * Get just the extension of file name.\n * Note that it just returns the last extension, so 'example.tar.gz' would just return 'gz'.\n * @param name The file name with or without path to get the extension of\n * @returns The file extension\n */\n static getExtension(name: string): string {\n const components = this.getBaseName(name).split('.');\n if (components.length > 1) {\n return components.pop() ?? '';\n }\n return '';\n }\n\n /**\n * Get the base name portion of the file, eg '/foo/bar.txt' => 'bar.txt'\n * @param name The full name including path of the file\n * @returns Just the file name part of the file\n */\n static getBaseName(name: string): string {\n return name.split('/').pop() ?? '';\n }\n\n /**\n * Create copy file name, used for copying unsaved files so doesn't have to be unique\n * @param originalName File name\n * @returns The file name of the copy\n */\n static getCopyFileName(originalName: string): string {\n const extensionPosition = originalName.lastIndexOf('.');\n let extension = null;\n let name = null;\n if (extensionPosition < 0) {\n // No extension\n name = originalName;\n } else {\n name = originalName.substring(0, extensionPosition);\n extension = originalName.substring(extensionPosition + 1);\n }\n const copyName = name ? `${name}-copy` : 'Copy';\n return extension !== null ? `${copyName}.${extension}` : copyName;\n }\n\n /**\n * Return a MIME type for the provided file\n * @param name The file name to get the type for\n * @returns A known MIME type if recognized\n */\n static getMimeType(name: string): MIME_TYPE {\n const extension = this.getExtension(name).toLowerCase();\n switch (extension) {\n case 'groovy':\n return MIME_TYPE.GROOVY;\n case 'py':\n return MIME_TYPE.PYTHON;\n case 'pyc':\n return MIME_TYPE.PYTHON_COMPILED;\n case 'scala':\n return MIME_TYPE.SCALA;\n case 'txt':\n return MIME_TYPE.PLAIN_TEXT;\n default:\n return MIME_TYPE.UNKNOWN;\n }\n }\n\n /**\n * Pop the last part of the filename component to return the parent path\n * @param name The file name to get the parent path of\n */\n static getParent(name: string): string {\n if (!FileUtils.hasPath(name)) {\n throw new Error(`Invalid name provided: ${name}`);\n }\n\n const parts = name.split('/');\n while (parts.pop() === '');\n if (parts.length === 0) {\n throw new Error(`No parent for path provided: ${name}`);\n }\n return `${parts.join('/')}/`;\n }\n\n /**\n * Get the path name portion of the file\n * @param name The full path with or without filename to get the path of\n * @returns Just the path with out the file name part, including trailing slash\n */\n static getPath(name: string): string {\n if (!FileUtils.hasPath(name)) {\n throw new Error(`Invalid filename provided: ${name}`);\n }\n const parts = name.split('/');\n parts.pop();\n return `${parts.join('/')}/`;\n }\n\n /**\n * Check if a given file name includes the full path\n * @param name The file name to check\n * @returns True if it's a full path, false otherwise\n */\n static hasPath(name: string): boolean {\n return name.startsWith('/');\n }\n\n /**\n * Check a given file name is a path\n * @param name The file name to check\n * @returns True if it's a full path, false otherwise\n */\n static isPath(name: string): boolean {\n return name.startsWith('/') && name.endsWith('/');\n }\n\n /**\n * Turns a directory file name into a path. Basically ensures there's a trailing slash\n * @param name The directory name to make a path\n */\n static makePath(name: string): string {\n if (!name.endsWith('/')) {\n return `${name}/`;\n }\n return name;\n }\n\n /**\n * Replace extension in the item name\n * @param name Name to replace the extension in\n * @param newExtension New extension, defaults to no extension\n */\n static replaceExtension(name: string, newExtension = ''): string {\n const index = name.lastIndexOf('.');\n const nameWithoutExtension = index > -1 ? name.substring(0, index) : name;\n const extensionString = FileUtils.fileExtensionToString(newExtension);\n return `${nameWithoutExtension}${extensionString}`;\n }\n\n /**\n * Validate the provided name. Throws an error if validation fails\n * @param name The item name to validate\n */\n static validateName(name: string): void {\n // Static checks\n const reservedNames = ['.', '..'];\n // Global flag to show all invalid chars, not just the first match\n const invalidCharsRegex = /[\\\\/\\0]/g;\n const invalidCharLabels = new Map([['\\0', 'null']]);\n\n if (!name) {\n throw new ValidationError(`Name cannot be empty`);\n }\n if (reservedNames.includes(name)) {\n throw new ValidationError(`\"${name}\" is a reserved name`);\n }\n if (invalidCharsRegex.test(name)) {\n throw new ValidationError(\n `Invalid characters in name: \"${\n name\n .match(invalidCharsRegex)\n // Filter out duplicates\n ?.reduce(\n (acc, next) => (acc.includes(next) ? acc : [...acc, next]),\n [] as string[]\n )\n .map(char =>\n invalidCharLabels.has(char) ? invalidCharLabels.get(char) : char\n )\n .join('\", \"') ?? ''\n }\"`\n );\n }\n }\n\n /**\n * Reduce the provided paths to the minimum selection.\n * Removes any nested files or directories if a parent is already selected.\n * @param paths The paths to reduce\n */\n static reducePaths(paths: string[]): string[] {\n const folders = paths.filter(path => FileUtils.isPath(path));\n return paths.filter(\n path =>\n !folders.some(folder => path !== folder && path.startsWith(folder))\n );\n }\n\n /**\n * Removes the root path from the provided file name. Throws if the filename does not start with root.\n * @param root The root to remove\n * @param filename Filename to remove the root path from\n * @returns Filename without the root\n */\n static removeRoot(root: string, filename: string): string {\n if (root.length === 0) {\n return filename;\n }\n if (!filename.startsWith(root)) {\n throw new Error(\n `Filename ${filename} does not start with expected root ${root}`\n );\n }\n\n return filename.substring(root.length);\n }\n\n /**\n * Add root to the filename as prefix\n * @param path Filename to prefix root to\n * @returns Filename with root at the prefix\n */\n static addRoot(root: string, path: string): string {\n return `${root}${path}`;\n }\n}\n\nexport default FileUtils;\n"],"mappings":"AAAA,SAASA,eAAe,QAAQ,kBAAkB;;AAElD;AACA;AACA;AACA,WAAYC,SAAS;;AASrB;AACA;AACA;AAFA,WATYA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;AAAA,GAATA,SAAS,KAATA,SAAS;AAYrB,OAAO,MAAMC,SAAS,CAAC;EACrB;AACF;AACA;AACA;AACA;EACE,OAAOC,qBAAqB,GAAyB;IAAA,IAAxBC,SAAS,uEAAG,EAAE;IACzC,OAAOA,SAAS,CAACC,MAAM,KAAK,CAAC,GAAG,EAAE,cAAOD,SAAS,CAAE;EACtD;;EAEA;AACF;AACA;AACA;EACE,OAAOE,QAAQ,CAACC,IAAY,EAAU;IAAA;IACpC,IAAI,CAACL,SAAS,CAACM,OAAO,CAACD,IAAI,CAAC,EAAE;MAC5B,MAAM,IAAIE,KAAK,kCAA2BF,IAAI,EAAG;IACnD;IACA,IAAMG,OAAO,kBAAGH,IAAI,CAACI,KAAK,CAAC,KAAK,CAAC,qDAAI,EAAE;IACvC,OAAOD,OAAO,CAACL,MAAM,GAAG,CAAC;EAC3B;;EAEA;AACF;AACA;AACA;AACA;AACA;EACE,OAAOO,YAAY,CAACL,IAAY,EAAU;IACxC,IAAMM,UAAU,GAAG,IAAI,CAACC,WAAW,CAACP,IAAI,CAAC,CAACQ,KAAK,CAAC,GAAG,CAAC;IACpD,IAAIF,UAAU,CAACR,MAAM,GAAG,CAAC,EAAE;MAAA;MACzB,0BAAOQ,UAAU,CAACG,GAAG,EAAE,6DAAI,EAAE;IAC/B;IACA,OAAO,EAAE;EACX;;EAEA;AACF;AACA;AACA;AACA;EACE,OAAOF,WAAW,CAACP,IAAY,EAAU;IAAA;IACvC,0BAAOA,IAAI,CAACQ,KAAK,CAAC,GAAG,CAAC,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ExB;IACH;EACF;;EAEA;AACF;AACA;AACA;AACA;EACE,OAAOyB,WAAW,CAACC,KAAe,EAAY;IAC5C,IAAMC,OAAO,GAAGD,KAAK,CAACE,MAAM,CAACC,IAAI,IAAI5D,SAAS,CAACkC,MAAM,CAAC0B,IAAI,CAAC,CAAC;IAC5D,OAAOH,KAAK,CAACE,MAAM,CACjBC,IAAI,IACF,CAACF,OAAO,CAACG,IAAI,CAACC,MAAM,IAAIF,IAAI,KAAKE,MAAM,IAAIF,IAAI,CAAC3B,UAAU,CAAC6B,MAAM,CAAC,CAAC,CACtE;EACH;;EAEA;AACF;AACA;AACA;AACA;AACA;EACE,OAAOC,UAAU,CAACC,IAAY,EAAEC,QAAgB,EAAU;IACxD,IAAID,IAAI,CAAC7D,MAAM,KAAK,CAAC,EAAE;MACrB,OAAO8D,QAAQ;IACjB;IACA,IAAI,CAACA,QAAQ,CAAChC,UAAU,CAAC+B,IAAI,CAAC,EAAE;MAC9B,MAAM,IAAIzD,KAAK,oBACD0D,QAAQ,gDAAsCD,IAAI,EAC/D;IACH;IAEA,OAAOC,QAAQ,CAAC9C,SAAS,CAAC6C,IAAI,CAAC7D,MAAM,CAAC;EACxC;;EAEA;AACF;AACA;AACA;AACA;EACE,OAAO+D,OAAO,CAACF,IAAY,EAAEJ,IAAY,EAAU;IACjD,iBAAUI,IAAI,SAAGJ,IAAI;EACvB;AACF;AAEA,eAAe5D,SAAS"}
|
|
1
|
+
{"version":3,"file":"FileUtils.js","names":["ValidationError","FileNotFoundError","MIME_TYPE","FileUtils","fileExists","fileStorage","name","info","e","fileExtensionToString","extension","length","getDepth","hasPath","Error","matches","match","getExtension","components","getBaseName","split","pop","getCopyFileName","originalName","extensionPosition","lastIndexOf","substring","copyName","getUniqueCopyFileName","getMimeType","toLowerCase","GROOVY","PYTHON","PYTHON_COMPILED","SCALA","PLAIN_TEXT","UNKNOWN","getParent","parts","join","getPath","startsWith","isPath","endsWith","makePath","replaceExtension","newExtension","index","nameWithoutExtension","extensionString","validateName","reservedNames","invalidCharsRegex","invalidCharLabels","Map","includes","test","reduce","acc","next","map","char","has","get","reducePaths","paths","folders","filter","path","some","folder","removeRoot","root","filename","addRoot"],"sources":["../src/FileUtils.ts"],"sourcesContent":["import { ValidationError } from '@deephaven/utils';\nimport FileNotFoundError from './FileNotFoundError';\nimport { FileStorage } from './FileStorage';\n\n/**\n * A basic list of some common MIME types.\n */\nexport enum MIME_TYPE {\n GROOVY = 'text/x-groovy',\n PLAIN_TEXT = 'text/plain',\n PYTHON = 'text/x-python',\n PYTHON_COMPILED = 'application/x-python-code',\n SCALA = 'text/x-scala',\n UNKNOWN = '',\n}\n\n/**\n * Collection of utils for operating on file names\n */\nexport class FileUtils {\n static async fileExists(\n fileStorage: FileStorage,\n name: string\n ): Promise<boolean> {\n try {\n await fileStorage.info(name);\n return true;\n } catch (e) {\n // Should probably make sure it's a `FileNotFoundError`, and re-throw the error if it is not\n if (!(e instanceof FileNotFoundError)) {\n throw e;\n }\n return false;\n }\n }\n\n /**\n * Format file extension\n * @param extension File extension to format, defaults to empty string\n * @returns Formatted string - '' for no extension, '.' for empty extension, '.ext' for non-empty extension\n */\n static fileExtensionToString(extension = ''): string {\n return extension.length === 0 ? '' : `.${extension}`;\n }\n\n /**\n * Get the depth (how many directories deep it is) of the provided filename with path.\n * @param name The full file name to get the depth of\n */\n static getDepth(name: string): number {\n if (!FileUtils.hasPath(name)) {\n throw new Error(`Invalid path provided: ${name}`);\n }\n const matches = name.match(/\\//g) ?? [];\n return matches.length - 1;\n }\n\n /**\n * Get just the extension of file name.\n * Note that it just returns the last extension, so 'example.tar.gz' would just return 'gz'.\n * @param name The file name with or without path to get the extension of\n * @returns The file extension\n */\n static getExtension(name: string): string {\n const components = this.getBaseName(name).split('.');\n if (components.length > 1) {\n return components.pop() ?? '';\n }\n return '';\n }\n\n /**\n * Get the base name portion of the file, eg '/foo/bar.txt' => 'bar.txt'\n * @param name The full name including path of the file\n * @returns Just the file name part of the file\n */\n static getBaseName(name: string): string {\n return name.split('/').pop() ?? '';\n }\n\n /**\n * Create copy file name, used for copying unsaved files so doesn't have to be unique\n * @param originalName File name\n * @returns The file name of the copy\n */\n static getCopyFileName(originalName: string): string {\n const extensionPosition = originalName.lastIndexOf('.');\n let extension = null;\n let name = null;\n if (extensionPosition < 0) {\n // No extension\n name = originalName;\n } else {\n name = originalName.substring(0, extensionPosition);\n extension = originalName.substring(extensionPosition + 1);\n }\n const copyName = name ? `${name}-copy` : 'Copy';\n return extension !== null ? `${copyName}.${extension}` : copyName;\n }\n\n static async getUniqueCopyFileName(\n fileStorage: FileStorage,\n originalName: string\n ): Promise<string> {\n let copyName = FileUtils.getCopyFileName(originalName);\n // await in loop is fine here, this isn't a parallel task\n // eslint-disable-next-line no-await-in-loop\n while (await FileUtils.fileExists(fileStorage, copyName)) {\n copyName = FileUtils.getCopyFileName(copyName);\n }\n return copyName;\n }\n\n /**\n * Return a MIME type for the provided file\n * @param name The file name to get the type for\n * @returns A known MIME type if recognized\n */\n static getMimeType(name: string): MIME_TYPE {\n const extension = this.getExtension(name).toLowerCase();\n switch (extension) {\n case 'groovy':\n return MIME_TYPE.GROOVY;\n case 'py':\n return MIME_TYPE.PYTHON;\n case 'pyc':\n return MIME_TYPE.PYTHON_COMPILED;\n case 'scala':\n return MIME_TYPE.SCALA;\n case 'txt':\n return MIME_TYPE.PLAIN_TEXT;\n default:\n return MIME_TYPE.UNKNOWN;\n }\n }\n\n /**\n * Pop the last part of the filename component to return the parent path\n * @param name The file name to get the parent path of\n */\n static getParent(name: string): string {\n if (!FileUtils.hasPath(name)) {\n throw new Error(`Invalid name provided: ${name}`);\n }\n\n const parts = name.split('/');\n while (parts.pop() === '');\n if (parts.length === 0) {\n throw new Error(`No parent for path provided: ${name}`);\n }\n return `${parts.join('/')}/`;\n }\n\n /**\n * Get the path name portion of the file\n * @param name The full path with or without filename to get the path of\n * @returns Just the path with out the file name part, including trailing slash\n */\n static getPath(name: string): string {\n if (!FileUtils.hasPath(name)) {\n throw new Error(`Invalid filename provided: ${name}`);\n }\n const parts = name.split('/');\n parts.pop();\n return `${parts.join('/')}/`;\n }\n\n /**\n * Check if a given file name includes the full path\n * @param name The file name to check\n * @returns True if it's a full path, false otherwise\n */\n static hasPath(name: string): boolean {\n return name.startsWith('/');\n }\n\n /**\n * Check a given file name is a path\n * @param name The file name to check\n * @returns True if it's a full path, false otherwise\n */\n static isPath(name: string): boolean {\n return name.startsWith('/') && name.endsWith('/');\n }\n\n /**\n * Turns a directory file name into a path. Basically ensures there's a trailing slash\n * @param name The directory name to make a path\n */\n static makePath(name: string): string {\n if (!name.endsWith('/')) {\n return `${name}/`;\n }\n return name;\n }\n\n /**\n * Replace extension in the item name\n * @param name Name to replace the extension in\n * @param newExtension New extension, defaults to no extension\n */\n static replaceExtension(name: string, newExtension = ''): string {\n const index = name.lastIndexOf('.');\n const nameWithoutExtension = index > -1 ? name.substring(0, index) : name;\n const extensionString = FileUtils.fileExtensionToString(newExtension);\n return `${nameWithoutExtension}${extensionString}`;\n }\n\n /**\n * Validate the provided name. Throws an error if validation fails\n * @param name The item name to validate\n */\n static validateName(name: string): void {\n // Static checks\n const reservedNames = ['.', '..'];\n // Global flag to show all invalid chars, not just the first match\n const invalidCharsRegex = /[\\\\/\\0]/g;\n const invalidCharLabels = new Map([['\\0', 'null']]);\n\n if (!name) {\n throw new ValidationError(`Name cannot be empty`);\n }\n if (reservedNames.includes(name)) {\n throw new ValidationError(`\"${name}\" is a reserved name`);\n }\n if (invalidCharsRegex.test(name)) {\n throw new ValidationError(\n `Invalid characters in name: \"${\n name\n .match(invalidCharsRegex)\n // Filter out duplicates\n ?.reduce(\n (acc, next) => (acc.includes(next) ? acc : [...acc, next]),\n [] as string[]\n )\n .map(char =>\n invalidCharLabels.has(char) ? invalidCharLabels.get(char) : char\n )\n .join('\", \"') ?? ''\n }\"`\n );\n }\n }\n\n /**\n * Reduce the provided paths to the minimum selection.\n * Removes any nested files or directories if a parent is already selected.\n * @param paths The paths to reduce\n */\n static reducePaths(paths: string[]): string[] {\n const folders = paths.filter(path => FileUtils.isPath(path));\n return paths.filter(\n path =>\n !folders.some(folder => path !== folder && path.startsWith(folder))\n );\n }\n\n /**\n * Removes the root path from the provided file name. Throws if the filename does not start with root.\n * @param root The root to remove\n * @param filename Filename to remove the root path from\n * @returns Filename without the root\n */\n static removeRoot(root: string, filename: string): string {\n if (root.length === 0) {\n return filename;\n }\n if (!filename.startsWith(root)) {\n throw new Error(\n `Filename ${filename} does not start with expected root ${root}`\n );\n }\n\n return filename.substring(root.length);\n }\n\n /**\n * Add root to the filename as prefix\n * @param path Filename to prefix root to\n * @returns Filename with root at the prefix\n */\n static addRoot(root: string, path: string): string {\n return `${root}${path}`;\n }\n}\n\nexport default FileUtils;\n"],"mappings":";;AAAA,SAASA,eAAe,QAAQ,kBAAkB;AAAC,OAC5CC,iBAAiB;AAGxB;AACA;AACA;AACA,WAAYC,SAAS;;AASrB;AACA;AACA;AAFA,WATYA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;AAAA,GAATA,SAAS,KAATA,SAAS;AAYrB,OAAO,MAAMC,SAAS,CAAC;EACrB,OAAaC,UAAU,CACrBC,WAAwB,EACxBC,IAAY,EACM;IAAA;MAClB,IAAI;QACF,MAAMD,WAAW,CAACE,IAAI,CAACD,IAAI,CAAC;QAC5B,OAAO,IAAI;MACb,CAAC,CAAC,OAAOE,CAAC,EAAE;QACV;QACA,IAAI,EAAEA,CAAC,YAAYP,iBAAiB,CAAC,EAAE;UACrC,MAAMO,CAAC;QACT;QACA,OAAO,KAAK;MACd;IAAC;EACH;;EAEA;AACF;AACA;AACA;AACA;EACE,OAAOC,qBAAqB,GAAyB;IAAA,IAAxBC,SAAS,uEAAG,EAAE;IACzC,OAAOA,SAAS,CAACC,MAAM,KAAK,CAAC,GAAG,EAAE,cAAOD,SAAS,CAAE;EACtD;;EAEA;AACF;AACA;AACA;EACE,O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,IACF,CAACF,OAAO,CAACG,IAAI,CAACC,MAAM,IAAIF,IAAI,KAAKE,MAAM,IAAIF,IAAI,CAAC3B,UAAU,CAAC6B,MAAM,CAAC,CAAC,CACtE;EACH;;EAEA;AACF;AACA;AACA;AACA;AACA;EACE,OAAOC,UAAU,CAACC,IAAY,EAAEC,QAAgB,EAAU;IACxD,IAAID,IAAI,CAAC7D,MAAM,KAAK,CAAC,EAAE;MACrB,OAAO8D,QAAQ;IACjB;IACA,IAAI,CAACA,QAAQ,CAAChC,UAAU,CAAC+B,IAAI,CAAC,EAAE;MAC9B,MAAM,IAAI1D,KAAK,oBACD2D,QAAQ,gDAAsCD,IAAI,EAC/D;IACH;IAEA,OAAOC,QAAQ,CAAC/C,SAAS,CAAC8C,IAAI,CAAC7D,MAAM,CAAC;EACxC;;EAEA;AACF;AACA;AACA;AACA;EACE,OAAO+D,OAAO,CAACF,IAAY,EAAEJ,IAAY,EAAU;IACjD,iBAAUI,IAAI,SAAGJ,IAAI;EACvB;AACF;AAEA,eAAejE,SAAS"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deephaven/file-explorer",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.50.0",
|
|
4
4
|
"description": "Deephaven File Explorer React component",
|
|
5
5
|
"author": "Deephaven Data Labs LLC",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -22,11 +22,11 @@
|
|
|
22
22
|
"build:sass": "sass --embed-sources --load-path=../../node_modules ./src:./dist"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@deephaven/components": "^0.
|
|
26
|
-
"@deephaven/icons": "^0.
|
|
27
|
-
"@deephaven/log": "^0.
|
|
28
|
-
"@deephaven/storage": "^0.
|
|
29
|
-
"@deephaven/utils": "^0.
|
|
25
|
+
"@deephaven/components": "^0.50.0",
|
|
26
|
+
"@deephaven/icons": "^0.50.0",
|
|
27
|
+
"@deephaven/log": "^0.50.0",
|
|
28
|
+
"@deephaven/storage": "^0.50.0",
|
|
29
|
+
"@deephaven/utils": "^0.50.0",
|
|
30
30
|
"@fortawesome/fontawesome-svg-core": "^6.2.1",
|
|
31
31
|
"@fortawesome/react-fontawesome": "^0.2.0",
|
|
32
32
|
"classnames": "^2.3.1",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"react": "^17.0.0"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
|
-
"@deephaven/mocks": "^0.
|
|
40
|
+
"@deephaven/mocks": "^0.50.0"
|
|
41
41
|
},
|
|
42
42
|
"files": [
|
|
43
43
|
"dist"
|
|
@@ -48,5 +48,5 @@
|
|
|
48
48
|
"publishConfig": {
|
|
49
49
|
"access": "public"
|
|
50
50
|
},
|
|
51
|
-
"gitHead": "
|
|
51
|
+
"gitHead": "cf1b368742a7700b08a8d2eda43671856913c9c7"
|
|
52
52
|
}
|