Extract hasDuplicates function

This commit is contained in:
syuilo 2017-03-02 05:24:20 +09:00
parent 112c18b0e0
commit 615b004a5a
2 changed files with 2 additions and 4 deletions

View file

@ -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
*

View file

@ -0,0 +1 @@
export default (array: any[]) => (new Set(array)).size !== array.length;