@wmfs/j2119
Advanced tools
Comparing version 1.6.3 to 1.6.4
@@ -57,2 +57,8 @@ const XRegExp = require('xregexp') | ||
buildEachOfs (line) { | ||
const eachesLine = XRegExp.exec(line, this.eachOfMatch) | ||
const eaches = oxford.breakRoleList(this, eachesLine['each_of']) | ||
return eaches.map(e => `A ${e} ${eachesLine['trailer']}`) | ||
} // buildEachOfs | ||
isRoleDefLine (line) { | ||
@@ -70,2 +76,6 @@ return line.match(this.roledefLine) | ||
isEachOfLine (line) { | ||
return line.match(this.eachOfStart) | ||
} // isEachOfLine | ||
/// /////////////// | ||
@@ -145,3 +155,4 @@ build (re, line) { | ||
const eoMatch = '^Each\\s+of\\s' + | ||
const eoStart = '^Each\\s+of\\s' | ||
this.eoMatch = eoStart + | ||
oxford.re(this.roleMatcher, { | ||
@@ -154,3 +165,4 @@ capture_name: 'each_of', | ||
this.eachOfMatch = XRegExp(eoMatch) | ||
this.eachOfStart = XRegExp(eoStart) | ||
this.eachOfMatch = XRegExp(this.eoMatch) | ||
} // reconstruct | ||
@@ -157,0 +169,0 @@ |
const roleConstraints = require('./role_constraints') | ||
const roleFinder = require('./role_finder') | ||
const allowedFields = require('./allowed_fields') | ||
const oxford = require('./oxford') | ||
const matcher = require('./line_matcher') | ||
const assigner = require('./assigner') | ||
const XRegExp = require('xregexp') | ||
const readlines = require('./readlines') | ||
@@ -92,6 +90,4 @@ | ||
this.assigner.assignOnlyOneOf(this.matcher.buildOnlyOne(line)) | ||
} else if (/^Each of a/.test(line)) { | ||
const eachesLine = XRegExp.exec(line, this.matcher.eachOfMatch) | ||
const eaches = oxford.breakRoleList(this.matcher, eachesLine['each_of']) | ||
eaches.forEach(each => this.procLine(`A ${each} ${eachesLine['trailer']}`)) | ||
} else if (this.matcher.isEachOfLine(line)) { | ||
this.procLines(this.matcher.buildEachOfs(line)) | ||
} else if (this.matcher.isRoleDefLine(line)) { | ||
@@ -107,2 +103,6 @@ this.assigner.assignRoles(this.matcher.buildRoleDef(line)) | ||
procLines (lines) { | ||
lines.forEach(l => this.procLine(l)) | ||
} // procLines | ||
error (message) { | ||
@@ -109,0 +109,0 @@ this.errors.push(message) |
@@ -7,3 +7,3 @@ const LineReader = require('n-readlines') | ||
while ((line = reader.next())) { | ||
yield line.toString('utf-8') | ||
yield line.toString('utf-8').trim() | ||
} | ||
@@ -10,0 +10,0 @@ } // readlines |
{ | ||
"name": "@wmfs/j2119", | ||
"version": "1.6.3", | ||
"version": "1.6.4", | ||
"description": "A general-purpose validator generator that uses RFC2119-style assertions as input.", | ||
@@ -21,3 +21,3 @@ "author": "West Midlands Fire Service", | ||
"dependencies": { | ||
"luxon": "1.4.3", | ||
"luxon": "1.6.2", | ||
"n-readlines": "1.0.0", | ||
@@ -27,4 +27,4 @@ "xregexp": "4.2.0" | ||
"devDependencies": { | ||
"@semantic-release/changelog": "3.0.0", | ||
"@semantic-release/git": "7.0.4", | ||
"@semantic-release/changelog": "3.0.1", | ||
"@semantic-release/git": "7.0.5", | ||
"chai": "4.2.0", | ||
@@ -36,4 +36,4 @@ "codecov": "3.1.0", | ||
"mocha": "5.2.0", | ||
"nyc": "13.0.1", | ||
"semantic-release": "15.9.17", | ||
"nyc": "13.1.0", | ||
"semantic-release": "15.10.8", | ||
"standard": "12.0.1" | ||
@@ -40,0 +40,0 @@ }, |
Sorry, the diff of this file is not supported yet
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
139456
42
2908
+ Addedluxon@1.6.2(transitive)
- Removedluxon@1.4.3(transitive)
Updatedluxon@1.6.2