How to use the regenerator-runtime/runtime.mark function in regenerator-runtime

To help you get started, we’ve selected a few regenerator-runtime examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github cameronwp / hurtling-through-space / plugins / gatsby-remark-images-full-width / index.js View on Github external
var generateImagesAndUpdateNode = function () {
    var _ref2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(node, resolve) {
      var defaults, options, parentNode, imagePath, imageNode, fwToken, isFullWidth, nlToken, isNoLink, responsiveSizesResult, ratio, originalImg, fallbackSrc, srcSet, presentationWidth, srcSplit, fileName, fileNameNoExt, defaultAlt, rawHTML;
      return regeneratorRuntime.wrap(function _callee$(_context) {
        while (1) {
          switch (_context.prev = _context.next) {
            case 0:
              defaults = {
                maxWidth: 650,
                wrapperStyle: '',
                backgroundColor: 'white',
                linkImagesToOriginal: true,
                pathPrefix: pathPrefix
              };
              options = _.assign({}, pluginOptions, defaults);

              // Check if this markdownNode has a File parent. This plugin
              // won't work if the image isn't hosted locally.
github cameronwp / hurtling-through-space / plugins / gatsby-remark-images-full-width / index.js View on Github external
return new Promise(function () {
      var _ref3 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(resolve, reject) {
        var fileType, rawHTML;
        return regeneratorRuntime.wrap(function _callee2$(_context2) {
          while (1) {
            switch (_context2.prev = _context2.next) {
              case 0:
                fileType = node.url.slice(-3);

                // Ignore gifs as we can't process them,
                // svgs as they are already responsive by definition

                if (!(isRelativeUrl(node.url) && fileType !== 'gif' && fileType !== 'svg')) {
                  _context2.next = 10;
                  break;
                }

                _context2.next = 4;
github cameronwp / hurtling-through-space / plugins / gatsby-remark-images-full-width / index.js View on Github external
return new Promise(function () {
          var _ref4 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee3(resolve, reject) {
            var $, imageRefs, _iteratorNormalCompletion, _didIteratorError, _iteratorError, _iterator, _step, thisImg, formattedImgTag, fileType, rawHTML;

            return regeneratorRuntime.wrap(function _callee3$(_context3) {
              while (1) {
                switch (_context3.prev = _context3.next) {
                  case 0:
                    if (node.value) {
                      _context3.next = 2;
                      break;
                    }

                    return _context3.abrupt('return', resolve());

                  case 2:
                    $ = cheerio.load(node.value);

regenerator-runtime

Runtime for Regenerator-compiled generator and async functions.

MIT
Latest version published 4 months ago

Package Health Score

76 / 100
Full package analysis