@dfinity/utils 2.1.2-next-2024-03-25 → 2.1.3-next-2024-03-25
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/README.md
CHANGED
|
@@ -247,6 +247,8 @@ Convert seconds to a human-readable duration, such as "6 days, 10 hours."
|
|
|
247
247
|
Parameters:
|
|
248
248
|
|
|
249
249
|
- `options`: - The options object.
|
|
250
|
+
- `options.seconds`: - The number of seconds to convert.
|
|
251
|
+
- `options.i18n`: - The i18n object for customizing language and units. Defaults to English.
|
|
250
252
|
|
|
251
253
|
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/utils/src/utils/date.utils.ts#L43)
|
|
252
254
|
|
|
@@ -356,6 +358,11 @@ Tags after patch version are ignored, e.g. 1.0.0-beta.1 is considered equal to 1
|
|
|
356
358
|
| ---------------- | ----------------------------------------------------------------------------------------------- |
|
|
357
359
|
| `smallerVersion` | `({ minVersion, currentVersion, }: { minVersion: string; currentVersion: string; }) => boolean` |
|
|
358
360
|
|
|
361
|
+
Parameters:
|
|
362
|
+
|
|
363
|
+
- `params.minVersion`: Ex: "1.0.0"
|
|
364
|
+
- `params.currentVersion`: Ex: "2.0.0"
|
|
365
|
+
|
|
359
366
|
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/utils/src/utils/version.utils.ts#L28)
|
|
360
367
|
|
|
361
368
|
### :wrench: Constants
|
|
@@ -4,7 +4,7 @@ import type { Principal } from "@dfinity/principal";
|
|
|
4
4
|
import type { CanisterOptions } from "../types/canister.options";
|
|
5
5
|
type RequiredCanisterOptions<T> = Required<Pick<CanisterOptions<T>, "canisterId">> & Omit<CanisterOptions<T>, "canisterId">;
|
|
6
6
|
export declare const createServices: <T>({ options: { canisterId, serviceOverride, certifiedServiceOverride, agent: agentOption, callTransform, queryTransform, }, idlFactory, certifiedIdlFactory, }: {
|
|
7
|
-
options:
|
|
7
|
+
options: RequiredCanisterOptions<T> & Pick<ActorConfig, "queryTransform" | "callTransform">;
|
|
8
8
|
idlFactory: IDL.InterfaceFactory;
|
|
9
9
|
certifiedIdlFactory: IDL.InterfaceFactory;
|
|
10
10
|
}) => {
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export declare const toNullable: <T>(value?: T | null
|
|
1
|
+
export declare const toNullable: <T>(value?: T | null) => [] | [T];
|
|
2
2
|
export declare const fromNullable: <T>(value: [] | [T]) => T | undefined;
|
|
3
3
|
export declare const fromDefinedNullable: <T>(value: [] | [T]) => T;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/** Is null or undefined */
|
|
2
|
-
export declare const isNullish: <T>(argument: T |
|
|
2
|
+
export declare const isNullish: <T>(argument: T | undefined | null) => argument is null | undefined;
|
|
3
3
|
/** Not null and not undefined */
|
|
4
|
-
export declare const nonNullish: <T>(argument: T |
|
|
4
|
+
export declare const nonNullish: <T>(argument: T | undefined | null) => argument is NonNullable<T>;
|
|
5
5
|
/** Not null and not undefined and not empty */
|
|
6
6
|
export declare const notEmptyString: (value: string | undefined | null) => boolean;
|
package/package.json
CHANGED