docworks-model
Advanced tools
Comparing version 1.6.4 to 1.8.4
{ | ||
"name": "docworks-model", | ||
"version": "1.6.4", | ||
"version": "1.8.4", | ||
"description": "The model objects for docworks json files", | ||
"main": "dist/index.js", | ||
"main": "src/index.js", | ||
"scripts": { | ||
"build": "babel src --out-dir dist", | ||
"prepublish": "babel src --out-dir dist", | ||
"lint": "eslint src", | ||
"build": "npm run lint", | ||
"prepublish": "#", | ||
"test": "echo \"Error: no test specified\"" | ||
@@ -14,7 +15,5 @@ }, | ||
"devDependencies": { | ||
"babel-cli": "^6.26.0", | ||
"babel-preset-es2015": "^6.24.1", | ||
"babel-preset-stage-1": "^6.24.1", | ||
"babel-register": "^6.24.1" | ||
} | ||
"eslint": "^6.0.1" | ||
}, | ||
"gitHead": "af20090fc0d9b22e9b504b26e3b2f025ddb05af9" | ||
} |
export function Service(name, memberOf, mixes, labels, properties, operations, callbacks, messages, location, docs, extra) { | ||
function Service(name, memberOf, mixes, labels, properties, operations, callbacks, messages, location, docs, extra) { | ||
return { | ||
@@ -19,6 +19,6 @@ name: name, | ||
export const Void = 'void'; | ||
export const Any = '*'; | ||
const Void = 'void' | ||
const Any = '*' | ||
export function Docs(summary, description, links, examples, extra) { | ||
function Docs(summary, description, links, examples, extra) { | ||
return { | ||
@@ -33,3 +33,3 @@ summary: summary, | ||
export function Example(title, body, extra) { | ||
function Example(title, body, extra) { | ||
return { | ||
@@ -42,3 +42,3 @@ title: title, | ||
export function Return(type, doc) { | ||
function Return(type, doc) { | ||
return { | ||
@@ -50,3 +50,3 @@ type: type, | ||
export function Operation(name, labels, nameParams, params, ret, locations, docs, extra) { | ||
function Operation(name, labels, nameParams, params, ret, locations, docs, extra) { | ||
return { | ||
@@ -64,3 +64,3 @@ name: name, | ||
export function Param(name, type, doc, optional, defaultValue, spread) { | ||
function Param(name, type, doc, optional, defaultValue, spread) { | ||
return { | ||
@@ -76,3 +76,3 @@ name: name, | ||
export function Property(name, labels, isGet, isSet, type, defaultValue, locations, docs, extra) { | ||
function Property(name, labels, isGet, isSet, type, defaultValue, locations, docs, extra) { | ||
return { | ||
@@ -91,3 +91,3 @@ name: name, | ||
export function Message(name, labels, members, locations, docs, extra) { | ||
function Message(name, labels, members, locations, docs, extra) { | ||
return { | ||
@@ -103,3 +103,3 @@ name: name, | ||
export function MessageMember(name, type, doc, optional) { | ||
function MessageMember(name, type, doc, optional) { | ||
return { | ||
@@ -113,18 +113,18 @@ name: name, | ||
export function AtomicType(name) { | ||
return name; | ||
function AtomicType(name) { | ||
return name | ||
} | ||
export function UnionType(names) { | ||
return names; | ||
function UnionType(names) { | ||
return names | ||
} | ||
export function GeneticType(name, typeParams) { | ||
function GeneticType(name, typeParams) { | ||
return { | ||
name: name, | ||
typeParams: typeParams | ||
}; | ||
} | ||
} | ||
export function Location(filename, lineno) { | ||
function Location(filename, lineno) { | ||
return { | ||
@@ -136,18 +136,18 @@ filename: filename, | ||
export function JsDocError(message, locations) { | ||
function JsDocError(message, locations) { | ||
const groupByFile = (groups, location) => { | ||
if (groups[location.filename]) | ||
groups[location.filename].push(location); | ||
groups[location.filename].push(location) | ||
else | ||
groups[location.filename] = [location]; | ||
return groups; | ||
}; | ||
groups[location.filename] = [location] | ||
return groups | ||
} | ||
let files = locations.reduce(groupByFile, {}); | ||
let files = locations.reduce(groupByFile, {}) | ||
let fileLocations = Object.keys(files) | ||
.map((group) => { | ||
let linenos = files[group].map(location => location.lineno); | ||
return `${group} (${linenos.join(", ")})`; | ||
let linenos = files[group].map(location => location.lineno) | ||
return `${group} (${linenos.join(', ')})` | ||
}) | ||
.join(", "); | ||
.join(', ') | ||
return { | ||
@@ -157,2 +157,21 @@ message: message, | ||
} | ||
} | ||
} | ||
module.exports = { | ||
Void, | ||
Any, | ||
AtomicType, | ||
Docs, | ||
Example, | ||
GeneticType, | ||
JsDocError, | ||
Location, | ||
Message, | ||
MessageMember, | ||
Operation, | ||
Param, | ||
Property, | ||
Return, | ||
Service, | ||
UnionType | ||
} |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
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
1
3826
3
168
2