MCPcopy
hub / github.com/rollup/rollup / getObject

Function getObject

src/utils/generateCodeSnippets.ts:111–124  ·  view source on GitHub ↗
(fields, { lineBreakIndent })

Source from the content-addressed store, hash-verified

109 getFunctionIntro,
110 getNonArrowFunctionIntro,
111 getObject(fields, { lineBreakIndent }) {
112 const prefix = lineBreakIndent ? `${n}${lineBreakIndent.base}${lineBreakIndent.t}` : _;
113 return `{${fields
114 .map(([key, value]) => {
115 if (key === null) return `${prefix}${value}`;
116 const keyInObject = stringifyObjectKeyIfNeeded(key);
117 return key === value && objectShorthand && key === keyInObject
118 ? prefix + key
119 : `${prefix}${keyInObject}:${_}${value}`;
120 })
121 .join(`,`)}${
122 fields.length === 0 ? '' : lineBreakIndent ? `${n}${lineBreakIndent.base}` : _
123 }}`;
124 },
125 getPropertyAccess: (name: string): string =>
126 isValidPropertyName(name) ? `.${name}` : `[${JSON.stringify(name)}]`,
127 n,

Callers 15

buildEndFunction · 0.85
buildEndFunction · 0.85
manualChunksFunction · 0.85
buildEndFunction · 0.85
renderStartFunction · 0.85
buildEndFunction · 0.85
generateBundleFunction · 0.85
formatAttributesFunction · 0.85
getSystemExportStatementFunction · 0.85
getDefaultLiveBindingFunction · 0.85
getToStringTagValueFunction · 0.85

Calls 1

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…