@stacksjs/utils 0.58.73 → 0.59.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/base.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ export { toString } from '@stacksjs/strings';
2
+ export declare function loop(times: number, callback: any): Promise<void>;
@@ -0,0 +1 @@
1
+ export declare function cleanProject(): Promise<void>;
@@ -0,0 +1 @@
1
+ export { defineApp, defineCache, defineCli, defineCdn, defineCronJob, defineJob, defineDependencies, defineDatabase, defineDns, defineEmailConfig, defineGit, defineHashing, defineLibrary, defineNotification, defineSms, defineEmail, defineChat, definePayment, defineQueue, defineSearchEngine, defineServices, defineStorage, defineUi, } from '@stacksjs/config';
@@ -0,0 +1,3 @@
1
+ export { add, allocate, compare, convert, equal, greaterThan, greaterThanOrEqual, hasSubUnits, isZero, lessThan, lessThanOrEqual, maximum, minimum, multiply, normalizeScale, dinero, dinero as money, subtract, toSnapshot, toUnits, toDecimal, trimScale, haveSameCurrency, haveSameAmount, dinero as currency, } from 'dinero.js';
2
+ export { USD } from '@dinero.js/currencies';
3
+ export type { Dinero, Currency } from 'dinero.js';
@@ -0,0 +1 @@
1
+ export { debounce } from 'perfect-debounce';
@@ -0,0 +1 @@
1
+ export declare function isDeepEqual(value1: any, value2: any): boolean;
@@ -0,0 +1 @@
1
+ export { getExportsSize } from 'export-size';
package/dist/find.d.ts ADDED
@@ -0,0 +1,5 @@
1
+ interface FindStacksProjectsOptions {
2
+ quiet?: boolean;
3
+ }
4
+ export declare function findStacksProjects(dir?: string, options?: FindStacksProjectsOptions): Promise<string[]>;
5
+ export {};
@@ -0,0 +1,18 @@
1
+ import type { Fn, Nullable } from '@stacksjs/types';
2
+ /**
3
+ * Call every function in an array
4
+ */
5
+ export declare function batchInvoke(functions: Nullable<Fn>[]): void;
6
+ /**
7
+ * Pass the value through the callback, and return the value
8
+ *
9
+ * @example
10
+ * ```
11
+ * function createUser(name: string): User {
12
+ * return tap(new User, user => {
13
+ * user.name = name
14
+ * })
15
+ * }
16
+ * ```
17
+ */
18
+ export declare function tap<T>(value: T, callback: (value: T) => void): T;
package/dist/git.d.ts ADDED
@@ -0,0 +1 @@
1
+ export declare function isGitClean(): boolean;
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Type guard to filter out null-ish values
3
+ *
4
+ * @category Guards
5
+ * @example array.filter(notNullish)
6
+ */
7
+ export declare function notNullish<T>(v: T | null | undefined): v is NonNullable<T>;
8
+ /**
9
+ * Type guard to filter out null values
10
+ *
11
+ * @category Guards
12
+ * @example array.filter(noNull)
13
+ */
14
+ export declare function noNull<T>(v: T | null): v is Exclude<T, null>;
15
+ /**
16
+ * Type guard to filter out null-ish values
17
+ *
18
+ * @category Guards
19
+ * @example array.filter(notUndefined)
20
+ */
21
+ export declare function notUndefined<T>(v: T): v is Exclude<T, undefined>;
22
+ /**
23
+ * Type guard to filter out falsy values
24
+ *
25
+ * @category Guards
26
+ * @example array.filter(isTruthy)
27
+ */
28
+ export declare function isTruthy<T>(v: T): v is NonNullable<T>;
package/dist/hash.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ export declare function originRequestFunctionHash(): string | undefined;
2
+ export declare const websiteSourceHash: string;
@@ -0,0 +1,52 @@
1
+ /// <reference types="bun-types" />
2
+ /// <reference types="node" />
3
+ import type { AddressInfo } from 'node:net';
4
+ import type { Result } from '@stacksjs/error-handling';
5
+ import type { CliOptions, Manifest, SyncSubprocess } from '@stacksjs/types';
6
+ import type { NpmScript } from '@stacksjs/enums';
7
+ export declare function packageManager(): Promise<string>;
8
+ export declare function initProject(): Promise<Result<SyncSubprocess, Error>>;
9
+ export declare function ensureProjectIsInitialized(): Promise<boolean>;
10
+ export declare function installIfVersionMismatch(): Promise<void>;
11
+ export declare function frameworkVersion(): Promise<string>;
12
+ export declare function isAppKeySet(): Promise<boolean>;
13
+ /**
14
+ * Determines the utilized reset preset.
15
+ *
16
+ * @url https://www.npmjs.com/package/@unocss/reset
17
+ * @param preset
18
+ */
19
+ export declare function determineResetPreset(preset?: string): string[];
20
+ /**
21
+ * Determines whether the specified value is a package manifest.
22
+ */
23
+ export declare function isManifest(obj: any): obj is Manifest;
24
+ /**
25
+ * Determines whether the specified value is a string, null, or undefined.
26
+ */
27
+ export declare function isOptionalString(value: any): value is string | undefined;
28
+ export declare function setEnvValue(key: string, value: string): Promise<void>;
29
+ /**
30
+ * Runs the specified NPM script in the package.json file.
31
+ */
32
+ export declare function runNpmScript(script: NpmScript, options?: CliOptions): Promise<Result<SyncSubprocess, Error>>;
33
+ /**
34
+ * Determines whether the specified NPM script exists in the given manifest.
35
+ */
36
+ export declare function hasScript(manifest: Manifest, script: NpmScript): boolean;
37
+ export declare function parseYaml(content: any): any;
38
+ /**
39
+ * Determines the level of debugging.
40
+ *
41
+ * The debug level is determined by the following:
42
+ * 1. The --verbose flag
43
+ * 2. The debug property in the app configuration
44
+ *
45
+ * Currently, we don't support a custom debug level,
46
+ * though, we would like to in the future.
47
+ *
48
+ * @param options
49
+ */
50
+ export declare function determineDebugLevel(options?: CliOptions): boolean;
51
+ export declare function isIpv6(address: AddressInfo): boolean;
52
+ export { dump as dumpYaml, load as loadYaml } from 'js-yaml';
@@ -0,0 +1,23 @@
1
+ export * from './base';
2
+ export * from './clean';
3
+ export * from './config';
4
+ export * from './currency';
5
+ export * from './debounce';
6
+ export * from './equal';
7
+ export * from './export-size';
8
+ export * from './find';
9
+ export * from './function';
10
+ export * from './git';
11
+ export * from './guards';
12
+ export * from './hash';
13
+ export * from './helpers';
14
+ export * from './macroable';
15
+ export * from './math';
16
+ export * from './p';
17
+ export * from './promise';
18
+ export * from './regex';
19
+ export * from './retry';
20
+ export * from './sleep';
21
+ export * from './throttle';
22
+ export * from './vendors';
23
+ export * from './versions';