@easbot/utils 0.3.5 → 0.3.8

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
@@ -454,11 +454,9 @@ declare class IgnoreInstance {
454
454
  private parseRule;
455
455
  ignores(pathname: string, isDirectory?: boolean): boolean;
456
456
  private checkIgnore;
457
+ private matchPath;
457
458
  filter(pathnames: readonly string[]): string[];
458
459
  createFilter(): (pathname: string) => boolean;
459
- private patternToRegex;
460
- private escapeRegexChar;
461
- private findMatchingBracket;
462
460
  private normalizePath;
463
461
  }
464
462
 
@@ -1256,6 +1254,10 @@ declare namespace Keybind {
1256
1254
  }
1257
1255
 
1258
1256
  declare namespace Locale {
1257
+ const SUPPORTED_LANGS: readonly ["zh-CN", "en-US"];
1258
+ type Lang = (typeof SUPPORTED_LANGS)[number];
1259
+ const DEFAULT_LANG: Lang;
1260
+ function resolveLocaleLang(override?: string, envKey?: string): Lang;
1259
1261
  function titlecase(str: string): string;
1260
1262
  function time(input: number): string;
1261
1263
  function datetime(input: number): string;
@@ -1266,6 +1268,10 @@ declare namespace Locale {
1266
1268
  function truncateMiddle(str: string, maxLength?: number): string;
1267
1269
  function pluralize(count: number, singular: string, plural: string): string;
1268
1270
  }
1271
+ declare const resolveLocaleLang: typeof Locale.resolveLocaleLang;
1272
+ declare const SUPPORTED_LANGS: readonly ["zh-CN", "en-US"];
1273
+ declare const DEFAULT_LANG: "en-US" | "zh-CN";
1274
+ type Lang = Locale.Lang;
1269
1275
 
1270
1276
  declare namespace Lock {
1271
1277
  function read(key: string): Promise<Disposable>;
@@ -1315,11 +1321,11 @@ declare function updateSchema<T extends z.ZodRawShape>(schema: z.ZodObject<T>):
1315
1321
 
1316
1322
  declare namespace Wildcard {
1317
1323
  function match(str: string, pattern: string): boolean;
1318
- function all(input: string, patterns: Record<string, unknown>): unknown;
1319
- function allStructured(input: {
1324
+ function all<T = unknown>(input: string, patterns: Record<string, T>): T | undefined;
1325
+ function allStructured<T = unknown>(input: {
1320
1326
  head: string;
1321
1327
  tail: string[];
1322
- }, patterns: Record<string, unknown>): unknown;
1328
+ }, patterns: Record<string, T>): T | undefined;
1323
1329
  }
1324
1330
 
1325
1331
  declare namespace Log {
@@ -1357,7 +1363,7 @@ declare namespace Log {
1357
1363
  const Default: Logger;
1358
1364
  interface Options {
1359
1365
  print: boolean;
1360
- logDir: string;
1366
+ logDir?: string;
1361
1367
  logFile?: string;
1362
1368
  dev?: boolean;
1363
1369
  level?: Level;
@@ -1368,4 +1374,4 @@ declare namespace Log {
1368
1374
  function create(tags?: Record<string, any>): Logger;
1369
1375
  }
1370
1376
 
1371
- export { $, Archive, AsyncQueue, Binary, type CodeSpanIndex$1 as CodeSpanIndex, Color, Context, type EasServer, Encode, EventLoop, type FenceSpan$1 as FenceSpan, Fetch, type FetchResponse, Filesystem, Fn, type FormatOptions, type GitResult, Glob, Identifier, Ignore, type InlineCodeState$1 as InlineCodeState, Keybind, Lazy, Locale, Lock, Log, MIME_TYPES, 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 ParseCommandResult, type ParsedFrontmatter, type ParsedVersion, PkgShell, type ProxyOptions, type RPCMethod, type RenderLink, type RenderOptions, type RequestOptions, type RouteDefinition, type SSEHandler, Semver, type ServerOptions, SessionTitle, Shell, Slug, type StreamHandler, type StyleMarker, type TimezoneDateParts, Token, TruncateContent, type WebSocketHandler, type WebSocketRouteDefinition, Wildcard, abortAfter, abortAfterAny, addMinutesInTimezone, buildCodeSpanIndex, chunkMarkdownIR, chunkText, chunkTextByBreakResolver, convertMarkdownTables, createInlineCodeState, createPkgShell, createRESTServer, createRPCServer, createServer, createStreamingServer, createWebSocketServer, defer, detectPlatform, escapeCommandArg, escapeCommandArgSafe, extractFrontmatter, findFenceSpanAt, findLast, fn, formatDuration, formatLocalISO, formatLocalISOCompact, formatLogTime, formatLogTimeMs, formatMarkdown, getDirectory, getFileExtension, getFilename, getFilenameTruncated, getProxyConfig, getProxyUrl, getTimezoneOffset, getTimezoneParts, git, iife, isSafeFenceBreak, isValidTimezone, joinCommandArgs, lazy, lazyAsync, loadEnv, loadTextFile, loadTextFileAsync, markdownToIR, markdownToIRWithMeta, needsShellExecution, normalizeTimezone, now, nowLocalISO, parseCommand, parseCommandWithOptions, parseFenceSpans, parseFrontmatterBlock, parseLocalISO, parseModelId, proxied, readableStreamToText, renderMarkdown, renderMarkdownWithMarkers, retry, scanParenAwareBreakpoints, serializeFrontmatter, shell, signal, startServer, truncateMiddle, updateSchema, whichSync, withTimeout, work };
1377
+ export { $, Archive, AsyncQueue, Binary, type CodeSpanIndex$1 as CodeSpanIndex, Color, Context, DEFAULT_LANG, type EasServer, Encode, EventLoop, type FenceSpan$1 as FenceSpan, Fetch, type FetchResponse, Filesystem, Fn, type FormatOptions, type GitResult, Glob, Identifier, Ignore, type InlineCodeState$1 as InlineCodeState, Keybind, type Lang, Lazy, Locale, Lock, Log, MIME_TYPES, 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 ParseCommandResult, type ParsedFrontmatter, type ParsedVersion, PkgShell, type ProxyOptions, type RPCMethod, type RenderLink, type RenderOptions, type RequestOptions, type RouteDefinition, type SSEHandler, SUPPORTED_LANGS, Semver, type ServerOptions, SessionTitle, Shell, Slug, type StreamHandler, type StyleMarker, type TimezoneDateParts, Token, TruncateContent, type WebSocketHandler, type WebSocketRouteDefinition, Wildcard, abortAfter, abortAfterAny, addMinutesInTimezone, buildCodeSpanIndex, chunkMarkdownIR, chunkText, chunkTextByBreakResolver, convertMarkdownTables, createInlineCodeState, createPkgShell, createRESTServer, createRPCServer, createServer, createStreamingServer, createWebSocketServer, defer, detectPlatform, escapeCommandArg, escapeCommandArgSafe, extractFrontmatter, findFenceSpanAt, findLast, fn, formatDuration, formatLocalISO, formatLocalISOCompact, formatLogTime, formatLogTimeMs, formatMarkdown, getDirectory, getFileExtension, getFilename, getFilenameTruncated, getProxyConfig, getProxyUrl, getTimezoneOffset, getTimezoneParts, git, iife, isSafeFenceBreak, isValidTimezone, joinCommandArgs, lazy, lazyAsync, loadEnv, loadTextFile, loadTextFileAsync, markdownToIR, markdownToIRWithMeta, needsShellExecution, normalizeTimezone, now, nowLocalISO, parseCommand, parseCommandWithOptions, parseFenceSpans, parseFrontmatterBlock, parseLocalISO, parseModelId, proxied, readableStreamToText, renderMarkdown, renderMarkdownWithMarkers, resolveLocaleLang, retry, scanParenAwareBreakpoints, serializeFrontmatter, shell, signal, startServer, truncateMiddle, updateSchema, whichSync, withTimeout, work };
package/dist/index.d.ts CHANGED
@@ -454,11 +454,9 @@ declare class IgnoreInstance {
454
454
  private parseRule;
455
455
  ignores(pathname: string, isDirectory?: boolean): boolean;
456
456
  private checkIgnore;
457
+ private matchPath;
457
458
  filter(pathnames: readonly string[]): string[];
458
459
  createFilter(): (pathname: string) => boolean;
459
- private patternToRegex;
460
- private escapeRegexChar;
461
- private findMatchingBracket;
462
460
  private normalizePath;
463
461
  }
464
462
 
@@ -1256,6 +1254,10 @@ declare namespace Keybind {
1256
1254
  }
1257
1255
 
1258
1256
  declare namespace Locale {
1257
+ const SUPPORTED_LANGS: readonly ["zh-CN", "en-US"];
1258
+ type Lang = (typeof SUPPORTED_LANGS)[number];
1259
+ const DEFAULT_LANG: Lang;
1260
+ function resolveLocaleLang(override?: string, envKey?: string): Lang;
1259
1261
  function titlecase(str: string): string;
1260
1262
  function time(input: number): string;
1261
1263
  function datetime(input: number): string;
@@ -1266,6 +1268,10 @@ declare namespace Locale {
1266
1268
  function truncateMiddle(str: string, maxLength?: number): string;
1267
1269
  function pluralize(count: number, singular: string, plural: string): string;
1268
1270
  }
1271
+ declare const resolveLocaleLang: typeof Locale.resolveLocaleLang;
1272
+ declare const SUPPORTED_LANGS: readonly ["zh-CN", "en-US"];
1273
+ declare const DEFAULT_LANG: "en-US" | "zh-CN";
1274
+ type Lang = Locale.Lang;
1269
1275
 
1270
1276
  declare namespace Lock {
1271
1277
  function read(key: string): Promise<Disposable>;
@@ -1315,11 +1321,11 @@ declare function updateSchema<T extends z.ZodRawShape>(schema: z.ZodObject<T>):
1315
1321
 
1316
1322
  declare namespace Wildcard {
1317
1323
  function match(str: string, pattern: string): boolean;
1318
- function all(input: string, patterns: Record<string, unknown>): unknown;
1319
- function allStructured(input: {
1324
+ function all<T = unknown>(input: string, patterns: Record<string, T>): T | undefined;
1325
+ function allStructured<T = unknown>(input: {
1320
1326
  head: string;
1321
1327
  tail: string[];
1322
- }, patterns: Record<string, unknown>): unknown;
1328
+ }, patterns: Record<string, T>): T | undefined;
1323
1329
  }
1324
1330
 
1325
1331
  declare namespace Log {
@@ -1357,7 +1363,7 @@ declare namespace Log {
1357
1363
  const Default: Logger;
1358
1364
  interface Options {
1359
1365
  print: boolean;
1360
- logDir: string;
1366
+ logDir?: string;
1361
1367
  logFile?: string;
1362
1368
  dev?: boolean;
1363
1369
  level?: Level;
@@ -1368,4 +1374,4 @@ declare namespace Log {
1368
1374
  function create(tags?: Record<string, any>): Logger;
1369
1375
  }
1370
1376
 
1371
- export { $, Archive, AsyncQueue, Binary, type CodeSpanIndex$1 as CodeSpanIndex, Color, Context, type EasServer, Encode, EventLoop, type FenceSpan$1 as FenceSpan, Fetch, type FetchResponse, Filesystem, Fn, type FormatOptions, type GitResult, Glob, Identifier, Ignore, type InlineCodeState$1 as InlineCodeState, Keybind, Lazy, Locale, Lock, Log, MIME_TYPES, 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 ParseCommandResult, type ParsedFrontmatter, type ParsedVersion, PkgShell, type ProxyOptions, type RPCMethod, type RenderLink, type RenderOptions, type RequestOptions, type RouteDefinition, type SSEHandler, Semver, type ServerOptions, SessionTitle, Shell, Slug, type StreamHandler, type StyleMarker, type TimezoneDateParts, Token, TruncateContent, type WebSocketHandler, type WebSocketRouteDefinition, Wildcard, abortAfter, abortAfterAny, addMinutesInTimezone, buildCodeSpanIndex, chunkMarkdownIR, chunkText, chunkTextByBreakResolver, convertMarkdownTables, createInlineCodeState, createPkgShell, createRESTServer, createRPCServer, createServer, createStreamingServer, createWebSocketServer, defer, detectPlatform, escapeCommandArg, escapeCommandArgSafe, extractFrontmatter, findFenceSpanAt, findLast, fn, formatDuration, formatLocalISO, formatLocalISOCompact, formatLogTime, formatLogTimeMs, formatMarkdown, getDirectory, getFileExtension, getFilename, getFilenameTruncated, getProxyConfig, getProxyUrl, getTimezoneOffset, getTimezoneParts, git, iife, isSafeFenceBreak, isValidTimezone, joinCommandArgs, lazy, lazyAsync, loadEnv, loadTextFile, loadTextFileAsync, markdownToIR, markdownToIRWithMeta, needsShellExecution, normalizeTimezone, now, nowLocalISO, parseCommand, parseCommandWithOptions, parseFenceSpans, parseFrontmatterBlock, parseLocalISO, parseModelId, proxied, readableStreamToText, renderMarkdown, renderMarkdownWithMarkers, retry, scanParenAwareBreakpoints, serializeFrontmatter, shell, signal, startServer, truncateMiddle, updateSchema, whichSync, withTimeout, work };
1377
+ export { $, Archive, AsyncQueue, Binary, type CodeSpanIndex$1 as CodeSpanIndex, Color, Context, DEFAULT_LANG, type EasServer, Encode, EventLoop, type FenceSpan$1 as FenceSpan, Fetch, type FetchResponse, Filesystem, Fn, type FormatOptions, type GitResult, Glob, Identifier, Ignore, type InlineCodeState$1 as InlineCodeState, Keybind, type Lang, Lazy, Locale, Lock, Log, MIME_TYPES, 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 ParseCommandResult, type ParsedFrontmatter, type ParsedVersion, PkgShell, type ProxyOptions, type RPCMethod, type RenderLink, type RenderOptions, type RequestOptions, type RouteDefinition, type SSEHandler, SUPPORTED_LANGS, Semver, type ServerOptions, SessionTitle, Shell, Slug, type StreamHandler, type StyleMarker, type TimezoneDateParts, Token, TruncateContent, type WebSocketHandler, type WebSocketRouteDefinition, Wildcard, abortAfter, abortAfterAny, addMinutesInTimezone, buildCodeSpanIndex, chunkMarkdownIR, chunkText, chunkTextByBreakResolver, convertMarkdownTables, createInlineCodeState, createPkgShell, createRESTServer, createRPCServer, createServer, createStreamingServer, createWebSocketServer, defer, detectPlatform, escapeCommandArg, escapeCommandArgSafe, extractFrontmatter, findFenceSpanAt, findLast, fn, formatDuration, formatLocalISO, formatLocalISOCompact, formatLogTime, formatLogTimeMs, formatMarkdown, getDirectory, getFileExtension, getFilename, getFilenameTruncated, getProxyConfig, getProxyUrl, getTimezoneOffset, getTimezoneParts, git, iife, isSafeFenceBreak, isValidTimezone, joinCommandArgs, lazy, lazyAsync, loadEnv, loadTextFile, loadTextFileAsync, markdownToIR, markdownToIRWithMeta, needsShellExecution, normalizeTimezone, now, nowLocalISO, parseCommand, parseCommandWithOptions, parseFenceSpans, parseFrontmatterBlock, parseLocalISO, parseModelId, proxied, readableStreamToText, renderMarkdown, renderMarkdownWithMarkers, resolveLocaleLang, retry, scanParenAwareBreakpoints, serializeFrontmatter, shell, signal, startServer, truncateMiddle, updateSchema, whichSync, withTimeout, work };