Skip to content

Commit

Permalink
Removing regex.indent
Browse files Browse the repository at this point in the history
  • Loading branch information
avoidwork committed Jan 9, 2019
1 parent 16d0f73 commit 13fb2a4
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 7 deletions.
1 change: 0 additions & 1 deletion lib/regex.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ module.exports = {
hasParam: /\/:\w*/,
hypermedia: /(([a-z]+(_)?)?id|url|uri)$/i,
id: /^_?id$/i,
indent: /application\/json;\sindent=(\d+)/,
leading: /.*\//,
leftBrace: /\(/,
mimetype: /;.*/,
Expand Down
7 changes: 3 additions & 4 deletions lib/renderers.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,17 @@ const xml = require("tiny-xml"),
yaml = require("yamljs"),
path = require("path"),
csv = require("csv.js"),
regex = require(path.join(__dirname, "regex.js")),
utility = require(path.join(__dirname, "utility.js")),
renderers = new Map();

function indent (req, val) {
let result = val;

if (req.headers.accept !== void 0) {
const header = regex.indent.exec(req.headers.accept);
const header = req.headers.accept.replace(/[^\d+]/g, "");

if (header !== null) {
result = parseInt(header[1], 10);
if (header.length > 0) {
result = parseInt(header, 10);
}
}

Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "tenso",
"description": "Tensō is an HTTP/HTTP2 REST API framework",
"version": "10.0.25",
"version": "10.0.26",
"homepage": "http://avoidwork.github.io/tenso",
"author": "Jason Mulligan <[email protected]>",
"repository": {
Expand Down

0 comments on commit 13fb2a4

Please sign in to comment.