Skip to content

Bug: Accept number as command option value #226

@VelinGeorgiev

Description

@VelinGeorgiev

Description: We should be able to specify number as option value without the need to enclose it in quotes.

Steps to reproduce:

λ o365 spo storageentity set -u https://xxx.sharepoint.com/sites/apps -k velin1 -v 1

Expected:

// empty line. Command executed successfully

Actual:

Error: s.replace is not a function

Additional notes:
Seems that the option value -v 1 is problem for Utils.escapeXml because actually is number.
Quick look at the Utils.escapeXml method shows that if we turn the var 's' to string, could resolve the ask.

     // change
    return s.replace(/[<>&"]/g, (c: string): string => {
    // to 
    return s.toString().replace(/[<>&"]/g, (c: string): string => {

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions