Skip to content

Commit 5d446af

Browse files
committed
fix(core): allow '|' character in handle name
1 parent 0ead9c0 commit 5d446af

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
export const isValidHandle = (handle: string) => {
2-
const pattern = /^[\w,.\-]*@{0,1}[\w,.\-]+$/;
2+
const pattern = /^[\w,.|\-]*@{0,1}[\w,.|\-]+$/;
33
return pattern.test(handle);
44
};

packages/core/test/Asset/util/isValidHandle.test.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ const validHandles = [
1111
'handle_name',
1212
'handle_name',
1313
'@alice',
14-
'test-@handle'
14+
'test-@handle',
15+
'0|0',
16+
'0|0@0|0'
1517
];
1618

1719
const invalidHandles = [

0 commit comments

Comments
 (0)