toJson.js 549 B

1234567891011
  1. 'use strict';
  2. function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
  3. module.exports = function toJson() {
  4. if (_typeof(this.items) === 'object' && !Array.isArray(this.items)) {
  5. return JSON.stringify(this.all());
  6. }
  7. return JSON.stringify(this.toArray());
  8. };