Comparing version 4.2.1 to 5.0.0
# Changelog | ||
## v5.0.0 | ||
- FIX: **Breaking changes**: Incorrect work of dictionary words in substrings #106. | ||
- FIX: Comments in JSON #108. | ||
## v4.2.1 | ||
@@ -4,0 +8,0 @@ FIX: TypeError: Cannot destructure property config of 'undefined' or 'null' #103. |
@@ -9,3 +9,14 @@ 'use strict'; | ||
const knownProps = require('./config-properties'); | ||
const stripJsonComments = require('strip-json-comments'); | ||
const parseJson = require('parse-json'); | ||
function loadJson(filepath, content) { | ||
try { | ||
return parseJson(stripJsonComments(content)); | ||
} catch (err) { | ||
err.message = `JSON Error in ${filepath}:\n${err.message}`; | ||
throw err; | ||
} | ||
} | ||
module.exports = { | ||
@@ -20,2 +31,6 @@ /** | ||
const explorer = cosmiconfig('yaspeller', { | ||
loaders: { | ||
'.json': loadJson, | ||
noExt: loadJson | ||
}, | ||
searchPlaces: [ | ||
@@ -22,0 +37,0 @@ 'package.json', |
@@ -171,3 +171,11 @@ 'use strict'; | ||
const preparedWord = word.replace(rePrepare, ($, $1, $2) => '[' + $1 + $1.toUpperCase() + ']' + $2); | ||
let preparedWord = word.replace(rePrepare, ($, $1, $2) => '[' + $1 + $1.toUpperCase() + ']' + $2); | ||
if (preparedWord.search(/\^/) !== 0) { | ||
preparedWord = '^' + preparedWord; | ||
} | ||
if (preparedWord.search(/\$/) !== preparedWord.length - 1) { | ||
preparedWord += '$'; | ||
} | ||
@@ -174,0 +182,0 @@ try { |
@@ -13,3 +13,3 @@ { | ||
"description": "Search tool typos in the text, files and websites", | ||
"version": "4.2.1", | ||
"version": "5.0.0", | ||
"license": "MIT", | ||
@@ -38,3 +38,3 @@ "homepage": "https://github.com/hcodes/yaspeller", | ||
"chalk": "^2.4.1", | ||
"commander": "^2.15.1", | ||
"commander": "^2.17.1", | ||
"cosmiconfig": "^5.0.5", | ||
@@ -55,6 +55,7 @@ "entities": "^1.1.1", | ||
"chai": "^4.1.0", | ||
"eslint": "^5.0.0", | ||
"eslint": "^5.3.0", | ||
"istanbul": "^0.4.5", | ||
"mocha": "^5.2.0", | ||
"sinon": "^6.0.1" | ||
"parse-json": "^4.0.0", | ||
"sinon": "^6.1.4" | ||
}, | ||
@@ -61,0 +62,0 @@ "engines": { |
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
86559
2012
6
Updatedcommander@^2.17.1