WIP - add extractor, generate snippet_data
This commit is contained in:
12
node_modules/underscore.string/toSentence.js
generated
vendored
Normal file
12
node_modules/underscore.string/toSentence.js
generated
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
var rtrim = require('./rtrim');
|
||||
|
||||
module.exports = function toSentence(array, separator, lastSeparator, serial) {
|
||||
separator = separator || ', ';
|
||||
lastSeparator = lastSeparator || ' and ';
|
||||
var a = array.slice(),
|
||||
lastMember = a.pop();
|
||||
|
||||
if (array.length > 2 && serial) lastSeparator = rtrim(separator) + lastSeparator;
|
||||
|
||||
return a.length ? a.join(separator) + lastSeparator + lastMember : lastMember;
|
||||
};
|
||||
Reference in New Issue
Block a user