Skip to content

Commit 4d1a21e

Browse files
committed
refactor(pinia-orm): Make nanoid async uuid deprecated
1 parent 8023336 commit 4d1a21e

File tree

5 files changed

+1002
-327
lines changed

5 files changed

+1002
-327
lines changed

packages/pinia-orm/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@
7979
"eslint": "^8.49.0",
8080
"happy-dom": "^12.0.1",
8181
"mkdist": "^1.3.0",
82-
"nanoid": "^5.0.1",
82+
"nanoid": "4.0.2",
8383
"pinia": "^2.1.6",
8484
"prettier": "^3.0.3",
8585
"size-limit": "^9.0.0",

packages/pinia-orm/src/packages/nanoid/casts/AsyncCast.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ import type { ModelFields } from '../../../../src/model/Model'
33
import { CastAttribute } from '../../../../src/model/casts/CastAttribute'
44
import type { NanoidOptions } from '../../../../src/model/decorators/Contracts'
55

6+
/**
7+
* Create a cast nanoid/async.
8+
* @deprecated will be removed in v2 because nanoid v5 dropped it
9+
*/
610
export class UidCast extends CastAttribute {
711
static parameters?: NanoidOptions
812

packages/pinia-orm/src/packages/nanoid/decorators/UidAsync.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ import { UidCast } from '../casts/AsyncCast'
33
import type { NanoidOptions } from '../../../../src/model/decorators/Contracts'
44

55
/**
6-
* Create a cast for an attribute property decorator.
6+
* Creates an uuid based on nanoid/async.
7+
* @deprecated will be removed in v2 because nanoid v5 dropped it
78
*/
89
export function Uid (options?: NanoidOptions): PropertyDecorator {
910
return (target, propertyKey) => {

0 commit comments

Comments
 (0)