Sha256: a19fe69628fd1e9f4c82eb36a541de19e595702b2fd1186b10d6b61c63da1414

Contents?: true

Size: 367 Bytes

Versions: 4

Compression:

Stored size: 367 Bytes

Contents

'use strict';
module.exports = function (str) {
	return str.replace(/(?:\\*)?'([^'\\]*\\.)*[^']*'/g, function (match) {
		return match
			// unescape single-quotes
			.replace(/\\'/g, '\'')
			// escape escapes
			.replace(/(^|[^\\])(\\+)"/g, '$1$2\\\"')
			// escape double-quotes
			.replace(/([^\\])"/g, '$1\\\"')
			// convert
			.replace(/^'|'$/g, '"');
	});
};

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
xcodebuild-helper-1.2.5 externals/ios-sim-master/node_modules/to-double-quotes/index.js
xcodebuild-helper-1.2.3 externals/ios-sim-master/node_modules/to-double-quotes/index.js
eslint_node_modules-1.6.0.1 vendor/node_modules/eslint/node_modules/to-double-quotes/index.js
eslint_node_modules-1.6.0 vendor/node_modules/eslint/node_modules/to-double-quotes/index.js