SharePoint/PnP-JS-Core

Folder.listItemAllFields.get return type is any[] instead of any

Closed this issue · 3 comments

Category

[ ] Enhancement

[x] Bug

[ ] Question

Version

Please specify what version of the library you are using: [1.0.4]

Expected / Desired Behavior / Question

Folder.listItemAllFields.get return type is any object to be able to use dot notation to access fields.

Observed Behavior

Folder.listItemAllFields.get return type any[]. Line like fieldValues.Title will not compile.

Steps to Reproduce

var values = await sp.web.lists.getByTitle('Documents').rootFolder.folders.getByName('Test Folder').listItemAllFields.get();
console.log(values.Title); // this line will lead to error

Thanks Alex! We'll take a look.
I'm wondering, is this for new @pnp scoped library ver. 1.0.4 and not sp-pnp-js? You'd probably mismatched the repo. =)
Let's close this one and open in the pnp/pnpjs?

Confirming the issue in @pnp/sp:

image

Closing this one.

Sorry, my bad!
Sometimes it's better to wait until morning :)