getAssetDestPathIOS.js 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. exports.default = void 0;
  6. function _path() {
  7. const data = _interopRequireDefault(require("path"));
  8. _path = function () {
  9. return data;
  10. };
  11. return data;
  12. }
  13. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  14. /**
  15. * Copyright (c) Facebook, Inc. and its affiliates.
  16. *
  17. * This source code is licensed under the MIT license found in the
  18. * LICENSE file in the root directory of this source tree.
  19. *
  20. */
  21. function getAssetDestPathIOS(asset, scale) {
  22. const suffix = scale === 1 ? '' : `@${scale}x`;
  23. const fileName = `${asset.name + suffix}.${asset.type}`;
  24. return _path().default.join( // Assets can have relative paths outside of the project root.
  25. // Replace `../` with `_` to make sure they don't end up outside of
  26. // the expected assets directory.
  27. asset.httpServerLocation.substr(1).replace(/\.\.\//g, '_'), fileName);
  28. }
  29. var _default = getAssetDestPathIOS;
  30. exports.default = _default;
  31. //# sourceMappingURL=getAssetDestPathIOS.js.map