UNPKG

test-openapi

Version:
33 lines (26 loc) 715 B
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.getWordsList=void 0;var _underscore=require("underscore.string"); const getWordsList=function( words, {op="or",quotes=false,json=false}={}) { if(words.length===0){ return""; } const wordsA=jsonStringify(words,{json}); const wordsB=quoteWords(wordsA,{quotes}); const wordsC=(0,_underscore.toSentence)(wordsB,", ",` ${op} `); return wordsC; };exports.getWordsList=getWordsList; const jsonStringify=function(words,{json}){ if(!json){ return words; } return words.map(JSON.stringify); }; const quoteWords=function(words,{quotes}){ if(!quotes){ return words; } return words.map(word=>`'${word}'`); }; //# sourceMappingURL=string.js.map