@easbot/utils 0.2.0 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -287,6 +287,33 @@ declare namespace Filesystem {
287
287
  function globUp(pattern: string, start: string, stop?: string): Promise<string[]>;
288
288
  }
289
289
 
290
+ declare namespace Ignore {
291
+ interface IgnoreOptions {
292
+ ignorecase?: boolean;
293
+ debug?: boolean;
294
+ }
295
+ function create(options?: IgnoreOptions): IgnoreInstance;
296
+ }
297
+ declare class IgnoreInstance {
298
+ private rules;
299
+ private ignorecase;
300
+ private debug;
301
+ constructor(options?: {
302
+ ignorecase?: boolean;
303
+ debug?: boolean;
304
+ });
305
+ add(patterns: string | readonly string[]): this;
306
+ private parseRule;
307
+ ignores(pathname: string, isDirectory?: boolean): boolean;
308
+ private checkIgnore;
309
+ filter(pathnames: readonly string[]): string[];
310
+ createFilter(): (pathname: string) => boolean;
311
+ private patternToRegex;
312
+ private escapeRegexChar;
313
+ private findMatchingBracket;
314
+ private normalizePath;
315
+ }
316
+
290
317
  declare function createFn<T extends z$1.ZodType, Result>(schema: T, cb: (input: z$1.infer<T>) => Result): {
291
318
  (input: z$1.infer<T>): Result;
292
319
  force(input: z$1.infer<T>): Result;
@@ -564,6 +591,31 @@ declare namespace Slug {
564
591
  function create(): string;
565
592
  }
566
593
 
594
+ declare namespace Semver {
595
+ function isValid(version: string): boolean;
596
+ function parse(version: string): ParsedVersion;
597
+ function format(ver: ParsedVersion): string;
598
+ function compare(v1: string, v2: string): -1 | 0 | 1;
599
+ function satisfies(version: string, range: string): boolean;
600
+ function gt(v1: string, v2: string): boolean;
601
+ function gte(v1: string, v2: string): boolean;
602
+ function lt(v1: string, v2: string): boolean;
603
+ function lte(v1: string, v2: string): boolean;
604
+ function eq(v1: string, v2: string): boolean;
605
+ function sort(versions: string[]): string[];
606
+ function max(versions: string[]): string | null;
607
+ function min(versions: string[]): string | null;
608
+ function inRange(version: string, min: string, max: string): boolean;
609
+ }
610
+ interface ParsedVersion {
611
+ major: number;
612
+ minor: number;
613
+ patch: number;
614
+ prerelease: string[];
615
+ build: string[];
616
+ compare(other: ParsedVersion): -1 | 0 | 1;
617
+ }
618
+
567
619
  type BunBuildTarget = 'bun-darwin-x64' | 'bun-darwin-x64-baseline' | 'bun-darwin-arm64' | 'bun-linux-x64' | 'bun-linux-x64-baseline' | 'bun-linux-x64-modern' | 'bun-linux-arm64' | 'bun-linux-x64-musl' | 'bun-linux-arm64-musl' | 'bun-windows-x64' | 'bun-windows-x64-baseline' | 'bun-windows-x64-modern';
568
620
  interface BunCompileOptions {
569
621
  target?: BunBuildTarget | string;
@@ -1343,4 +1395,4 @@ declare function initLog(options: {
1343
1395
  level?: 'DEBUG' | 'INFO' | 'WARN' | 'ERROR';
1344
1396
  }): Promise<void>;
1345
1397
 
1346
- export { $, Archive, AsyncQueue, Binary, type CodeSpanIndex$1 as CodeSpanIndex, Color, Context, type EasServer, Encode, EventLoop, type FenceSpan$1 as FenceSpan, Filesystem, Fn, type FormatOptions, type GitResult, Glob, Identifier, type InlineCodeState$1 as InlineCodeState, Keybind, Lazy, Locale, Lock, Markdown, type MarkdownConfig, type MarkdownIR, type MarkdownLinkSpan, type MarkdownParseOptions, type MarkdownStyle, type MarkdownStyleSpan, type MarkdownTableMode, type MiddlewareDefinition, NamedError, type NodeSpawnObjectArgs, type NodeSpawnOptions, type NodeSpawnResult, type NodeWhichOptions, PKG, PackageRegistry, type ParsedFrontmatter, PkgShell, Process, type RPCMethod, type RenderLink, type RenderOptions, type RouteDefinition, type SSEHandler, type ServerOptions, Slug, type StreamHandler, type StyleMarker, Token, TruncateContent, type WebSocketHandler, type WebSocketRouteDefinition, Wildcard, abortAfter, abortAfterAny, buildCodeSpanIndex, chunkMarkdownIR, chunkText, chunkTextByBreakResolver, convertMarkdownTables, createInlineCodeState, createPkgShell, createRESTServer, createRPCServer, createServer, createStreamingServer, createWebSocketServer, defer, extractFrontmatter, findFenceSpanAt, findLast, fn, formatDuration, formatLocalISO, formatLocalISOCompact, formatLogTime, formatMarkdown, getDirectory, getFileExtension, getFilename, getFilenameTruncated, getTimezoneOffset, git, iife, initLog, isSafeFenceBreak, lazy, lazyAsync, loadEnv, loadTextFile, loadTextFileAsync, markdownToIR, markdownToIRWithMeta, now, nowLocalISO, parseFenceSpans, parseFrontmatterBlock, parseLocalISO, parseModelId, proxied, readableStreamToText, renderMarkdown, renderMarkdownWithMarkers, retry, scanParenAwareBreakpoints, serializeFrontmatter, shell, signal, startServer, truncateMiddle, updateSchema, whichSync, withTimeout, work };
1398
+ export { $, Archive, AsyncQueue, Binary, type CodeSpanIndex$1 as CodeSpanIndex, Color, Context, type EasServer, Encode, EventLoop, type FenceSpan$1 as FenceSpan, Filesystem, Fn, type FormatOptions, type GitResult, Glob, Identifier, Ignore, type InlineCodeState$1 as InlineCodeState, Keybind, Lazy, Locale, Lock, Markdown, type MarkdownConfig, type MarkdownIR, type MarkdownLinkSpan, type MarkdownParseOptions, type MarkdownStyle, type MarkdownStyleSpan, type MarkdownTableMode, type MiddlewareDefinition, NamedError, type NodeSpawnObjectArgs, type NodeSpawnOptions, type NodeSpawnResult, type NodeWhichOptions, PKG, PackageRegistry, type ParsedFrontmatter, type ParsedVersion, PkgShell, Process, type RPCMethod, type RenderLink, type RenderOptions, type RouteDefinition, type SSEHandler, Semver, type ServerOptions, Slug, type StreamHandler, type StyleMarker, Token, TruncateContent, type WebSocketHandler, type WebSocketRouteDefinition, Wildcard, abortAfter, abortAfterAny, buildCodeSpanIndex, chunkMarkdownIR, chunkText, chunkTextByBreakResolver, convertMarkdownTables, createInlineCodeState, createPkgShell, createRESTServer, createRPCServer, createServer, createStreamingServer, createWebSocketServer, defer, extractFrontmatter, findFenceSpanAt, findLast, fn, formatDuration, formatLocalISO, formatLocalISOCompact, formatLogTime, formatMarkdown, getDirectory, getFileExtension, getFilename, getFilenameTruncated, getTimezoneOffset, git, iife, initLog, isSafeFenceBreak, lazy, lazyAsync, loadEnv, loadTextFile, loadTextFileAsync, markdownToIR, markdownToIRWithMeta, now, nowLocalISO, parseFenceSpans, parseFrontmatterBlock, parseLocalISO, parseModelId, proxied, readableStreamToText, renderMarkdown, renderMarkdownWithMarkers, retry, scanParenAwareBreakpoints, serializeFrontmatter, shell, signal, startServer, truncateMiddle, updateSchema, whichSync, withTimeout, work };
package/dist/index.d.ts CHANGED
@@ -287,6 +287,33 @@ declare namespace Filesystem {
287
287
  function globUp(pattern: string, start: string, stop?: string): Promise<string[]>;
288
288
  }
289
289
 
290
+ declare namespace Ignore {
291
+ interface IgnoreOptions {
292
+ ignorecase?: boolean;
293
+ debug?: boolean;
294
+ }
295
+ function create(options?: IgnoreOptions): IgnoreInstance;
296
+ }
297
+ declare class IgnoreInstance {
298
+ private rules;
299
+ private ignorecase;
300
+ private debug;
301
+ constructor(options?: {
302
+ ignorecase?: boolean;
303
+ debug?: boolean;
304
+ });
305
+ add(patterns: string | readonly string[]): this;
306
+ private parseRule;
307
+ ignores(pathname: string, isDirectory?: boolean): boolean;
308
+ private checkIgnore;
309
+ filter(pathnames: readonly string[]): string[];
310
+ createFilter(): (pathname: string) => boolean;
311
+ private patternToRegex;
312
+ private escapeRegexChar;
313
+ private findMatchingBracket;
314
+ private normalizePath;
315
+ }
316
+
290
317
  declare function createFn<T extends z$1.ZodType, Result>(schema: T, cb: (input: z$1.infer<T>) => Result): {
291
318
  (input: z$1.infer<T>): Result;
292
319
  force(input: z$1.infer<T>): Result;
@@ -564,6 +591,31 @@ declare namespace Slug {
564
591
  function create(): string;
565
592
  }
566
593
 
594
+ declare namespace Semver {
595
+ function isValid(version: string): boolean;
596
+ function parse(version: string): ParsedVersion;
597
+ function format(ver: ParsedVersion): string;
598
+ function compare(v1: string, v2: string): -1 | 0 | 1;
599
+ function satisfies(version: string, range: string): boolean;
600
+ function gt(v1: string, v2: string): boolean;
601
+ function gte(v1: string, v2: string): boolean;
602
+ function lt(v1: string, v2: string): boolean;
603
+ function lte(v1: string, v2: string): boolean;
604
+ function eq(v1: string, v2: string): boolean;
605
+ function sort(versions: string[]): string[];
606
+ function max(versions: string[]): string | null;
607
+ function min(versions: string[]): string | null;
608
+ function inRange(version: string, min: string, max: string): boolean;
609
+ }
610
+ interface ParsedVersion {
611
+ major: number;
612
+ minor: number;
613
+ patch: number;
614
+ prerelease: string[];
615
+ build: string[];
616
+ compare(other: ParsedVersion): -1 | 0 | 1;
617
+ }
618
+
567
619
  type BunBuildTarget = 'bun-darwin-x64' | 'bun-darwin-x64-baseline' | 'bun-darwin-arm64' | 'bun-linux-x64' | 'bun-linux-x64-baseline' | 'bun-linux-x64-modern' | 'bun-linux-arm64' | 'bun-linux-x64-musl' | 'bun-linux-arm64-musl' | 'bun-windows-x64' | 'bun-windows-x64-baseline' | 'bun-windows-x64-modern';
568
620
  interface BunCompileOptions {
569
621
  target?: BunBuildTarget | string;
@@ -1343,4 +1395,4 @@ declare function initLog(options: {
1343
1395
  level?: 'DEBUG' | 'INFO' | 'WARN' | 'ERROR';
1344
1396
  }): Promise<void>;
1345
1397
 
1346
- export { $, Archive, AsyncQueue, Binary, type CodeSpanIndex$1 as CodeSpanIndex, Color, Context, type EasServer, Encode, EventLoop, type FenceSpan$1 as FenceSpan, Filesystem, Fn, type FormatOptions, type GitResult, Glob, Identifier, type InlineCodeState$1 as InlineCodeState, Keybind, Lazy, Locale, Lock, Markdown, type MarkdownConfig, type MarkdownIR, type MarkdownLinkSpan, type MarkdownParseOptions, type MarkdownStyle, type MarkdownStyleSpan, type MarkdownTableMode, type MiddlewareDefinition, NamedError, type NodeSpawnObjectArgs, type NodeSpawnOptions, type NodeSpawnResult, type NodeWhichOptions, PKG, PackageRegistry, type ParsedFrontmatter, PkgShell, Process, type RPCMethod, type RenderLink, type RenderOptions, type RouteDefinition, type SSEHandler, type ServerOptions, Slug, type StreamHandler, type StyleMarker, Token, TruncateContent, type WebSocketHandler, type WebSocketRouteDefinition, Wildcard, abortAfter, abortAfterAny, buildCodeSpanIndex, chunkMarkdownIR, chunkText, chunkTextByBreakResolver, convertMarkdownTables, createInlineCodeState, createPkgShell, createRESTServer, createRPCServer, createServer, createStreamingServer, createWebSocketServer, defer, extractFrontmatter, findFenceSpanAt, findLast, fn, formatDuration, formatLocalISO, formatLocalISOCompact, formatLogTime, formatMarkdown, getDirectory, getFileExtension, getFilename, getFilenameTruncated, getTimezoneOffset, git, iife, initLog, isSafeFenceBreak, lazy, lazyAsync, loadEnv, loadTextFile, loadTextFileAsync, markdownToIR, markdownToIRWithMeta, now, nowLocalISO, parseFenceSpans, parseFrontmatterBlock, parseLocalISO, parseModelId, proxied, readableStreamToText, renderMarkdown, renderMarkdownWithMarkers, retry, scanParenAwareBreakpoints, serializeFrontmatter, shell, signal, startServer, truncateMiddle, updateSchema, whichSync, withTimeout, work };
1398
+ export { $, Archive, AsyncQueue, Binary, type CodeSpanIndex$1 as CodeSpanIndex, Color, Context, type EasServer, Encode, EventLoop, type FenceSpan$1 as FenceSpan, Filesystem, Fn, type FormatOptions, type GitResult, Glob, Identifier, Ignore, type InlineCodeState$1 as InlineCodeState, Keybind, Lazy, Locale, Lock, Markdown, type MarkdownConfig, type MarkdownIR, type MarkdownLinkSpan, type MarkdownParseOptions, type MarkdownStyle, type MarkdownStyleSpan, type MarkdownTableMode, type MiddlewareDefinition, NamedError, type NodeSpawnObjectArgs, type NodeSpawnOptions, type NodeSpawnResult, type NodeWhichOptions, PKG, PackageRegistry, type ParsedFrontmatter, type ParsedVersion, PkgShell, Process, type RPCMethod, type RenderLink, type RenderOptions, type RouteDefinition, type SSEHandler, Semver, type ServerOptions, Slug, type StreamHandler, type StyleMarker, Token, TruncateContent, type WebSocketHandler, type WebSocketRouteDefinition, Wildcard, abortAfter, abortAfterAny, buildCodeSpanIndex, chunkMarkdownIR, chunkText, chunkTextByBreakResolver, convertMarkdownTables, createInlineCodeState, createPkgShell, createRESTServer, createRPCServer, createServer, createStreamingServer, createWebSocketServer, defer, extractFrontmatter, findFenceSpanAt, findLast, fn, formatDuration, formatLocalISO, formatLocalISOCompact, formatLogTime, formatMarkdown, getDirectory, getFileExtension, getFilename, getFilenameTruncated, getTimezoneOffset, git, iife, initLog, isSafeFenceBreak, lazy, lazyAsync, loadEnv, loadTextFile, loadTextFileAsync, markdownToIR, markdownToIRWithMeta, now, nowLocalISO, parseFenceSpans, parseFrontmatterBlock, parseLocalISO, parseModelId, proxied, readableStreamToText, renderMarkdown, renderMarkdownWithMarkers, retry, scanParenAwareBreakpoints, serializeFrontmatter, shell, signal, startServer, truncateMiddle, updateSchema, whichSync, withTimeout, work };