Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect index signature for NbAclRole #1166

Closed
1 of 2 tasks
idsplus-carlos opened this issue Jan 17, 2019 · 2 comments · Fixed by #1215
Closed
1 of 2 tasks

Incorrect index signature for NbAclRole #1166

idsplus-carlos opened this issue Jan 17, 2019 · 2 comments · Fixed by #1215

Comments

@idsplus-carlos
Copy link

idsplus-carlos commented Jan 17, 2019

Issue type

I'm submitting a ...

  • bug report
  • feature request

Issue description

NbAclRole is defined incorrectly, which in turn causes problems with strict projects. As of now it has an index signature as [permission: string]: string|string[] but it also defines parent?: string which doesn't conform to that signature.

Current behavior:
NbAclRole has an invalid index signature and causes compilation problems when strict mode is enforced.

Expected behavior:
NbAclRole should have a valid signature.

Steps to reproduce:
Doesn't apply.

Related code:

export interface NbAclRole {
  parent?: string,
  [permission: string]: string|string[],
}

Other information:

npm, node, OS, Browser

Node: v10.14.1
npm: 6.4.1
OS: Windows 10

Angular, Nebular

Angular: 7.1.3
Nebular: 3.0.1 but also applies to 3.1.0 and master
@nnixaa
Copy link
Collaborator

nnixaa commented Jan 28, 2019

Hi @idsplus-carlos, thanks for reporting. Could you also post a reproducible configuration and error that occurs? Thanks.

@idsplus-carlos
Copy link
Author

Hi @nnixaa, here you go:

I've created a minimal test repo since i can't reproduce with stackblitz (i'm guessing it doesn't report errors the way i expected): https://github.com/idsplus-carlos/issue_nebular_1166

The error is as follows:

Failed to compile.

node_modules/@nebular/security/security.options.d.ts(3,5): error TS2411: Property 'parent' of type 'string | undefined' is not assignable to string index type 'string | string[]'.

Repro steps:

  1. ng new testproject && cd testproject
  2. npm i @nebular/security
  3. Add strict: true to compilerOptions in /tsconfig.json
  4. Import NbSecurityModule

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants