@mapbox/geojsonhint
Advanced tools
Comparing version 2.1.0 to 2.2.0
@@ -1,2 +0,2 @@ | ||
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.geojsonhint = f()}})(function(){var define,module,exports;return (function(){function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s}return e})()({1:[function(require,module,exports){ | ||
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.geojsonhint = f()}})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){ | ||
var rightHandRule = require('./rhr'); | ||
@@ -76,3 +76,3 @@ | ||
} | ||
} else if (type === 'object' && _[name] && _[name].constructor.name !== 'Object') { | ||
} else if (type === 'object' && _[name] && _[name].constructor !== Object) { | ||
return errors.push({ | ||
@@ -1216,2 +1216,5 @@ message: '"' + name + | ||
(function (process){ | ||
// .dirname, .basename, and .extname methods are extracted from Node.js v8.11.1, | ||
// backported and transplited with Babel, with backwards-compat fixes | ||
// Copyright Joyent, Inc. and other Node contributors. | ||
@@ -1268,10 +1271,2 @@ // | ||
// Split a filename into [root, dir, basename, ext], unix version | ||
// 'root' is just a slash, or nothing. | ||
var splitPathRe = | ||
/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/; | ||
var splitPath = function(filename) { | ||
return splitPathRe.exec(filename).slice(1); | ||
}; | ||
// path.resolve([from ...], to) | ||
@@ -1392,24 +1387,63 @@ // posix version | ||
exports.dirname = function(path) { | ||
var result = splitPath(path), | ||
root = result[0], | ||
dir = result[1]; | ||
exports.dirname = function (path) { | ||
if (typeof path !== 'string') path = path + ''; | ||
if (path.length === 0) return '.'; | ||
var code = path.charCodeAt(0); | ||
var hasRoot = code === 47 /*/*/; | ||
var end = -1; | ||
var matchedSlash = true; | ||
for (var i = path.length - 1; i >= 1; --i) { | ||
code = path.charCodeAt(i); | ||
if (code === 47 /*/*/) { | ||
if (!matchedSlash) { | ||
end = i; | ||
break; | ||
} | ||
} else { | ||
// We saw the first non-path separator | ||
matchedSlash = false; | ||
} | ||
} | ||
if (!root && !dir) { | ||
// No dirname whatsoever | ||
return '.'; | ||
if (end === -1) return hasRoot ? '/' : '.'; | ||
if (hasRoot && end === 1) { | ||
// return '//'; | ||
// Backwards-compat fix: | ||
return '/'; | ||
} | ||
return path.slice(0, end); | ||
}; | ||
if (dir) { | ||
// It has a dirname, strip trailing slash | ||
dir = dir.substr(0, dir.length - 1); | ||
function basename(path) { | ||
if (typeof path !== 'string') path = path + ''; | ||
var start = 0; | ||
var end = -1; | ||
var matchedSlash = true; | ||
var i; | ||
for (i = path.length - 1; i >= 0; --i) { | ||
if (path.charCodeAt(i) === 47 /*/*/) { | ||
// If we reached a path separator that was not part of a set of path | ||
// separators at the end of the string, stop now | ||
if (!matchedSlash) { | ||
start = i + 1; | ||
break; | ||
} | ||
} else if (end === -1) { | ||
// We saw the first non-path separator, mark this as the end of our | ||
// path component | ||
matchedSlash = false; | ||
end = i + 1; | ||
} | ||
} | ||
return root + dir; | ||
}; | ||
if (end === -1) return ''; | ||
return path.slice(start, end); | ||
} | ||
exports.basename = function(path, ext) { | ||
var f = splitPath(path)[2]; | ||
// TODO: make this comparison case-insensitive on windows? | ||
// Uses a mixed approach for backwards-compatibility, as ext behavior changed | ||
// in new Node.js versions, so only basename() above is backported here | ||
exports.basename = function (path, ext) { | ||
var f = basename(path); | ||
if (ext && f.substr(-1 * ext.length) === ext) { | ||
@@ -1421,5 +1455,49 @@ f = f.substr(0, f.length - ext.length); | ||
exports.extname = function (path) { | ||
if (typeof path !== 'string') path = path + ''; | ||
var startDot = -1; | ||
var startPart = 0; | ||
var end = -1; | ||
var matchedSlash = true; | ||
// Track the state of characters (if any) we see before our first dot and | ||
// after any path separator we find | ||
var preDotState = 0; | ||
for (var i = path.length - 1; i >= 0; --i) { | ||
var code = path.charCodeAt(i); | ||
if (code === 47 /*/*/) { | ||
// If we reached a path separator that was not part of a set of path | ||
// separators at the end of the string, stop now | ||
if (!matchedSlash) { | ||
startPart = i + 1; | ||
break; | ||
} | ||
continue; | ||
} | ||
if (end === -1) { | ||
// We saw the first non-path separator, mark this as the end of our | ||
// extension | ||
matchedSlash = false; | ||
end = i + 1; | ||
} | ||
if (code === 46 /*.*/) { | ||
// If this is our first dot, mark it as the start of our extension | ||
if (startDot === -1) | ||
startDot = i; | ||
else if (preDotState !== 1) | ||
preDotState = 1; | ||
} else if (startDot !== -1) { | ||
// We saw a non-dot and non-path separator before our dot, so we should | ||
// have a good chance at having a non-empty extension | ||
preDotState = -1; | ||
} | ||
} | ||
exports.extname = function(path) { | ||
return splitPath(path)[3]; | ||
if (startDot === -1 || end === -1 || | ||
// We saw a non-dot character immediately before the dot | ||
preDotState === 0 || | ||
// The (right-most) trimmed path component is exactly '..' | ||
preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) { | ||
return ''; | ||
} | ||
return path.slice(startDot, end); | ||
}; | ||
@@ -1426,0 +1504,0 @@ |
@@ -75,3 +75,3 @@ var rightHandRule = require('./rhr'); | ||
} | ||
} else if (type === 'object' && _[name] && _[name].constructor.name !== 'Object') { | ||
} else if (type === 'object' && _[name] && _[name].constructor !== Object) { | ||
return errors.push({ | ||
@@ -78,0 +78,0 @@ message: '"' + name + |
{ | ||
"name": "@mapbox/geojsonhint", | ||
"description": "validate and sanity-check geojson files", | ||
"version": "2.1.0", | ||
"version": "2.2.0", | ||
"author": "Tom MacWright", | ||
@@ -21,4 +21,4 @@ "bin": { | ||
"minimist": "1.2.0", | ||
"vfile": "^2.3.0", | ||
"vfile-reporter": "^4.0.0" | ||
"vfile": "^4.0.0", | ||
"vfile-reporter": "^5.1.1" | ||
}, | ||
@@ -28,6 +28,6 @@ "devDependencies": { | ||
"browserify": "^16.1.1", | ||
"eslint": "^4.18.2", | ||
"eslint": "^5.15.3", | ||
"fuzzer": "~0.2.0", | ||
"glob": "^7.1.2", | ||
"tap": "^11.1.2" | ||
"tap": "^12.6.1" | ||
}, | ||
@@ -34,0 +34,0 @@ "directories": { |
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
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
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
88927
2121
+ Added@types/unist@2.0.11(transitive)
+ Addedansi-regex@3.0.1(transitive)
+ Addedhas-flag@3.0.0(transitive)
+ Addedis-buffer@2.0.5(transitive)
+ Addedis-fullwidth-code-point@2.0.0(transitive)
+ Addedstring-width@2.1.1(transitive)
+ Addedstrip-ansi@4.0.0(transitive)
+ Addedsupports-color@5.5.0(transitive)
+ Addedunist-util-stringify-position@2.0.3(transitive)
+ Addedvfile@4.2.1(transitive)
+ Addedvfile-message@2.0.4(transitive)
+ Addedvfile-reporter@5.1.2(transitive)
+ Addedvfile-sort@2.2.2(transitive)
- Removedansi-regex@2.1.1(transitive)
- Removedcode-point-at@1.1.0(transitive)
- Removedhas-flag@2.0.0(transitive)
- Removedis-buffer@1.1.6(transitive)
- Removedis-fullwidth-code-point@1.0.0(transitive)
- Removednumber-is-nan@1.0.1(transitive)
- Removedreplace-ext@1.0.0(transitive)
- Removedstring-width@1.0.2(transitive)
- Removedstrip-ansi@3.0.1(transitive)
- Removedsupports-color@4.5.0(transitive)
- Removedunist-util-stringify-position@1.1.2(transitive)
- Removedvfile@2.3.0(transitive)
- Removedvfile-message@1.1.1(transitive)
- Removedvfile-reporter@4.0.0(transitive)
Updatedvfile@^4.0.0
Updatedvfile-reporter@^5.1.1