You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
			
				
					21 lines
				
				715 B
			
		
		
			
		
	
	
					21 lines
				
				715 B
			| 
								 
											4 years ago
										 
									 | 
							
								"use strict";
							 | 
						||
| 
								 | 
							
								Object.defineProperty(exports, "__esModule", { value: true });
							 | 
						||
| 
								 | 
							
								exports.arrayToString = void 0;
							 | 
						||
| 
								 | 
							
								/**
							 | 
						||
| 
								 | 
							
								 * Stringify an array of values.
							 | 
						||
| 
								 | 
							
								 */
							 | 
						||
| 
								 | 
							
								const arrayToString = (array, space, next) => {
							 | 
						||
| 
								 | 
							
								    // Map array values to their stringified values with correct indentation.
							 | 
						||
| 
								 | 
							
								    const values = array
							 | 
						||
| 
								 | 
							
								        .map(function (value, index) {
							 | 
						||
| 
								 | 
							
								        const result = next(value, index);
							 | 
						||
| 
								 | 
							
								        if (result === undefined)
							 | 
						||
| 
								 | 
							
								            return String(result);
							 | 
						||
| 
								 | 
							
								        return space + result.split("\n").join(`\n${space}`);
							 | 
						||
| 
								 | 
							
								    })
							 | 
						||
| 
								 | 
							
								        .join(space ? ",\n" : ",");
							 | 
						||
| 
								 | 
							
								    const eol = space && values ? "\n" : "";
							 | 
						||
| 
								 | 
							
								    return `[${eol}${values}${eol}]`;
							 | 
						||
| 
								 | 
							
								};
							 | 
						||
| 
								 | 
							
								exports.arrayToString = arrayToString;
							 | 
						||
| 
								 | 
							
								//# sourceMappingURL=array.js.map
							 |