score:1

The message suggest using this kind of expression:

const pages = { ...{ length: pdf.numPages }};

For instance, the following code compiles:

const somePdf = {
  numPages: 10,
  pageSize: 'A4',
}

const pages = { ...{ length: somePdf.numPages }};

console.log(JSON.stringify(pages))

// returns "{ length: 10}"

Related Query

More Query from same tag