mongoose-slug-plugin
Advanced tools
Comparing version 1.0.1 to 1.0.2
@@ -9,3 +9,3 @@ const { callbackify } = require('util'); | ||
if (s.isBlank(str)) throw new Error('The `str` argument was missing'); | ||
const search = i === 0 ? str : `${str}-${i}`; | ||
const search = i === 0 ? str : config.slug(`${str}-${i}`, config.slugOptions); | ||
const query = { _id: { $ne: _id } }; | ||
@@ -42,3 +42,3 @@ query[config.slugField] = search; | ||
trim: true, | ||
set: config.slug, | ||
set: val => config.slug(val, config.slugOptions), | ||
validate: { | ||
@@ -45,0 +45,0 @@ isAsync: true, |
{ | ||
"name": "mongoose-slug-plugin", | ||
"description": "Slugs for Mongoose with history and i18n support (uses speakingurl by default, but you can use any slug library such as limax, slugify, mollusc, or slugme)", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"author": "Nick Baugh <niftylettuce@gmail.com> (http://niftylettuce.com/)", | ||
@@ -6,0 +6,0 @@ "bugs": { |
251458