tinesoft/ngx-cookieconsent

blacklistPage and whitelistPage do not support RegExp

evheniyrz opened this issue ยท 2 comments

Bug Report or Feature Request (mark with an x)

- [x] bug report -> please search issues before submitting
- [ ] feature request

CookieConsent and Library Versions?

- cookieconsent version: 3.1.1
- ngx-cookieconsent version: 2.2.3

OS Version?

Windows 10 64-bit

Angular, Node and al Versions?

Angular 10

Repro steps

  1. Create a cookie consent config.
  2. Try to add whitelistPage or blacklistPage to configuration with RegExp value.

The log given by the failure

Type 'RegExp' is not assignable to type 'string' .ts(2322)

Desired functionality

a regular expression can be added to a whitelist Page or blacklist Page by the documentation

 /**
     * Simple whitelist for pages. specify page by:
     * - using a string : '/index.html'           (matches '/index.html' exactly) OR
     * - using RegExp   : /\/page_[\d]+\.html/    (matched '/page_1.html' and '/page_2.html' etc)
     *
     */
    whitelistPage?: string[]; !!!!!!!!!! why only : string[]
    /**
     * Simple blacklist for pages. specify page by:
     * - using a string : '/index.html'           (matches '/index.html' exactly) OR
     * - using RegExp   : /\/page_[\d]+\.html/    (matched '/page_1.html' and '/page_2.html' etc)
     *
     */
    blacklistPage?: string[]; !!!!!!!!! why only : string[]

thanks for consideration

Hi @evheniyrz !

First of all, thanks for using the library and for issuing the 100th issue! ๐ŸŽŠ
I will fix that ASAP, stay tuned.

Cheers!

๐ŸŽ‰ This issue has been resolved in version 3.0.0 ๐ŸŽ‰

The release is available on:

Your semantic-release bot ๐Ÿ“ฆ๐Ÿš€