Browse Source

Updated the documentation

master
Cédric Belin 6 months ago
parent
commit
3d20019d43
9 changed files with 12 additions and 12 deletions
  1. +2
    -2
      lib/checker.d.ts
  2. +2
    -2
      lib/checker.js
  3. +1
    -1
      lib/reporter.d.ts
  4. +1
    -1
      lib/reporter.js
  5. +2
    -2
      src/checker.ts
  6. +1
    -1
      src/reporter.ts
  7. +1
    -1
      test/checker_test.js
  8. +1
    -1
      test/factory_test.js
  9. +1
    -1
      test/reporter_test.js

+ 2
- 2
lib/checker.d.ts View File

@@ -41,8 +41,8 @@ export declare class Checker extends Transform {
* @param file The file to read.
* @param encoding The file encoding.
* @return A manifest providing a list of dependencies.
* @throws [[Error]] The file is a stream or is empty.
* @throws [[SyntaxError]] The manifest has an invalid format.
* @throws `Error` The file is a stream or is empty.
* @throws `SyntaxError` The manifest has an invalid format.
*/
parseManifest(file: File, encoding?: string): Record<string, any>;
/**


+ 2
- 2
lib/checker.js View File

@@ -45,8 +45,8 @@ export class Checker extends Transform {
* @param file The file to read.
* @param encoding The file encoding.
* @return A manifest providing a list of dependencies.
* @throws [[Error]] The file is a stream or is empty.
* @throws [[SyntaxError]] The manifest has an invalid format.
* @throws `Error` The file is a stream or is empty.
* @throws `SyntaxError` The manifest has an invalid format.
*/
parseManifest(file, encoding = 'utf8') {
if (file.isNull())


+ 1
- 1
lib/reporter.d.ts View File

@@ -14,7 +14,7 @@ export declare class ConsoleReporter implements Reporter {
* @param file The file providing the outdated dependencies.
* @param returnOutput Value indicating whether to return the output of the outdated dependencies, rather than print it.
* @return The output of the outdated dependencies.
* @throws [[Error]] The dependencies were not found in the file.
* @throws `Error` The dependencies were not found in the file.
*/
log(file: File, returnOutput?: boolean): string | void;
/**


+ 1
- 1
lib/reporter.js View File

@@ -7,7 +7,7 @@ export class ConsoleReporter {
* @param file The file providing the outdated dependencies.
* @param returnOutput Value indicating whether to return the output of the outdated dependencies, rather than print it.
* @return The output of the outdated dependencies.
* @throws [[Error]] The dependencies were not found in the file.
* @throws `Error` The dependencies were not found in the file.
*/
log(file, returnOutput = false) {
if (!('david' in file))


+ 2
- 2
src/checker.ts View File

@@ -80,8 +80,8 @@ export class Checker extends Transform {
* @param file The file to read.
* @param encoding The file encoding.
* @return A manifest providing a list of dependencies.
* @throws [[Error]] The file is a stream or is empty.
* @throws [[SyntaxError]] The manifest has an invalid format.
* @throws `Error` The file is a stream or is empty.
* @throws `SyntaxError` The manifest has an invalid format.
*/
parseManifest(file: File, encoding: string = 'utf8'): Record<string, any> {
if (file.isNull()) throw new Error('Empty manifest.');


+ 1
- 1
src/reporter.ts View File

@@ -21,7 +21,7 @@ export class ConsoleReporter implements Reporter {
* @param file The file providing the outdated dependencies.
* @param returnOutput Value indicating whether to return the output of the outdated dependencies, rather than print it.
* @return The output of the outdated dependencies.
* @throws [[Error]] The dependencies were not found in the file.
* @throws `Error` The dependencies were not found in the file.
*/
log(file: File, returnOutput: boolean = false): string|void {
if (!('david' in file)) throw new Error('[@cedx/david] Dependencies not found.');


+ 1
- 1
test/checker_test.js View File

@@ -4,7 +4,7 @@ import {Readable} from 'stream';
import File from 'vinyl';
import {Checker} from '../lib/index.js';

/** Tests the features of the {@link Checker} class. */
/** Tests the features of the `Checker` class. */
describe('Checker', function() {
this.timeout(15000);
const pkg = JSON.parse(readFileSync('package.json', 'utf8'));


+ 1
- 1
test/factory_test.js View File

@@ -1,7 +1,7 @@
import {strict as assert} from 'assert';
import {Checker, ConsoleReporter, david} from '../lib/index.js';

/** Tests the features of the factory function. */
/** Tests the features of the `david()` function. */
describe('Factory', () => {
describe('david()', () => {
it('should return a `Checker` with a `ConsoleReporter`', () => {


+ 1
- 1
test/reporter_test.js View File

@@ -2,7 +2,7 @@ import {strict as assert} from 'assert';
import File from 'vinyl';
import {ConsoleReporter} from '../lib/index.js';

/** Tests the features of the {@link ConsoleReporter} class. */
/** Tests the features of the `ConsoleReporter` class. */
describe('ConsoleReporter', () => {
describe('.log()', () => {
const file = new File({contents: Buffer.from('{"name": "@cedx/gulp-david"}'), path: '/foo.js'});


Loading…
Cancel
Save