MCPcopy Create free account
hub / github.com/bathos/Ecmascript-Sublime / gobble

Function gobble

nested/src/modify-ecmascript.js:69–77  ·  view source on GitHub ↗
(s_text, s_indent='')

Source from the content-addressed store, hash-verified

67 let si_string_interp = 'punctuation.definition.string.interpolated';
68
69 const gobble = (s_text, s_indent='') => {
70 let m_pad = /^(\s+)/.exec(s_text.replace(/^([ \t]*\n)/, ''));
71 if(m_pad) {
72 return s_indent+s_text.replace(new RegExp(`\\n${m_pad[1]}`, 'g'), '\n'+s_indent.trim()).trim();
73 }
74 else {
75 return s_indent+s_text.trim();
76 }
77 };
78
79 const clone = (z_source) => {
80 if(Array.isArray(z_source)) {

Callers 1

yaml_loadFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected