Dashboard sipadu mbip
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

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. };