Update dependencies to fix vulnerabilities

master
Buddy Sandidge 6 years ago
parent 47c65ad9c7
commit ff7d7a252b

@ -14,6 +14,5 @@
"node": true
},
"extends": "eslint:recommended",
"ecmaFeatures": {},
"plugins": []
}

@ -8,8 +8,7 @@ var isRegExp = utils.isRegExp
var isString = utils.isString
var noop = utils.noop
function RouteNode (options) {
options = options || {}
function RouteNode () {
this._children = Object.create(null)
this._funcs = Object.create(null)
this._regExs = Object.create(null)

@ -10,8 +10,7 @@ var isFunction = utils.isFunction
var isString = utils.isString
var noop = utils.noop
function Router(options) {
options = options || {}
function Router() {
this.routes = new RouteNode()
}

1434
package-lock.json generated

File diff suppressed because it is too large Load Diff

@ -1,6 +1,6 @@
{
"name": "routing-buddy",
"version": "0.2.0",
"version": "0.2.1",
"description": "Another router library for both client and server",
"main": "lib/router.js",
"scripts": {
@ -27,8 +27,8 @@
},
"homepage": "https://github.com/xbudex/routing-buddy#readme",
"devDependencies": {
"eslint": "^1.10.3",
"expect": "^1.14.0",
"mocha": "^2.4.5"
"eslint": "^5.12.0",
"expect": "^23.6.0",
"mocha": "^5.2.0"
}
}

@ -3,7 +3,7 @@ var RouteNode = require('../lib/route-node')
module.exports = describe('RouteNode', function () {
it('→ exists', function () {
expect(new RouteNode()).toExist()
expect(new RouteNode()).toBeInstanceOf(RouteNode)
})
describe('→ add nodes', function () {
@ -38,11 +38,11 @@ module.exports = describe('RouteNode', function () {
it('→ get error callback for not found', function (done) {
node.get(['fake', 'route'], [], function (err, func, cbContext, args) {
expect(err).toBeA(Error)
expect(err).toBeInstanceOf(Error)
expect(err.message).toMatch(/not found/)
expect(func).toNotExist()
expect(cbContext).toNotExist()
expect(args).toNotExist()
expect(func).not.toBeDefined()
expect(cbContext).not.toBeDefined()
expect(args).not.toBeDefined()
done()
})
})

@ -4,7 +4,7 @@ var NotFoundError = require('../lib/error').NotFound
describe('Router', function () {
it('→ exists', function () {
expect(Router).toExist()
expect(Router).toBeDefined()
})
it('→ add root node', function (done) {
@ -31,7 +31,7 @@ describe('Router', function () {
var router = new Router()
router.add(['/user', /^(\d+)$/], function (number) { return number })
router.route('/user/', function (err) {
expect(err).toBeA(NotFoundError)
expect(err).toBeInstanceOf(NotFoundError)
done()
})
})
@ -39,9 +39,9 @@ describe('Router', function () {
it('→ get error in callback for missing handler', function (done) {
var router = new Router()
router.route('/some/fake/path', function (err, handlerResult) {
expect(err).toBeA(Error)
expect(err).toBeInstanceOf(Error)
expect(err.message).toMatch(/not found/)
expect(handlerResult).toNotExist()
expect(handlerResult).not.toBeDefined()
done()
})
})
@ -62,7 +62,7 @@ describe('Router', function () {
var router = new Router()
router.add(['/by/id', /\d+/], function () {})
router.route('/by/id/not-an-id', function (err) {
expect(err).toBeA(NotFoundError)
expect(err).toBeInstanceOf(NotFoundError)
done()
})
})
@ -85,8 +85,8 @@ describe('Router', function () {
var router = new Router()
router.add(['by', 'order', /(\d+)/], function (one, two, three) {
expect(one).toBe('1')
expect(two).toNotExist()
expect(three).toNotExist()
expect(two).not.toBeDefined()
expect(three).not.toBeDefined()
})
router.route('/by/order/1-2-3', function (err) {
@ -131,7 +131,7 @@ describe('Router', function () {
var router = new Router()
router.add(['/by/order', toInt], function () {})
router.route('/by/order/not-found', function (err) {
expect(err).toBeA(NotFoundError)
expect(err).toBeInstanceOf(NotFoundError)
done()
})
})

@ -16,12 +16,12 @@ SomeClass.prototype.bar = 'asdf'
describe('utils', function () {
it('→ exists', function () {
expect(utils).toExist()
expect(utils).toBeDefined()
})
describe('→ noop', function () {
it('→ is a function', function () {
expect(noop).toBeA(Function)
expect(noop).toBeInstanceOf(Function)
})
})

Loading…
Cancel
Save