@@ -3,14 +3,12 @@ import path from 'path';
33
44import TraversalData from './TraversalData.js' ;
55
6- import { type } from './typedef.js' ; // eslint-disable-line no-unused-vars
7-
86/**
97 * Get essential info for the given package object consistently formatted.
108 *
119 * @param {object } packageObj - A loaded `package.json` object.
1210 *
13- * @returns {type. PackageObjFormatted|undefined } The formatted package object or undefined.
11+ * @returns {PackageObjFormatted|undefined } The formatted package object or undefined.
1412 */
1513export function formatPackage ( packageObj )
1614{
@@ -58,7 +56,7 @@ export function formatPackage(packageObj)
5856 /**
5957 * Creates the PackageObjFormatted result.
6058 *
61- * @type {type. PackageObjFormatted }
59+ * @type {PackageObjFormatted }
6260 */
6361 const packageData = {
6462 name,
@@ -89,7 +87,7 @@ export function formatPackage(packageObj)
8987 * Note: If malformed data is presented the result will undefined. Also note that a file may be specified that
9088 * does not exist and the directory will be resolved. If that directory exists then resolution will continue.
9189 *
92- * @param {type. PackageQueryOptions } options - The package query options.
90+ * @param {PackageQueryOptions } options - The package query options.
9391 *
9492 * @returns {object|undefined } Loaded `package.json` or undefined if an error has occurred or basepath or root
9593 * directory has been reached.
@@ -105,9 +103,9 @@ export function getPackage(options)
105103/**
106104 * Attempts to find the nearest package.json via `getPackage` then passes the results to `formatPackage`.
107105 *
108- * @param {type. PackageQueryOptions } options - The package query options.
106+ * @param {PackageQueryOptions } options - The package query options.
109107 *
110- * @returns {type. PackageObjFormatted|undefined } Formatted package.json or undefined.
108+ * @returns {PackageObjFormatted|undefined } Formatted package.json or undefined.
111109 */
112110export function getPackageAndFormat ( options )
113111{
@@ -121,9 +119,9 @@ export function getPackageAndFormat(options)
121119 * object / `PackageObjData`. Also note that a file may be specified that does not exist and the directory will be
122120 * resolved. If that directory exists then resolution will continue.
123121 *
124- * @param {type. PackageQueryOptions } options - The package query options.
122+ * @param {PackageQueryOptions } options - The package query options.
125123 *
126- * @returns {type. PackageObjData } Loaded package.json / path or potentially an error.
124+ * @returns {PackageObjData } Loaded package.json / path or potentially an error.
127125 */
128126export function getPackageWithPath ( options )
129127{
@@ -209,7 +207,7 @@ export function getPackageWithPath(options)
209207 * Traversal stops at the first valid `package.json` file as this is how Node works. If the first found `package.json`
210208 * does not have a `type` field then `commonjs` is returned.
211209 *
212- * @param {type. PackageQueryOptions } options - The package query options.
210+ * @param {PackageQueryOptions } options - The package query options.
213211 *
214212 * @returns {string } Type of package - 'module' for ESM otherwise 'commonjs'.
215213 */
0 commit comments