UNPKG

gatsby-source-wordpress

Version:

Source data from WordPress in an efficient and scalable way.

25 lines (24 loc) 837 B
"use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); exports.__esModule = true; exports.addRemoteFileAllowedUrl = void 0; var _path = _interopRequireDefault(require("path")); var _store = require("../store"); const addRemoteFileAllowedUrl = ({ actions }) => { if (typeof (actions === null || actions === void 0 ? void 0 : actions.addRemoteFileAllowedUrl) !== `function`) { return; } const { wpUrl } = (0, _store.getStore)().getState().remoteSchema; if (!wpUrl) { return; } const wordpressUrl = new URL(wpUrl); wordpressUrl.pathname = _path.default.posix.join(wordpressUrl.pathname, `*`); actions.addRemoteFileAllowedUrl(wordpressUrl.href); }; exports.addRemoteFileAllowedUrl = addRemoteFileAllowedUrl; //# sourceMappingURL=add-remote-file-allowed-url.js.map