Commit 1aa2a240 authored by Paul Slaughter's avatar Paul Slaughter

Update jsdoc and add destructuring

- Per maintainer review
parent 02f5ed95
...@@ -25,10 +25,10 @@ export default { ...@@ -25,10 +25,10 @@ export default {
}, },
methods: { methods: {
createFile(target, file) { createFile(target, file) {
const { name } = file; const { name, type: mimeType } = file;
const encodedContent = target.result.split('base64,')[1]; const encodedContent = target.result.split('base64,')[1];
const rawContent = encodedContent ? atob(encodedContent) : ''; const rawContent = encodedContent ? atob(encodedContent) : '';
const isText = isTextFile({ content: rawContent, mimeType: file.type, name }); const isText = isTextFile({ content: rawContent, mimeType, name });
const emitCreateEvent = content => const emitCreateEvent = content =>
this.$emit('create', { this.$emit('create', {
...@@ -36,7 +36,7 @@ export default { ...@@ -36,7 +36,7 @@ export default {
type: 'blob', type: 'blob',
content, content,
rawPath: !isText ? URL.createObjectURL(file) : '', rawPath: !isText ? URL.createObjectURL(file) : '',
mimeType: file.type, mimeType,
}); });
if (isText) { if (isText) {
......
...@@ -12,7 +12,11 @@ export const splitParent = path => { ...@@ -12,7 +12,11 @@ export const splitParent = path => {
/** /**
* Create file objects from a list of file paths. * Create file objects from a list of file paths.
* *
* @param options.blobData Values to initialize each blob with * @param {Array} options.data Array of blob paths to parse and create a file tree from.
* @param {Boolean} options.tempFile Web IDE flag for whether this is a "new" file or not.
* @param {String} options.content Content to initialize the new blob with.
* @param {String} options.rawPath Raw path used for the new blob.
* @param {Object} options.blobData Extra values to initialize each blob with.
*/ */
export const decorateFiles = ({ export const decorateFiles = ({
data, data,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment