Browse Source

Replace depricated Lodash function unique with uniq

See https://github.com/lodash/lodash/wiki/Changelog#jan-12-2016--diff--docs
pull/405/head
Julian Simioni 9 years ago
parent
commit
769f190eab
  1. 2
      helper/labelGenerator.js
  2. 2
      sanitiser/_ids.js
  3. 2
      sanitiser/_targets.js

2
helper/labelGenerator.js

@ -29,7 +29,7 @@ module.exports = function( record ){
} }
// de-dupe outputs // de-dupe outputs
labelParts = _.unique( labelParts ); labelParts = _.uniq( labelParts );
return labelParts.join(', ').trim(); return labelParts.join(', ').trim();
}; };

2
sanitiser/_ids.js

@ -72,7 +72,7 @@ function sanitize( raw, clean ){
var rawIds = raw.ids.split(','); var rawIds = raw.ids.split(',');
// deduplicate // deduplicate
rawIds = _.unique(rawIds); rawIds = _.uniq(rawIds);
// ensure all elements are valid non-empty strings // ensure all elements are valid non-empty strings
if (!rawIds.every(check.nonEmptyString)) { if (!rawIds.every(check.nonEmptyString)) {

2
sanitiser/_targets.js

@ -61,7 +61,7 @@ function sanitize( raw, clean, opts ) {
}, []); }, []);
// dedupe in case aliases expanded to common things or user typed in duplicates // dedupe in case aliases expanded to common things or user typed in duplicates
clean.types[typesKey] = _.unique(clean.types[typesKey]); clean.types[typesKey] = _.uniq(clean.types[typesKey]);
} }
} }

Loading…
Cancel
Save