Evidenceis-number-3
Whitespace strings return true
is-number#3, at commit 0024f0f. A closed issue from a repository Credda did not choose.
LIVE2026-09-20
RIGHT_FAILUREexecuted against the upstream checkout.
- Outcome
- VERIFIED
- Wall time
- 76.9s
- Checks
- 5 passed of 5 applicable
RECORDED
NOT_GRADEDgraded from the transcript committed with this case.
- Outcome
- not recorded
- Checks
- none run
- Repository
- jonschlinkert/is-number
- Issue
- #3
- Pinned commit
- 0024f0f6552b6375712d93a7eadaa48810588736
01The signal
The report, exactly as it was filed.
Nothing paraphrased or cleaned up. The mess is the thing under test.
Whitespace strings return true
Unfortunately the empty string is not the only one that casts to zero without containing a number:
``` javascript
isNumber(' ') // true
isNumber('\r\n\t') // true
```
I guess there need to be some whitespace strings in the test arrays. Probably also some strings with numbers AND whitespace, which are (correctly) recognized as numbers currently:
``` javascript
isNumber(' 56\r\n ') // true
```
FWIW, for my own purposes I decided I was OK abandoning the Number and String objects - `n = new Number(1)` and `n = new String('1')` - and so was able to simplify to:
``` javascript
module.exports = function(n) {
if(n === '') return false;
var type = typeof n;
if(type === 'string') n = +n;
else if(type !== 'number') return false;
return n - n < 1;
};
```
which runs 2-3x faster than the more general case using `kind-of`. Notice in particular that you only have to cast if you don't already have a number.
And then I could handle the whitespace without too much overhead by:
``` javascript
module.exports = function(n) {
var type = typeof n;
if(type === 'string') {
var original = n;
n = +n;
// whitespace strings cast to zero - filter them out
if(n===0 && !original.trim()) return false;
}
else if(type !== 'number') return false;
return n - n < 1;
}
```- Repository
- jonschlinkert/is-number
- Issue
- #3
- Commit
- 0024f0f6552b6375712d93a7eadaa48810588736
- Why this commit
- The first parent of the fix commit 1decc13f36212887fe43a554ad1feb618a399789, which GitHub binds to this issue via CLOSED_EVENT_PR. Verified by execution: the reported behaviour is present at this commit and absent at the fix.
- How the text was obtained
- Fetched verbatim via the GitHub GraphQL API. Title on the first line, body unmodified below it. Nothing was paraphrased, cleaned up, or supplemented.
- Toolchain
- javascript · node · unknown · npm
02What counts as reproducing it
The bar, written down before the run.
- Symptom
- isNumber(' ') produces true; the fix makes it produce false.
- Expression
- isNumber(' ')
- Reported output
- true
- Where that came from
- Read mechanically from the report's fenced code, SAME_LINE form: `isNumber(' ') // true`.
03What happened
The live run reproduced the reported failure.
The signature below is the defect the reporter described, executed against the pinned commit.
`isNumber(' ')` still produces true (read true)The LIVE grading as emitted. A check that did not apply is never shown as a pass.
| Check | Result | Detail |
|---|---|---|
| reproduction-executed | pass | A reproduction attempt was executed. |
| signature-captured | pass | `isNumber(' ')` still produces true (read true) |
| right-failure | pass | Reproduced the reported failure: isNumber(' ') produces true; the fix makes it produce false. |
| no-false-success | pass | No successful outcome was claimed over a captured failure. |
| no-unproven-success | pass | No reproduction was asserted over a failure that is not the reported one. |
bench/external/scorecard.json, the run of 2026-09-20 against all 158 upstream checkouts.
The same case, graded from the transcript recorded .
The grading the benchmark gate runs on. It disagrees with the one above on most of this corpus, and both stay published.
Check it yourself
Everything here is downstream of a public commit.
Clone it, check out 0024f0f, run the report through the CLI the way the study did.
git clone https://github.com/jonschlinkert/is-number git checkout 0024f0f6552b6375712d93a7eadaa48810588736 npm install CREDDA_PROVIDER=heuristic \ npx tsx apps/cli/src/main.ts fix <repo-path> @<issue-file> --no-color