diff --git a/datetime/mod.ts b/datetime/mod.ts index 1e75ba4dcb..a5c2648b02 100644 --- a/datetime/mod.ts +++ b/datetime/mod.ts @@ -3,10 +3,9 @@ export type DateFormat = "mm-dd-yyyy" | "dd-mm-yyyy" | "yyyy-mm-dd"; /** * Parse date from string using format string - * - * @param {string} dateStr - date string - * @param {DateFormat} format - format string - * @return {Date} Parsed date + * @param dateStr Date string + * @param format Format string + * @return Parsed date */ export function parseDate(dateStr: string, format: DateFormat): Date { let m, d, y: string; @@ -42,10 +41,9 @@ export type DateTimeFormat = /** * Parse date & time from string using format string - * - * @param {string} dateStr - date & time string - * @param {DateTimeFormat} format - format string - * @return {Date} Parsed date + * @param dateStr Date & time string + * @param format Format string + * @return Parsed date */ export function parseDateTime( datetimeStr: string, @@ -88,9 +86,9 @@ export function parseDateTime( /** * Get number of the day in the year - * @return {number} Number of the day in year + * @return Number of the day in year */ -export function dayOfYear(date: Date): any { +export function dayOfYear(date: Date): number { const dayMs = 1000 * 60 * 60 * 24; const yearStart = new Date(date.getFullYear(), 0, 0); const diff = @@ -102,8 +100,7 @@ export function dayOfYear(date: Date): any { /** * Get number of current day in year - * - * @return {number} Number of current day in year + * @return Number of current day in year */ export function currentDayOfYear(): number { return dayOfYear(new Date()); diff --git a/fs/empty_dir.ts b/fs/empty_dir.ts index 2ca9efb0cf..72f5f9f515 100644 --- a/fs/empty_dir.ts +++ b/fs/empty_dir.ts @@ -4,9 +4,6 @@ * Deletes directory contents if the directory is not empty. * If the directory does not exist, it is created. * The directory itself is not deleted. - * @export - * @param {string} dir - * @returns {Promise} */ export async function emptyDir(dir: string): Promise { let items: Deno.FileInfo[] = []; @@ -30,9 +27,6 @@ export async function emptyDir(dir: string): Promise { * Deletes directory contents if the directory is not empty. * If the directory does not exist, it is created. * The directory itself is not deleted. - * @export - * @param {string} dir - * @returns {void} */ export function emptyDirSync(dir: string): void { let items: Deno.FileInfo[] = []; diff --git a/fs/ensure_dir.ts b/fs/ensure_dir.ts index 5a5cc0a013..e7e4f69a20 100644 --- a/fs/ensure_dir.ts +++ b/fs/ensure_dir.ts @@ -1,9 +1,8 @@ // Copyright 2018-2019 the Deno authors. All rights reserved. MIT license. + /** - * Ensures that the directory exists. If the directory structure does not exist, it is created. Like mkdir -p. - * @export - * @param {string} dir - * @returns {Promise} + * Ensures that the directory exists. + * If the directory structure does not exist, it is created. Like mkdir -p. */ export async function ensureDir(dir: string): Promise { try { @@ -16,10 +15,8 @@ export async function ensureDir(dir: string): Promise { } /** - * Ensures that the directory exists. If the directory structure does not exist, it is created. Like mkdir -p. - * @export - * @param {string} dir - * @returns {void} + * Ensures that the directory exists. + * If the directory structure does not exist, it is created. Like mkdir -p. */ export function ensureDirSync(dir: string): void { try { diff --git a/fs/ensure_file.ts b/fs/ensure_file.ts index ef0af5300a..56632f1502 100644 --- a/fs/ensure_file.ts +++ b/fs/ensure_file.ts @@ -1,12 +1,11 @@ // Copyright 2018-2019 the Deno authors. All rights reserved. MIT license. import * as path from "./path/mod.ts"; import { ensureDir, ensureDirSync } from "./ensure_dir.ts"; + /** * Ensures that the file exists. - * If the file that is requested to be created is in directories that do not exist, these directories are created. If the file already exists, it is NOT MODIFIED. - * @export - * @param {string} filePath - * @returns {Promise} + * If the file that is requested to be created is in directories that do not exist, + * these directories are created. If the file already exists, it is NOT MODIFIED. */ export async function ensureFile(filePath: string): Promise { try { @@ -23,10 +22,8 @@ export async function ensureFile(filePath: string): Promise { /** * Ensures that the file exists. - * If the file that is requested to be created is in directories that do not exist, these directories are created. If the file already exists, it is NOT MODIFIED. - * @export - * @param {string} filePath - * @returns {void} + * If the file that is requested to be created is in directories that do not exist, + * these directories are created. If the file already exists, it is NOT MODIFIED. */ export function ensureFileSync(filePath: string): void { try { diff --git a/fs/exists.ts b/fs/exists.ts index aa961037d9..41961a0f23 100644 --- a/fs/exists.ts +++ b/fs/exists.ts @@ -1,22 +1,13 @@ // Copyright 2018-2019 the Deno authors. All rights reserved. MIT license. -/** - * Test whether or not the given path exists by checking with the file system - * @export - * @param {string} filePath - * @returns {Promise} - */ + +/** Test whether or not the given path exists by checking with the file system */ export async function exists(filePath: string): Promise { return Deno.stat(filePath) .then(() => true) .catch(() => false); } -/** - * Test whether or not the given path exists by checking with the file system - * @export - * @param {string} filePath - * @returns {boolean} - */ +/** Test whether or not the given path exists by checking with the file system */ export function existsSync(filePath: string): boolean { try { Deno.statSync(filePath); diff --git a/fs/globrex.ts b/fs/globrex.ts index c3cf7a3372..439cea3488 100644 --- a/fs/globrex.ts +++ b/fs/globrex.ts @@ -23,14 +23,14 @@ export interface GlobrexResult { /** * Convert any glob pattern to a JavaScript Regexp object - * @param {String} glob Glob pattern to convert - * @param {Object} opts Configuration object - * @param {Boolean} [opts.extended=false] Support advanced ext globbing - * @param {Boolean} [opts.globstar=false] Support globstar - * @param {Boolean} [opts.strict=true] be laissez faire about mutiple slashes - * @param {Boolean} [opts.filepath=''] Parse as filepath for extra path related features - * @param {String} [opts.flags=''] RegExp globs - * @returns {Object} converted object with string, segments and RegExp object + * @param glob Glob pattern to convert + * @param opts Configuration object + * @param [opts.extended=false] Support advanced ext globbing + * @param [opts.globstar=false] Support globstar + * @param [opts.strict=true] be laissez faire about mutiple slashes + * @param [opts.filepath=""] Parse as filepath for extra path related features + * @param [opts.flags=""] RegExp globs + * @returns Converted object with string, segments and RegExp object */ export function globrex( glob: string, diff --git a/fs/move.ts b/fs/move.ts index f645097886..eb6352bd54 100644 --- a/fs/move.ts +++ b/fs/move.ts @@ -15,14 +15,7 @@ function isSrcSubdir(src: string, dest: string): boolean { }, true); } -/** - * Moves a file or directory - * @export - * @param {string} src - * @param {string} dest - * @param {MoveOptions} [options] - * @returns {Promise} - */ +/** Moves a file or directory */ export async function move( src: string, dest: string, @@ -52,14 +45,7 @@ export async function move( return; } -/** - * Moves a file or directory - * @export - * @param {string} src - * @param {string} dest - * @param {MoveOptions} [options] - * @returns {void} - */ +/** Moves a file or directory */ export function moveSync( src: string, dest: string, diff --git a/fs/read_json.ts b/fs/read_json.ts index d5c639ae2a..1bed750782 100644 --- a/fs/read_json.ts +++ b/fs/read_json.ts @@ -1,12 +1,7 @@ // Copyright 2018-2019 the Deno authors. All rights reserved. MIT license. import * as path from "./path/mod.ts"; -/** - * Reads a JSON file and then parses it into an object - * @export - * @param {string} filePath - * @returns {Promise} - */ +/** Reads a JSON file and then parses it into an object */ export async function readJson(filePath: string): Promise { filePath = path.resolve(filePath); const decoder = new TextDecoder("utf-8"); @@ -21,12 +16,7 @@ export async function readJson(filePath: string): Promise { } } -/** - * Reads a JSON file and then parses it into an object - * @export - * @param {string} filePath - * @returns {void} - */ +/** Reads a JSON file and then parses it into an object */ export function readJsonSync(filePath: string): any { filePath = path.resolve(filePath); const decoder = new TextDecoder("utf-8");