13 lines
415 B
JavaScript
13 lines
415 B
JavaScript
import fs from 'fs'
|
|
const s = fs.readFileSync('tmp-api-docs.json', 'utf8')
|
|
for (const k of ['productOptions', 'ProductOption', 'product/list', '/app/device/product', 'CzDeviceProduct', '产品型号']) {
|
|
let idx = 0
|
|
let n = 0
|
|
while (n < 6 && (idx = s.indexOf(k, idx)) !== -1) {
|
|
console.log('\n---', k, '@', idx)
|
|
console.log(s.slice(Math.max(0, idx - 40), idx + 500))
|
|
idx += k.length
|
|
n++
|
|
}
|
|
}
|