@graffy/server
Advanced tools
Comparing version 0.8.0 to 0.8.1
@@ -0,3 +1,8 @@ | ||
"use strict"; | ||
exports.__esModule = true; | ||
exports["default"] = getQuery; | ||
var includeRe = /([^,()]*)([(),]|$)/g; | ||
export default function getQuery(include) { | ||
function getQuery(include) { | ||
if (!include) return {}; | ||
@@ -4,0 +9,0 @@ includeRe.lastIndex = 0; |
35
index.js
@@ -1,7 +0,18 @@ | ||
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } | ||
"use strict"; | ||
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; } | ||
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault"); | ||
function _asyncIterator(iterable) { var method; if (typeof Symbol !== "undefined") { if (Symbol.asyncIterator) { method = iterable[Symbol.asyncIterator]; if (method != null) return method.call(iterable); } if (Symbol.iterator) { method = iterable[Symbol.iterator]; if (method != null) return method.call(iterable); } } throw new TypeError("Object is not async iterable"); } | ||
exports.__esModule = true; | ||
exports["default"] = server; | ||
var _regenerator = _interopRequireDefault(require("@babel/runtime-corejs3/regenerator")); | ||
var _stringify = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/json/stringify")); | ||
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/asyncToGenerator")); | ||
var _asyncIterator2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/asyncIterator")); | ||
var _getQuery = _interopRequireDefault(require("./getQuery")); | ||
/* | ||
@@ -11,7 +22,5 @@ This will be used in Node.js without transpilation, | ||
*/ | ||
import getQuery from './getQuery'; | ||
var url = require('url'); | ||
export default function server(store) { | ||
function server(store) { | ||
if (!store) throw new Error('server.store_undef'); | ||
@@ -21,8 +30,8 @@ return ( | ||
function () { | ||
var _ref = _asyncToGenerator( | ||
var _ref = (0, _asyncToGenerator2["default"])( | ||
/*#__PURE__*/ | ||
regeneratorRuntime.mark(function _callee(req, res) { | ||
_regenerator["default"].mark(function _callee(req, res) { | ||
var parsed, query, stream, _iteratorNormalCompletion, _didIteratorError, _iteratorError, _iterator, _step, _value, value, _value2; | ||
return regeneratorRuntime.wrap(function _callee$(_context) { | ||
return _regenerator["default"].wrap(function _callee$(_context) { | ||
while (1) { | ||
@@ -37,3 +46,3 @@ switch (_context.prev = _context.next) { | ||
parsed = url.parse(req.url, true); | ||
query = getQuery(parsed.query.include); | ||
query = (0, _getQuery["default"])(parsed.query.include); | ||
@@ -55,3 +64,3 @@ if (!(req.headers['accept'] === 'text/event-stream')) { | ||
_context.prev = 8; | ||
_iterator = _asyncIterator(stream); | ||
_iterator = (0, _asyncIterator2["default"])(stream); | ||
@@ -86,3 +95,3 @@ case 10: | ||
case 21: | ||
res.write("data: " + JSON.stringify(value) + "\n\n"); | ||
res.write("data: " + (0, _stringify["default"])(value) + "\n\n"); | ||
@@ -145,3 +154,3 @@ case 22: | ||
_value2 = _context.sent; | ||
res.end(JSON.stringify(_value2)); | ||
res.end((0, _stringify["default"])(_value2)); | ||
@@ -148,0 +157,0 @@ case 48: |
@@ -5,3 +5,3 @@ { | ||
"author": "aravind (https://github.com/aravindet)", | ||
"version": "0.8.0", | ||
"version": "0.8.1", | ||
"repository": { | ||
@@ -11,4 +11,3 @@ "type": "git", | ||
}, | ||
"license": "Apache-2.0", | ||
"dependencies": {} | ||
"license": "Apache-2.0" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
159
0
6674