mirror of
https://github.com/jsdoc/jsdoc.git
synced 2025-12-08 19:46:11 +00:00
refactor(jsdoc-core): remove obsolete getter and method
This commit is contained in:
parent
457c38fd4d
commit
153b899c2e
@ -105,16 +105,6 @@ export default class Env {
|
|||||||
return this.conf;
|
return this.conf;
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Remove.
|
|
||||||
get env() {
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
// TODO: Remove.
|
|
||||||
get(key) {
|
|
||||||
return this[key];
|
|
||||||
}
|
|
||||||
|
|
||||||
get options() {
|
get options() {
|
||||||
return this.opts;
|
return this.opts;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -46,14 +46,6 @@ describe('@jsdoc/core.Env', () => {
|
|||||||
expect(env.emitter).toBeInstanceOf(EventEmitter);
|
expect(env.emitter).toBeInstanceOf(EventEmitter);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('has an `env` getter', () => {
|
|
||||||
expect(env.env).toBe(env);
|
|
||||||
});
|
|
||||||
|
|
||||||
it('has a `get` method that returns the value of the specified property', () => {
|
|
||||||
expect(env.get('sourceFiles')).toBe(env.sourceFiles);
|
|
||||||
});
|
|
||||||
|
|
||||||
it('has a `log` property that contains logging functions', () => {
|
it('has a `log` property that contains logging functions', () => {
|
||||||
expect(env.log).toBeObject();
|
expect(env.log).toBeObject();
|
||||||
|
|
||||||
|
|||||||
@ -29,7 +29,7 @@ function makeDoclet(comment, meta, env) {
|
|||||||
env ??= jsdoc.env;
|
env ??= jsdoc.env;
|
||||||
doclet = new Doclet(`/**\n${comment.join('\n')}\n*/`, meta, env);
|
doclet = new Doclet(`/**\n${comment.join('\n')}\n*/`, meta, env);
|
||||||
if (meta?._emitEvent !== false) {
|
if (meta?._emitEvent !== false) {
|
||||||
env.get('emitter').emit('newDoclet', { doclet });
|
env.emitter.emit('newDoclet', { doclet });
|
||||||
}
|
}
|
||||||
|
|
||||||
return doclet;
|
return doclet;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user