diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2017-03-02 05:24:20 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2017-03-02 05:24:20 +0900 |
| commit | b3455bf1cb30beb46859345c482e6585845ca388 (patch) | |
| tree | 2446ae980f9ee9fde3489cd5ab2632de908014a5 /src/api/endpoints/posts | |
| parent | fix (diff) | |
| download | sharkey-b3455bf1cb30beb46859345c482e6585845ca388.tar.gz sharkey-b3455bf1cb30beb46859345c482e6585845ca388.tar.bz2 sharkey-b3455bf1cb30beb46859345c482e6585845ca388.zip | |
Extract hasDuplicates function
Diffstat (limited to 'src/api/endpoints/posts')
| -rw-r--r-- | src/api/endpoints/posts/create.js | 5 |
1 files changed, 1 insertions, 4 deletions
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 * |