EdgeAIG/opencode / .opencode /node_modules /yaml /browser /dist /compose /util-contains-newline.js
EdgeAIG's picture
download
raw
1.05 kB
function containsNewline(key) {
if (!key)
return null;
switch (key.type) {
case 'alias':
case 'scalar':
case 'double-quoted-scalar':
case 'single-quoted-scalar':
if (key.source.includes('\n'))
return true;
if (key.end)
for (const st of key.end)
if (st.type === 'newline')
return true;
return false;
case 'flow-collection':
for (const it of key.items) {
for (const st of it.start)
if (st.type === 'newline')
return true;
if (it.sep)
for (const st of it.sep)
if (st.type === 'newline')
return true;
if (containsNewline(it.key) || containsNewline(it.value))
return true;
}
return false;
default:
return true;
}
}
export { containsNewline };

Xet Storage Details

Size:
1.05 kB
·
Xet hash:
3925bc0e00aa3fc3f9d16f5fcc541b0f398a92e585e28663987a4a63b7a82161

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.