mirror of
https://github.com/scratchfoundation/scratch-analysis.git
synced 2025-06-10 12:01:06 -04:00
Address feedback from PR review
This commit is contained in:
parent
020d3ea167
commit
1181cd8313
3 changed files with 14 additions and 16 deletions
lib
|
@ -4,11 +4,11 @@ const sb2 = require('./sb2');
|
|||
const sb3 = require('./sb3');
|
||||
|
||||
module.exports = function (buffer, callback) {
|
||||
parser(buffer, false, (err, project) => {
|
||||
parser(buffer, false, (err, result) => {
|
||||
if (err) return callback(err);
|
||||
|
||||
// Flatten array
|
||||
project = project[0];
|
||||
// Extract only the project object from the parser results
|
||||
const project = result[0];
|
||||
|
||||
// Push project object to the appropriate analysis handler
|
||||
switch (project.projectVersion) {
|
||||
|
@ -18,8 +18,6 @@ module.exports = function (buffer, callback) {
|
|||
case 3:
|
||||
sb3(project, callback);
|
||||
break;
|
||||
default:
|
||||
throw new Error('Unsupported project version');
|
||||
}
|
||||
});
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue