mirror of
https://github.com/scratchfoundation/scratch-analysis.git
synced 2025-05-15 15:20:27 -04:00
Don't set origin at all if it doesn't exist.
This commit is contained in:
parent
26ff6d7265
commit
22d822d1f8
2 changed files with 6 additions and 4 deletions
|
@ -126,9 +126,11 @@ const extensions = function (list) {
|
||||||
};
|
};
|
||||||
|
|
||||||
const metadata = function (meta) {
|
const metadata = function (meta) {
|
||||||
return {
|
let obj = {};
|
||||||
origin: meta.origin ? meta.origin : ''
|
if (meta.origin) {
|
||||||
};
|
obj.origin = meta.origin;
|
||||||
|
}
|
||||||
|
return obj;
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports = function (project, callback) {
|
module.exports = function (project, callback) {
|
||||||
|
|
|
@ -140,7 +140,7 @@ test('defalt (binary)', t => {
|
||||||
t.deepEqual(result.extensions.id, []);
|
t.deepEqual(result.extensions.id, []);
|
||||||
|
|
||||||
t.type(result.meta, 'object');
|
t.type(result.meta, 'object');
|
||||||
t.equal(result.meta.origin, '');
|
t.deepEqual({}, result.meta);
|
||||||
|
|
||||||
t.end();
|
t.end();
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue