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 {
},
methods: {
createFile(target, file) {
const { name } = file;
const { name, type: mimeType } = file;
const encodedContent = target.result.split('base64,')[1];
const rawContent = encodedContent ? atob(encodedContent) : '';
const isText = isTextFile({ content: rawContent, mimeType: file.type, name });
const isText = isTextFile({ content: rawContent, mimeType, name });
const emitCreateEvent = content =>
this.$emit('create', {
......@@ -36,7 +36,7 @@ export default {
type: 'blob',
content,
rawPath: !isText ? URL.createObjectURL(file) : '',
mimeType: file.type,
mimeType,
});
if (isText) {
......
......@@ -12,7 +12,11 @@ export const splitParent = path => {
/**
* 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 = ({
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