You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
core throws a TypeError when index.json has a version semver can't read #154
When index.json has a version that semver.coerce can't read (null, a string with no digits, an object), core rejects with TypeError: Cannot read properties of null (reading 'major') from core/index.js#L139. The comment above it at L131 assumes every version parses, so nothing checks for null.
The error doesn't say which entry or which URL was the problem, and core/test/errors.js only checks that core rejects, so the TypeError passes it.
Repro, with the fixture server:
constnodevu=require('@nodevu/core');const{ at }=require('@nodevu/fixtures');awaitnodevu(at('2024-01-01',{index: [{version: null,date: '2024-01-01',files: ['src']}],schedule: {},}));// TypeError: Cannot read properties of null (reading 'major')
fast-check finds it in its first run, shrunk to version: null in an otherwise empty index.
core should reject with an error that names the version and the index URL instead.
Activity