SharePoint / PnP-JS-Core

Code moved to https://github.com/pnp/pnpjs. This repository is archived.
Other
379 stars 231 forks source link

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

Closed AJIXuMuK closed 6 years ago

AJIXuMuK commented 6 years ago

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
koltyakov commented 6 years ago

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

koltyakov commented 6 years ago

Closing this one.

AJIXuMuK commented 6 years ago

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