How to use @babel/runtime - 10 common examples

To help you get started, we’ve selected a few @babel/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 salesforce / lwc / packages / @lwc / compiler / src / __tests__ / fixtures / expected-babel-compat.js View on Github external
function t() {
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [1, 2, 3],
_ref2 = _slicedToArray(_ref, 3),
a = _ref2._ES5ProxyType ? _ref2.get(2) : _ref2[2];
return a;
} // babel-plugin-transform-es2015-shorthand-properties
// https://github.com/babel/babel/blob/master/packages/babel-plugin-transform-es2015-shorthand-properties/test/fixtures/shorthand-properties/method-plain/actual.js
github salesforce / lwc / packages / @lwc / compiler / src / __tests__ / fixtures / expected-babel-compat.js View on Github external
__callKey1(console, "log", _toConsumableArray(foo)); // babel-plugin-transform-es2015-template-literals
// https://github.com/babel/babel/blob/master/packages/babel-plugin-transform-es2015-template-literals/test/fixtures/loose/tag/actual.js
function literal() {
var foo = bar(_templateObject(), 42, __callKey0(_, "foobar"));
var bar = bar(_templateObject2(), 42, __callKey0(_, "foobar"));
var baz = bar(_templateObject3(), 42, __callKey0(_, "baz"));
return [foo, bar, baz];
} // babel-plugin-transform-es2015-typeof-symbol
// https://github.com/babel/babel/blob/master/packages/babel-plugin-transform-es2015-typeof-symbol/test/fixtures/symbols/typeof/actual.js
var s = Symbol("s");
__callKey1(assert, "ok", _typeof(s) === "symbol");
__callKey2(assert, "equal", _typeof(s), "symbol");
__callKey2(assert, "equal", _typeof(_typeof(s._ES5ProxyType ? s.get("foo") : s.foo)), "symbol");
var ts = typeof s === "string";
__callKey1(assert, "isNotOk", (typeof o === "undefined" ? "undefined" : _typeof(o)) === "symbol");
__callKey2(assert, "notEqual", typeof o === "undefined" ? "undefined" : _typeof(o), "symbol");
__callKey2(assert, "notEqual", _typeof(_typeof(o._ES5ProxyType ? o.get("foo") : o.foo)), "symbol"); // babel-plugin-transform-es2015-unicode-regex
// https://github.com/babel/babel/blob/master/packages/babel-plugin-transform-es2015-unicode-regex/test/fixtures/unicode-regex/basic/actual.js
var string = "foo💩bar";
var match = __callKey1(string, "match", /foo((?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]))bar/);
__callKey3(assert, "notEqual", string, match, ts); // babel-plugin-transform-async-to-generator
// https://github.com/babel/babel/blob/master/packages/babel-plugin-transform-async-to-generator/test/fixtures/async-to-generator/async/actual.js
var Foo =
/*#__PURE__*/
function () {
function Foo() {
_classCallCheck(this, Foo);
}
_createClass(Foo, [{
key: "foo",
value: function () {
var _foo = _asyncToGenerator(
github salesforce / lwc / packages / @lwc / compiler / src / __tests__ / fixtures / expected-babel-compat.js View on Github external
// https://github.com/babel/babel/blob/master/packages/babel-plugin-transform-es2015-template-literals/test/fixtures/loose/tag/actual.js
function literal() {
var foo = bar(_templateObject(), 42, __callKey0(_, "foobar"));
var bar = bar(_templateObject2(), 42, __callKey0(_, "foobar"));
var baz = bar(_templateObject3(), 42, __callKey0(_, "baz"));
return [foo, bar, baz];
} // babel-plugin-transform-es2015-typeof-symbol
// https://github.com/babel/babel/blob/master/packages/babel-plugin-transform-es2015-typeof-symbol/test/fixtures/symbols/typeof/actual.js
var s = Symbol("s");
__callKey1(assert, "ok", _typeof(s) === "symbol");
__callKey2(assert, "equal", _typeof(s), "symbol");
__callKey2(assert, "equal", _typeof(_typeof(s._ES5ProxyType ? s.get("foo") : s.foo)), "symbol");
var ts = typeof s === "string";
__callKey1(assert, "isNotOk", (typeof o === "undefined" ? "undefined" : _typeof(o)) === "symbol");
__callKey2(assert, "notEqual", typeof o === "undefined" ? "undefined" : _typeof(o), "symbol");
__callKey2(assert, "notEqual", _typeof(_typeof(o._ES5ProxyType ? o.get("foo") : o.foo)), "symbol"); // babel-plugin-transform-es2015-unicode-regex
// https://github.com/babel/babel/blob/master/packages/babel-plugin-transform-es2015-unicode-regex/test/fixtures/unicode-regex/basic/actual.js
var string = "foo💩bar";
var match = __callKey1(string, "match", /foo((?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]))bar/);
__callKey3(assert, "notEqual", string, match, ts); // babel-plugin-transform-async-to-generator
// https://github.com/babel/babel/blob/master/packages/babel-plugin-transform-async-to-generator/test/fixtures/async-to-generator/async/actual.js
var Foo =
/*#__PURE__*/
function () {
function Foo() {
_classCallCheck(this, Foo);
}
_createClass(Foo, [{
key: "foo",
value: function () {
var _foo = _asyncToGenerator(
/*#__PURE__*/
github salesforce / lwc / packages / @lwc / compiler / src / __tests__ / fixtures / expected-babel-compat.js View on Github external
method: function method() {
return 5 + 5;
}
}; // babel-plugin-transform-es2015-spread
// https://github.com/babel/babel/blob/master/packages/babel-plugin-transform-es2015-spread/test/fixtures/spread/single/actual.js
__callKey1(console, "log", _toConsumableArray(foo)); // babel-plugin-transform-es2015-template-literals
// https://github.com/babel/babel/blob/master/packages/babel-plugin-transform-es2015-template-literals/test/fixtures/loose/tag/actual.js
function literal() {
var foo = bar(_templateObject(), 42, __callKey0(_, "foobar"));
var bar = bar(_templateObject2(), 42, __callKey0(_, "foobar"));
var baz = bar(_templateObject3(), 42, __callKey0(_, "baz"));
return [foo, bar, baz];
} // babel-plugin-transform-es2015-typeof-symbol
// https://github.com/babel/babel/blob/master/packages/babel-plugin-transform-es2015-typeof-symbol/test/fixtures/symbols/typeof/actual.js
var s = Symbol("s");
__callKey1(assert, "ok", _typeof(s) === "symbol");
__callKey2(assert, "equal", _typeof(s), "symbol");
__callKey2(assert, "equal", _typeof(_typeof(s._ES5ProxyType ? s.get("foo") : s.foo)), "symbol");
var ts = typeof s === "string";
__callKey1(assert, "isNotOk", (typeof o === "undefined" ? "undefined" : _typeof(o)) === "symbol");
__callKey2(assert, "notEqual", typeof o === "undefined" ? "undefined" : _typeof(o), "symbol");
__callKey2(assert, "notEqual", _typeof(_typeof(o._ES5ProxyType ? o.get("foo") : o.foo)), "symbol"); // babel-plugin-transform-es2015-unicode-regex
// https://github.com/babel/babel/blob/master/packages/babel-plugin-transform-es2015-unicode-regex/test/fixtures/unicode-regex/basic/actual.js
var string = "foo💩bar";
var match = __callKey1(string, "match", /foo((?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]))bar/);
__callKey3(assert, "notEqual", string, match, ts); // babel-plugin-transform-async-to-generator
// https://github.com/babel/babel/blob/master/packages/babel-plugin-transform-async-to-generator/test/fixtures/async-to-generator/async/actual.js
var Foo =
/*#__PURE__*/
function () {
function Foo() {
_classCallCheck(this, Foo);
github pubkey / rxdb / dist / es / plugins / replication-graphql / index.js View on Github external
waitTillRun.then(function () {
    // trigger run once
    replicationState.run(); // start sync-interval

    if (replicationState.live) {
      if (pull) {
        _asyncToGenerator(
        /*#__PURE__*/
        _regeneratorRuntime.mark(function _callee7() {
          return _regeneratorRuntime.wrap(function _callee7$(_context7) {
            while (1) {
              switch (_context7.prev = _context7.next) {
                case 0:
                  if (replicationState.isStopped()) {
                    _context7.next = 9;
                    break;
                  }

                  _context7.next = 3;
                  return promiseWait(replicationState.liveInterval);

                case 3:
                  if (!replicationState.isStopped()) {
github pubkey / rxdb / dist / es / rx-query.js View on Github external
}

    clonedThis.mquery.sort(params);
    return _tunnelQueryCache(clonedThis);
  };

  _proto.limit = function limit(amount) {
    if (this.op === 'findOne') throw newRxError('QU6');else {
      var clonedThis = this._clone();

      clonedThis.mquery.limit(amount);
      return _tunnelQueryCache(clonedThis);
    }
  };

  _createClass(RxQueryBase, [{
    key: "$",
    get: function get() {
      var _this2 = this;

      if (!this._$) {
        /**
         * We use _resultsDocs$ to emit new results
         * This also ensure that there is a reemit on subscribe
         */
        var results$ = this._resultsDocs$.pipe(mergeMap(function (docs) {
          return _ensureEqual(_this2).then(function (hasChanged) {
            if (hasChanged) return false; // wait for next emit
            else return docs;
          });
        }), filter(function (docs) {
          return !!docs;
github CalvinVon / vue-mount / es / mount.js View on Github external
if (hostVm) {
            // Whether replace host vm
            if (options.mode === 'append') {
              parentVm = hostVm;
            } else {
              var _parent = hostVm.$parent;
              hostVm.$emit('mount:destroy');
              hostVm.$destroy();
              instance.$parent = _parent;
              _parent && (_parent.$children = _toConsumableArray(new Set([].concat(_toConsumableArray(_parent.$children), [instance]))));
            }
          }

          if (parentVm) {
            parentVm.$children = _toConsumableArray(new Set([].concat(_toConsumableArray(parentVm.$children), [instance])));
            instance.$parent = parentVm;
            instance.$root = parentVm.$root;
          }

          if (options.mode === 'append') {
            // Append mount
            instance.$mount();
            options.targetElement.appendChild(instance.$el);
          } else {
            // Replace Mount
            instance.$mount(options.targetElement);
            checkAndRmUnmountedVm(parentVm);
          }
        }

      instance.$el.__mount__ = this; // Emit instance mount event
github CalvinVon / vue-mount / es / mount.js View on Github external
} // Append to vue component instance
      else {
          var hostVm = isVueInstance(options.targetElement),
              parentVm = findParentVm(options.targetElement);
          if (isRootVue(hostVm)) hostVm = hostVm.$children[0];

          if (hostVm) {
            // Whether replace host vm
            if (options.mode === 'append') {
              parentVm = hostVm;
            } else {
              var _parent = hostVm.$parent;
              hostVm.$emit('mount:destroy');
              hostVm.$destroy();
              instance.$parent = _parent;
              _parent && (_parent.$children = _toConsumableArray(new Set([].concat(_toConsumableArray(_parent.$children), [instance]))));
            }
          }

          if (parentVm) {
            parentVm.$children = _toConsumableArray(new Set([].concat(_toConsumableArray(parentVm.$children), [instance])));
            instance.$parent = parentVm;
            instance.$root = parentVm.$root;
          }

          if (options.mode === 'append') {
            // Append mount
            instance.$mount();
            options.targetElement.appendChild(instance.$el);
          } else {
            // Replace Mount
            instance.$mount(options.targetElement);
github pubkey / rxdb / dist / es / plugins / replication-graphql / helper.js View on Github external
function _getDocsWithRevisionsFromPouch() {
  _getDocsWithRevisionsFromPouch = _asyncToGenerator(
  /*#__PURE__*/
  _regeneratorRuntime.mark(function _callee(collection, docIds) {
    var pouch, allDocs, docsSearch, bulkGetDocs, ret;
    return _regeneratorRuntime.wrap(function _callee$(_context) {
      while (1) {
        switch (_context.prev = _context.next) {
          case 0:
            if (!(docIds.length === 0)) {
              _context.next = 2;
              break;
            }

            return _context.abrupt("return", {});

          case 2:
            // optimisation shortcut
github zubairghori / Ultimate_todo_list / react-todo-rest-api / node_modules / @material-ui / core / es / InputBase / InputBase.js View on Github external
[classes.disabled]: fcs.disabled,
      [classes.inputType]: type !== 'text',
      [classes.inputTypeSearch]: type === 'search',
      [classes.inputMultiline]: multiline,
      [classes.inputMarginDense]: fcs.margin === 'dense',
      [classes.inputAdornedStart]: startAdornment,
      [classes.inputAdornedEnd]: endAdornment
    }, inputPropsClassName);
    let InputComponent = inputComponent;

    let inputProps = _objectSpread({}, inputPropsProp, {
      ref: this.handleRefInput
    });

    if (typeof InputComponent !== 'string') {
      inputProps = _objectSpread({
        // Rename ref to inputRef as we don't know the
        // provided `inputComponent` structure.
        inputRef: this.handleRefInput,
        type
      }, inputProps, {
        ref: null
      });
    } else if (multiline) {
      if (rows && !rowsMax) {
        InputComponent = 'textarea';
      } else {
        inputProps = _objectSpread({
          rowsMax,
          textareaRef: this.handleRefInput
        }, inputProps, {
          ref: null