Sha256: 1eb4ca6cbf8b1237e4fb71f4c482e96bb3d981639b521afa83fd6e5d17bc2331

Contents?: true

Size: 450 Bytes

Versions: 3

Compression:

Stored size: 450 Bytes

Contents

"use strict";
const path = require("path");

const looksLikeAbsolutePath = (maybeAbsolutePath) => {
	return /^(?:[a-z]:\\|\/)/i.test(maybeAbsolutePath);
};

const normalizePathSeparator = (p) => p.replace(/\\/g, "/");

exports.makePathsRelative = (context, identifier) => {
	return identifier
		.split(/([|! ])/)
		.map(str => looksLikeAbsolutePath(str) ?
			normalizePathSeparator(path.relative(context, str)) : str)
		.join("");
};

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
ilog-0.4.1 node_modules/webpack/lib/util/identifier.js
ilog-0.4.0 node_modules/webpack/lib/util/identifier.js
ilog-0.3.3 node_modules/webpack/lib/util/identifier.js