How to use the concordance.formatDescriptor function in concordance

To help you get started, we’ve selected a few concordance examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github otissv / remodule / node_modules / ava / lib / assert.js View on Github external
function formatDescriptorWithLabel(label, descriptor) {
	return {
		label,
		formatted: concordance.formatDescriptor(descriptor, concordanceOptions)
	};
}
github avajs / ava / lib / snapshot-manager.js View on Github external
function formatEntry(label, descriptor) {
	if (label) {
		label = `> ${label}\n\n`;
	}

	const codeBlock = indentString(concordance.formatDescriptor(descriptor, concordanceOptions), 4);
	return Buffer.from(label + codeBlock, 'utf8');
}
github avajs / ava / lib / assert.js View on Github external
function formatDescriptorWithLabel(label, descriptor) {
	return {
		label,
		formatted: concordance.formatDescriptor(descriptor, concordanceOptions)
	};
}
github avajs / ava / lib / serialize-error.js View on Github external
function serializeError(origin, shouldBeautifyStack, err) {
	if (!isError(err)) {
		return {
			avaAssertionError: false,
			nonErrorObject: true,
			formatted: concordance.formatDescriptor(concordance.describe(err, concordanceOptions), concordanceOptions)
		};
	}

	try {
		return trySerializeError(err, shouldBeautifyStack);
	} catch (_) {
		const replacement = new Error(`${origin}: Could not serialize error`);
		return {
			avaAssertionError: false,
			nonErrorObject: false,
			name: replacement.name,
			message: replacement.message,
			stack: replacement.stack,
			summary: replacement.message
		};
	}

concordance

Compare, format, diff and serialize any JavaScript value

ISC
Latest version published 3 years ago

Package Health Score

65 / 100
Full package analysis