index.js
function defaultJsExporter(variables, options, root) {
	const pathname = options.destination || root.source && root.source.input && root.source.input.file && root.source.input.file + '.js' || 'custom-variables.js';
	const contents = Object.keys(variables).reduce(
		(buffer, key) => `${ buffer }export const ${ key } = ${ JSON.stringify(variables[key]).replace(/(^|{|,)"(.+?)":/g, '$1$2:') };\n`,
		''
	);

	return new Promise((resolve, reject) => {
		fs.writeFile(
			pathname,
			contents,
			(error) => error ? reject(error) : resolve()
		);
	});
}
function defaultJsExporter(variables, options, root) {
	const pathname = options.destination || root.source && root.source.input && root.source.input.file && root.source.input.file + '.js' || 'custom-variables.js';
	const contents = Object.keys(variables).reduce(
		(buffer, key) => `${ buffer }export const ${ key } = ${ JSON.stringify(variables[key]).replace(/(^|{|,)"(.+?)":/g, '$1$2:') };\n`,
		''
	);

	return new Promise((resolve, reject) => {
		fs.writeFile(
			pathname,
			contents,
			(error) => error ? reject(error) : resolve()
		);
	});
}
function defaultJsExporter ( variables , options , root ) { const pathname = options . destination || root . source && root . source . input && root . source . input . file && root . source . input . file + '.js' || 'custom-variables.js' ; const contents = Object . keys ( variables ) . reduce ( ( buffer , key ) => ` ${ buffer } ${ key } ${ JSON . stringify ( variables [ key ] ) . replace ( / (^|{|,)"(.+?)": / g , '$1$2:' ) } \n ` , '' ) ; return new Promise ( ( resolve , reject ) => { fs . writeFile ( pathname , contents , ( error ) => error ? reject ( error ) : resolve ( ) ) ; } ) ; }
Default export functions
Default export functions