Dashboard sipadu mbip
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

sources-absolute-to-relative.js 545B

1234567891011121314151617181920
  1. /*
  2. * MIT License http://opensource.org/licenses/MIT
  3. * Author: Ben Holloway @bholloway
  4. */
  5. 'use strict';
  6. var path = require('path');
  7. /**
  8. * Convert the given array of absolute URIs to relative URIs (in place).
  9. * @param {Array} sources The source map sources array
  10. * @param {string} basePath The base path to make relative to
  11. */
  12. module.exports = function sourcesAbsoluteToRelative(sources, basePath) {
  13. sources.forEach(sourceToRelative);
  14. function sourceToRelative(value, i, array) {
  15. array[i] = path.relative(basePath, value);
  16. }
  17. };