サロゲートペアを字数にカウントしないようにする (#2661)
* Update post-form.vue * Update messaging-message.ts * Update post-form.vue * Update note.ts * Update post-form.vue refs: https://github.com/syuilo/misskey/pull/2661#issuecomment-419579444 * Update post-form.vue refs: https://github.com/syuilo/misskey/pull/2661#issuecomment-419579444 * Update messaging-message.ts refs: https://github.com/syuilo/misskey/pull/2661#issuecomment-419579444 * Update note.ts refs: https://github.com/syuilo/misskey/pull/2661#issuecomment-419579444 * Update post-form.vue refs: https://github.com/syuilo/misskey/pull/2661#discussion_r216175581 * Update post-form.vue * Update post-form.vue refs: https://github.com/syuilo/misskey/pull/2661#discussion_r216242002 * Update post-form.vue refs: https://github.com/syuilo/misskey/pull/2661#discussion_r216242105
This commit is contained in:
committed by
syuilo
parent
4dc8351f56
commit
b24f368d3f
@ -2,6 +2,7 @@ import * as mongo from 'mongodb';
|
||||
const deepcopy = require('deepcopy');
|
||||
import rap from '@prezzemolo/rap';
|
||||
import db from '../db/mongodb';
|
||||
import { length } from 'stringz';
|
||||
import { IUser, pack as packUser } from './user';
|
||||
import { pack as packApp } from './app';
|
||||
import PollVote, { deletePollVote } from './poll-vote';
|
||||
@ -24,11 +25,11 @@ Note.createIndex({
|
||||
export default Note;
|
||||
|
||||
export function isValidText(text: string): boolean {
|
||||
return text.length <= 1000 && text.trim() != '';
|
||||
return length(text.trim()) <= 1000 && text.trim() != '';
|
||||
}
|
||||
|
||||
export function isValidCw(text: string): boolean {
|
||||
return text.length <= 100;
|
||||
return length(text.trim()) <= 100;
|
||||
}
|
||||
|
||||
export type INote = {
|
||||
|
Reference in New Issue
Block a user