How to use the toSentence function from underscore.string
Find comprehensive JavaScript underscore.string.toSentence code examples handpicked from public code repositorys.
GitHub: MadsHolten/opm-qg
41 42 43 44 45 46 47 48 49 50
var mappings = require('./config.json').reliabilityMappings; // Derived can not be set as it is only inferred for derived properties var options = _.filter(mappings, function (obj) { return (obj.key != 'derived'); }); // Return error if if (!_.chain(options).filter(function (obj) { return (obj.key == reliability); }).first().value()) { var err = "Unknown restriction. Use either " + _s.toSentence(_.map(options, function (o) { return o.key; }), ', ', ' or '); return new Error(err); } // Map and return class return _.chain(options).filter(function (obj) { return (obj.key == reliability); }).map(function (obj) { return obj["class"]; }).first().value();
1
1
2
+ 14 other calls in file
27 28 29 30 31 32 33 34 35 36
var args = { typeURI: typeURI }; args.queryType = (accept == 'application/json') ? 'select' : 'construct'; if (restriction) { var options = this.restrictions; if (options.indexOf(restriction) == -1) { this.errorHandler("Error: Unknown restriction. Use either " + _s.toSentence(options, ', ', ' or '), 400); } ; args.restriction = restriction; }
0
1
0
+ 2 other calls in file
underscore.string.slugify is the most popular function in underscore.string (323 examples)