From b3455bf1cb30beb46859345c482e6585845ca388 Mon Sep 17 00:00:00 2001 From: syuilo Date: Thu, 2 Mar 2017 05:24:20 +0900 Subject: Extract hasDuplicates function --- src/api/endpoints/posts/create.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'src/api/endpoints/posts') diff --git a/src/api/endpoints/posts/create.js b/src/api/endpoints/posts/create.js index 151938004d..92aeb3d08e 100644 --- a/src/api/endpoints/posts/create.js +++ b/src/api/endpoints/posts/create.js @@ -4,6 +4,7 @@ * Module dependencies */ import validate from '../../validator'; +import hasDuplicates from '../../../common/has-duplicates'; import parse from '../../../common/text'; import { Post, isValidText } from '../../models/post'; import User from '../../models/user'; @@ -15,10 +16,6 @@ import notify from '../../common/notify'; import event from '../../event'; import config from '../../../conf'; -function hasDuplicates(array) { - return (new Set(array)).size !== array.length; -} - /** * Create a post * -- cgit v1.2.3-freya