Linux | Windows | MacOS |
---|---|---|
const {getNumber} = require('@bbq-beets/fib-tools')
assert.strictEqual(getNumber(8), 21)
const {getList} = require('@bbq-beets/fib-tools')
assert.strictDeepEqual(getList(8), [0, 1, 1, 2, 3, 5, 8, 13, 21])
const {getSequence} = require('@bbq-beets/fib-tools')
const seq = getSequence()
for (const n of seq) {
console.log(n) // The next Fibonacci number in the sequence
}
This repository demonstrates an instance of CWE-020: Improper Imput Validation.
- Run through the setup flow in the security tab to enable code scanning. Commit directly to master.
- Go to actions, and confirm that the analysis has run successfully.
- Edit script.js and add this code snippet. Create a PR. Wait for validation.
function endsWith(x, y) {
return x.lastIndexOf(y) === x.length - y.length;
}