MCPcopy Create free account
hub / github.com/pgadmin-org/pgadmin4 / sprintf

Function sprintf

web/pgadmin/static/js/utils.js:264–284  ·  view source on GitHub ↗
(i_str)

Source from the content-addressed store, hash-verified

262}
263
264export function sprintf(i_str) {
265 try {
266 let replaceArgs = arguments;
267 return i_str.split('%s')
268 .map(function(w, i) {
269 if(i > 0) {
270 if(i < replaceArgs.length) {
271 return [replaceArgs[i], w].join('');
272 } else {
273 return ['%s', w].join('');
274 }
275 } else {
276 return w;
277 }
278 })
279 .join('');
280 } catch(e) {
281 console.error(e);
282 return i_str;
283 }
284}
285
286// This will parse a delimited string into an array of arrays.
287export function CSVToArray(strData, strDelimiter, quoteChar){

Callers 7

generate_urlMethod · 0.90
minMaxValidatorFunction · 0.90
numberValidatorFunction · 0.90
integerValidatorFunction · 0.90
emptyValidatorFunction · 0.90
getURLFunction · 0.90

Calls 2

joinMethod · 0.80
errorMethod · 0.80

Tested by

no test coverage detected