@@ -39,6 +39,13 @@ export type FlagInput = FlagValues | string[] | readonly string[] | undefined
3939 * Get the appropriate log level based on flags.
4040 * Returns 'silent', 'error', 'warn', 'info', 'verbose', or 'debug'.
4141 * Accepts FlagValues object, process.argv array, or undefined (uses process.argv).
42+ *
43+ * @example
44+ * ```typescript
45+ * getLogLevel() // 'info' (default)
46+ * getLogLevel({ quiet: true }) // 'silent'
47+ * getLogLevel(['--debug']) // 'debug'
48+ * ```
4249 */
4350export function getLogLevel ( input ?: FlagInput ) : string {
4451 if ( isQuiet ( input ) ) {
@@ -56,6 +63,12 @@ export function getLogLevel(input?: FlagInput): string {
5663/**
5764 * Check if all flag is set.
5865 * Accepts FlagValues object, process.argv array, or undefined (uses process.argv).
66+ *
67+ * @example
68+ * ```typescript
69+ * isAll({ all: true }) // true
70+ * isAll(['--all']) // true
71+ * ```
5972 */
6073export function isAll ( input ?: FlagInput ) : boolean {
6174 if ( ! input ) {
@@ -70,6 +83,12 @@ export function isAll(input?: FlagInput): boolean {
7083/**
7184 * Check if changed files mode is enabled.
7285 * Accepts FlagValues object, process.argv array, or undefined (uses process.argv).
86+ *
87+ * @example
88+ * ```typescript
89+ * isChanged({ changed: true }) // true
90+ * isChanged(['--changed']) // true
91+ * ```
7392 */
7493export function isChanged ( input ?: FlagInput ) : boolean {
7594 if ( ! input ) {
@@ -85,6 +104,12 @@ export function isChanged(input?: FlagInput): boolean {
85104 * Check if coverage mode is enabled.
86105 * Checks both 'coverage' and 'cover' flags.
87106 * Accepts FlagValues object, process.argv array, or undefined (uses process.argv).
107+ *
108+ * @example
109+ * ```typescript
110+ * isCoverage({ coverage: true }) // true
111+ * isCoverage(['--cover']) // true
112+ * ```
88113 */
89114export function isCoverage ( input ?: FlagInput ) : boolean {
90115 if ( ! input ) {
@@ -99,6 +124,12 @@ export function isCoverage(input?: FlagInput): boolean {
99124/**
100125 * Check if debug mode is enabled.
101126 * Accepts FlagValues object, process.argv array, or undefined (uses process.argv).
127+ *
128+ * @example
129+ * ```typescript
130+ * isDebug({ debug: true }) // true
131+ * isDebug(['--debug']) // true
132+ * ```
102133 */
103134export function isDebug ( input ?: FlagInput ) : boolean {
104135 if ( ! input ) {
@@ -113,6 +144,12 @@ export function isDebug(input?: FlagInput): boolean {
113144/**
114145 * Check if dry-run mode is enabled.
115146 * Accepts FlagValues object, process.argv array, or undefined (uses process.argv).
147+ *
148+ * @example
149+ * ```typescript
150+ * isDryRun({ 'dry-run': true }) // true
151+ * isDryRun(['--dry-run']) // true
152+ * ```
116153 */
117154export function isDryRun ( input ?: FlagInput ) : boolean {
118155 if ( ! input ) {
@@ -127,6 +164,12 @@ export function isDryRun(input?: FlagInput): boolean {
127164/**
128165 * Check if fix/autofix mode is enabled.
129166 * Accepts FlagValues object, process.argv array, or undefined (uses process.argv).
167+ *
168+ * @example
169+ * ```typescript
170+ * isFix({ fix: true }) // true
171+ * isFix(['--fix']) // true
172+ * ```
130173 */
131174export function isFix ( input ?: FlagInput ) : boolean {
132175 if ( ! input ) {
@@ -141,6 +184,12 @@ export function isFix(input?: FlagInput): boolean {
141184/**
142185 * Check if force mode is enabled.
143186 * Accepts FlagValues object, process.argv array, or undefined (uses process.argv).
187+ *
188+ * @example
189+ * ```typescript
190+ * isForce({ force: true }) // true
191+ * isForce(['--force']) // true
192+ * ```
144193 */
145194export function isForce ( input ?: FlagInput ) : boolean {
146195 if ( ! input ) {
@@ -155,6 +204,12 @@ export function isForce(input?: FlagInput): boolean {
155204/**
156205 * Check if help flag is set.
157206 * Accepts FlagValues object, process.argv array, or undefined (uses process.argv).
207+ *
208+ * @example
209+ * ```typescript
210+ * isHelp({ help: true }) // true
211+ * isHelp(['-h']) // true
212+ * ```
158213 */
159214export function isHelp ( input ?: FlagInput ) : boolean {
160215 if ( ! input ) {
@@ -169,6 +224,12 @@ export function isHelp(input?: FlagInput): boolean {
169224/**
170225 * Check if JSON output is requested.
171226 * Accepts FlagValues object, process.argv array, or undefined (uses process.argv).
227+ *
228+ * @example
229+ * ```typescript
230+ * isJson({ json: true }) // true
231+ * isJson(['--json']) // true
232+ * ```
172233 */
173234export function isJson ( input ?: FlagInput ) : boolean {
174235 if ( ! input ) {
@@ -183,6 +244,12 @@ export function isJson(input?: FlagInput): boolean {
183244/**
184245 * Check if quiet/silent mode is enabled.
185246 * Accepts FlagValues object, process.argv array, or undefined (uses process.argv).
247+ *
248+ * @example
249+ * ```typescript
250+ * isQuiet({ quiet: true }) // true
251+ * isQuiet(['--silent']) // true
252+ * ```
186253 */
187254export function isQuiet ( input ?: FlagInput ) : boolean {
188255 if ( ! input ) {
@@ -197,6 +264,12 @@ export function isQuiet(input?: FlagInput): boolean {
197264/**
198265 * Check if staged files mode is enabled.
199266 * Accepts FlagValues object, process.argv array, or undefined (uses process.argv).
267+ *
268+ * @example
269+ * ```typescript
270+ * isStaged({ staged: true }) // true
271+ * isStaged(['--staged']) // true
272+ * ```
200273 */
201274export function isStaged ( input ?: FlagInput ) : boolean {
202275 if ( ! input ) {
@@ -211,6 +284,12 @@ export function isStaged(input?: FlagInput): boolean {
211284/**
212285 * Check if update mode is enabled (for snapshots, dependencies, etc).
213286 * Accepts FlagValues object, process.argv array, or undefined (uses process.argv).
287+ *
288+ * @example
289+ * ```typescript
290+ * isUpdate({ update: true }) // true
291+ * isUpdate(['-u']) // true
292+ * ```
214293 */
215294export function isUpdate ( input ?: FlagInput ) : boolean {
216295 if ( ! input ) {
@@ -225,6 +304,12 @@ export function isUpdate(input?: FlagInput): boolean {
225304/**
226305 * Check if verbose mode is enabled.
227306 * Accepts FlagValues object, process.argv array, or undefined (uses process.argv).
307+ *
308+ * @example
309+ * ```typescript
310+ * isVerbose({ verbose: true }) // true
311+ * isVerbose(['--verbose']) // true
312+ * ```
228313 */
229314export function isVerbose ( input ?: FlagInput ) : boolean {
230315 if ( ! input ) {
@@ -239,6 +324,12 @@ export function isVerbose(input?: FlagInput): boolean {
239324/**
240325 * Check if watch mode is enabled.
241326 * Accepts FlagValues object, process.argv array, or undefined (uses process.argv).
327+ *
328+ * @example
329+ * ```typescript
330+ * isWatch({ watch: true }) // true
331+ * isWatch(['-w']) // true
332+ * ```
242333 */
243334export function isWatch ( input ?: FlagInput ) : boolean {
244335 if ( ! input ) {
0 commit comments