• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

willmendesneto / ngx-feature-toggle / #1010

pending completion
#1010

push

snyk-bot
fix: upgrade zone.js from 0.11.5 to 0.12.0

Snyk has created this PR to upgrade zone.js from 0.11.5 to 0.12.0.

See this package in npm:
https://www.npmjs.com/package/zone.js

See this project in Snyk:
https://app.snyk.io/org/willmendesneto/project/486f5426-06e0-4cbf-8382-8b38e5a4e6a1?utm_source=github&utm_medium=referral&page=upgrade-pr

26 of 32 branches covered (81.25%)

Branch coverage included in aggregate %.

43 of 48 relevant lines covered (89.58%)

19.98 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

78.57
/projects/ngx-feature-toggle/src/lib/ngx-feature-toggle-provider.component.ts
1
import { Component, Input, OnInit, DoCheck } from '@angular/core';
2
import { set, FeatureToggleServiceConfig } from 'feature-toggle-service';
3

4
@Component({
5
  selector: 'feature-toggle-provider',
6
  template: '<ng-content></ng-content>',
7
})
8
export class FeatureToggleProviderComponent implements DoCheck, OnInit {
1✔
9
  @Input()
10
  features: FeatureToggleServiceConfig = {};
2✔
11

12
  private currentConfig: FeatureToggleServiceConfig = {};
2✔
13

14
  ngOnInit() {
15
    if (typeof this.features !== 'object') {
2!
16
      throw new Error('Attribute `features` should not be null or empty');
×
17
    }
18
    this.setFeatureToggles();
2✔
19
  }
20

21
  ngDoCheck() {
22
    this.setFeatureToggles();
2✔
23
  }
24

25
  private setFeatureToggles() {
26
    if (this.currentConfig !== this.features) {
4!
27
      // Using `Object.assign()` method for bundle size decreasing purposes
28
      // It's required since it needs a new memory reference
29
      // for the new object value
30
      this.currentConfig = Object.assign({}, this.features);
4✔
31
      set(this.features);
4✔
32
    }
33
  }
34
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc