@regle/rules 1.10.0 → 1.10.1
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/regle-rules.d.ts +33 -1
- package/package.json +2 -2
package/dist/regle-rules.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { AllRulesDeclarations, CommonAlphaOptions, CommonComparisonOptions, FormRuleDeclaration, InlineRuleDeclaration, Maybe, MaybeInput, MaybeReadonly, NonEmptyTuple, RegleRuleDecl, RegleRuleDefinition, RegleRuleDefinitionWithMetadataProcessor, RegleRuleMetadataConsumer, RegleRuleMetadataDefinition, RegleRuleWithParamsDefinition, UnwrapRegleUniversalParams } from "@regle/core";
|
|
2
2
|
import { ComputedRef, MaybeRef, MaybeRefOrGetter, Ref } from "vue";
|
|
3
|
-
import { EmptyObject } from "type-fest";
|
|
4
3
|
|
|
5
4
|
//#region src/helpers/withMessage.d.ts
|
|
6
5
|
|
|
@@ -135,6 +134,39 @@ declare function getSize(value: MaybeRef<string | any[] | Record<string, any> |
|
|
|
135
134
|
*/
|
|
136
135
|
declare function toNumber<T extends number | string | undefined>(argument: T): number;
|
|
137
136
|
//#endregion
|
|
137
|
+
//#region ../../node_modules/.pnpm/type-fest@5.2.0/node_modules/type-fest/source/empty-object.d.ts
|
|
138
|
+
declare const emptyObjectSymbol: unique symbol;
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
Represents a strictly empty plain object, the `{}` value.
|
|
142
|
+
|
|
143
|
+
When you annotate something as the type `{}`, it can be anything except `null` and `undefined`. This means that you cannot use `{}` to represent an empty plain object ([read more](https://stackoverflow.com/questions/47339869/typescript-empty-object-and-any-difference/52193484#52193484)).
|
|
144
|
+
|
|
145
|
+
@example
|
|
146
|
+
```
|
|
147
|
+
import type {EmptyObject} from 'type-fest';
|
|
148
|
+
|
|
149
|
+
// The following illustrates the problem with `{}`.
|
|
150
|
+
const foo1: {} = {}; // Pass
|
|
151
|
+
const foo2: {} = []; // Pass
|
|
152
|
+
const foo3: {} = 42; // Pass
|
|
153
|
+
const foo4: {} = {a: 1}; // Pass
|
|
154
|
+
|
|
155
|
+
// With `EmptyObject` only the first case is valid.
|
|
156
|
+
const bar1: EmptyObject = {}; // Pass
|
|
157
|
+
const bar2: EmptyObject = 42; // Fail
|
|
158
|
+
const bar3: EmptyObject = []; // Fail
|
|
159
|
+
const bar4: EmptyObject = {a: 1}; // Fail
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
Unfortunately, `Record<string, never>`, `Record<keyof any, never>` and `Record<never, never>` do not work. See {@link https://github.com/sindresorhus/type-fest/issues/395 #395}.
|
|
163
|
+
|
|
164
|
+
@category Object
|
|
165
|
+
*/
|
|
166
|
+
type EmptyObject = {
|
|
167
|
+
[emptyObjectSymbol]?: never;
|
|
168
|
+
};
|
|
169
|
+
//#endregion
|
|
138
170
|
//#region ../shared/utils/isEmpty.d.ts
|
|
139
171
|
/**
|
|
140
172
|
* This is the inverse of isFilled. It will check if the value is in any way empty (including arrays and objects)
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@regle/rules",
|
|
3
|
-
"version": "1.10.
|
|
3
|
+
"version": "1.10.1",
|
|
4
4
|
"description": "Collection of rules and helpers for Regle",
|
|
5
5
|
"dependencies": {
|
|
6
|
-
"@regle/core": "1.10.
|
|
6
|
+
"@regle/core": "1.10.1"
|
|
7
7
|
},
|
|
8
8
|
"devDependencies": {
|
|
9
9
|
"@types/node": "22.19.0",
|