node_modules ignore

This commit is contained in:
2025-05-08 23:43:47 +02:00
parent e19d52f172
commit 4574544c9f
65041 changed files with 10593536 additions and 0 deletions

View File

@@ -0,0 +1,51 @@
'use strict';
var events = require('events');
const createDiagnosticReporter = (options = {})=>{
const { stackSize = -1 } = options;
const emitter = new events.EventEmitter();
const stack = [];
const addListener = (event, listener)=>{
emitter.on(event, listener);
};
const isDiagnosticValid = (diagnostic)=>{
if (!diagnostic.kind || !diagnostic.details || !diagnostic.details.message) {
return false;
}
return true;
};
return {
stack: {
get size () {
return stack.length;
},
get items () {
return stack;
}
},
report (diagnostic) {
if (!isDiagnosticValid(diagnostic)) {
return this;
}
emitter.emit('diagnostic', diagnostic);
emitter.emit(`diagnostic.${diagnostic.kind}`, diagnostic);
if (stackSize !== -1 && stack.length >= stackSize) {
stack.shift();
}
stack.push(diagnostic);
return this;
},
onDiagnostic (listener) {
addListener('diagnostic', listener);
return this;
},
on (kind, listener) {
addListener(`diagnostic.${kind}`, listener);
return this;
}
};
};
exports.createDiagnosticReporter = createDiagnosticReporter;
//# sourceMappingURL=diagnostic.js.map