source/index.js
function parse_style_json_object(text, options)
{
	// remove multiline comments
	text = text.replace(/\/\*([\s\S]*?)\*\//g, '')

	// ignore curly braces for now.
	// maybe support curly braces along with tabulation in future
	text = text.replace(/[\{\}]/g, '')

	const lines = text.split('\n')

	// helper class for dealing with tabulation
	const tabulator = new Tabulator(Tabulator.determine_tabulation(lines))

	// parse text into JSON object
	let style_json = parse_style_class(tabulator.extract_tabulation(lines), [])

	// expand CSS shorthand properties
	// (e.g. `margin: 1px` -> `margin-left: 1px; ...`)
	if (options.expand)
	{
		style_json = style_builder.build(style_json)
	}

	// expand "modifier" style classes
	// (which can override some of the expanded shorthand CSS properties)
	return expand_modifier_style_classes(style_json)
}
function parse_style_json_object(text, options)
{
	// remove multiline comments
	text = text.replace(/\/\*([\s\S]*?)\*\//g, '')

	// ignore curly braces for now.
	// maybe support curly braces along with tabulation in future
	text = text.replace(/[\{\}]/g, '')

	const lines = text.split('\n')

	// helper class for dealing with tabulation
	const tabulator = new Tabulator(Tabulator.determine_tabulation(lines))

	// parse text into JSON object
	let style_json = parse_style_class(tabulator.extract_tabulation(lines), [])

	// expand CSS shorthand properties
	// (e.g. `margin: 1px` -> `margin-left: 1px; ...`)
	if (options.expand)
	{
		style_json = style_builder.build(style_json)
	}

	// expand "modifier" style classes
	// (which can override some of the expanded shorthand CSS properties)
	return expand_modifier_style_classes(style_json)
}
function parse_style_json_object ( text , options ) { // remove multiline comments text = text . replace ( / \/\*([\s\S]*?)\*\/ / g , '' ) // ignore curly braces for now. // maybe support curly braces along with tabulation in future text = text . replace ( / [\{\}] / g , '' ) const lines = text . split ( '\n' ) // helper class for dealing with tabulation const tabulator = new Tabulator ( Tabulator . determine_tabulation ( lines ) ) // parse text into JSON object let style_json = parse_style_class ( tabulator . extract_tabulation ( lines ) , [ ] ) // expand CSS shorthand properties // (e.g. `margin: 1px` -> `margin-left: 1px; ...`) if ( options . expand ) { style_json = style_builder . build ( style_json ) } // expand "modifier" style classes // (which can override some of the expanded shorthand CSS properties) return expand_modifier_style_classes ( style_json ) }
converts text to JSON object
converts text to JSON object