remark-validate-links
Advanced tools
Comparing version 10.0.3 to 10.0.4
@@ -36,3 +36,4 @@ 'use strict' | ||
landmarks[filePath] = {'': !noEntry} | ||
landmarks[filePath] = Object.create(null) | ||
landmarks[filePath][''] = !noEntry | ||
@@ -39,0 +40,0 @@ if (++actual === expected) { |
'use strict' | ||
var xtend = require('xtend') | ||
var constants = require('../constants') | ||
@@ -9,3 +8,3 @@ | ||
function mergeLandmarks(ctx) { | ||
var result = {} | ||
var result = Object.create(null) | ||
var files = ctx.files | ||
@@ -24,3 +23,6 @@ var length = files.length | ||
for (landmark in landmarks) { | ||
result[landmark] = xtend(result[landmark] || {}, landmarks[landmark]) | ||
result[landmark] = Object.assign( | ||
Object.create(null), | ||
landmarks[landmark] | ||
) | ||
} | ||
@@ -27,0 +29,0 @@ } |
@@ -29,3 +29,6 @@ 'use strict' | ||
internal = references[reference] | ||
all = result[reference] || (result[reference] = {}) | ||
all = | ||
reference in result | ||
? result[reference] | ||
: (result[reference] = Object.create(null)) | ||
@@ -32,0 +35,0 @@ for (hash in internal) { |
@@ -23,3 +23,3 @@ 'use strict' | ||
/* istanbul ignore next - `else` could happen in browser. */ | ||
lands = landmarks[reference] || {} | ||
lands = reference in landmarks ? landmarks[reference] : Object.create(null) | ||
@@ -76,3 +76,3 @@ for (hash in refs) { | ||
// Only suggest if file exists. | ||
if (!landmarks[landmark] || !landmarks[landmark]['']) { | ||
if (!(landmark in landmarks) || !landmarks[landmark]['']) { | ||
continue | ||
@@ -79,0 +79,0 @@ } |
@@ -9,3 +9,2 @@ 'use strict' | ||
var toString = require('mdast-util-to-string') | ||
var xtend = require('xtend') | ||
var slugs = require('github-slugger')() | ||
@@ -35,4 +34,4 @@ var constants = require('../constants') | ||
var space = file.data | ||
var references = {} | ||
var landmarks = {} | ||
var references = Object.create(null) | ||
var landmarks = Object.create(null) | ||
var actual = 0 | ||
@@ -42,3 +41,3 @@ var expected = 0 | ||
var added = [] | ||
var config = xtend(ctx.urlConfig, { | ||
var config = Object.assign({}, ctx.urlConfig, { | ||
path: absolute, | ||
@@ -112,3 +111,6 @@ base: absolute ? path.dirname(absolute) : file.cwd, | ||
function addLandmark(filePath, hash) { | ||
var marks = landmarks[filePath] || (landmarks[filePath] = {}) | ||
var marks = | ||
filePath in landmarks | ||
? landmarks[filePath] | ||
: (landmarks[filePath] = Object.create(null)) | ||
@@ -119,4 +121,7 @@ marks[hash] = true | ||
function addReference(filePath, hash, node) { | ||
var refs = references[filePath] || (references[filePath] = {}) | ||
var hashes = refs[hash] || (refs[hash] = []) | ||
var refs = | ||
filePath in references | ||
? references[filePath] | ||
: (references[filePath] = Object.create(null)) | ||
var hashes = hash in refs ? refs[hash] : (refs[hash] = []) | ||
@@ -123,0 +128,0 @@ hashes.push(node) |
'use strict' | ||
var xtend = require('xtend') | ||
var check = require('./check') | ||
@@ -24,3 +23,6 @@ var find = require('./find') | ||
function transformer(tree, file, next) { | ||
find.run(xtend(settings, {tree: tree, file: file, fileSet: fileSet}), done) | ||
find.run( | ||
Object.assign({}, settings, {tree: tree, file: file, fileSet: fileSet}), | ||
done | ||
) | ||
@@ -27,0 +29,0 @@ function done(error) { |
{ | ||
"name": "remark-validate-links", | ||
"version": "10.0.3", | ||
"version": "10.0.4", | ||
"description": "remark plugin to validate links to headings and files", | ||
@@ -50,4 +50,3 @@ "license": "MIT", | ||
"trough": "^1.0.0", | ||
"unist-util-visit": "^2.0.0", | ||
"xtend": "^4.0.0" | ||
"unist-util-visit": "^2.0.0" | ||
}, | ||
@@ -54,0 +53,0 @@ "devDependencies": { |
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
30074
7
611
- Removedxtend@^4.0.0
- Removedxtend@4.0.2(transitive)