string.js — svelte Source File
Architecture documentation for string.js, a javascript file in the svelte codebase. 0 imports, 2 dependents.
Entity Profile
Dependency Diagram
graph LR a9449a4a_d1d3_453e_353c_d48e9e730654["string.js"] 206889ff_1f9f_b6c1_d530_059d001e1cf4["element.js"] 206889ff_1f9f_b6c1_d530_059d001e1cf4 --> a9449a4a_d1d3_453e_353c_d48e9e730654 b389a21f_6de7_2a41_34f3_8efbf9045c9c["index.js"] b389a21f_6de7_2a41_34f3_8efbf9045c9c --> a9449a4a_d1d3_453e_353c_d48e9e730654 style a9449a4a_d1d3_453e_353c_d48e9e730654 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
/**
* @param {string[]} strings
* @param {string} conjunction
*/
export function list(strings, conjunction = 'or') {
if (strings.length === 1) return strings[0];
if (strings.length === 2) return `${strings[0]} ${conjunction} ${strings[1]}`;
return `${strings.slice(0, -1).join(', ')} ${conjunction} ${strings[strings.length - 1]}`;
}
Domain
Subdomains
Functions
Imported By
Source
Frequently Asked Questions
What does string.js do?
string.js is a source file in the svelte codebase, written in javascript. It belongs to the Compiler domain, Transformer subdomain.
What functions are defined in string.js?
string.js defines 1 function(s): list.
What files import string.js?
string.js is imported by 2 file(s): element.js, index.js.
Where is string.js in the architecture?
string.js is located at packages/svelte/src/compiler/utils/string.js (domain: Compiler, subdomain: Transformer, directory: packages/svelte/src/compiler/utils).
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free