Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More โ†’
Socket
Sign inDemoInstall
Socket

@spotify-confidence/openfeature-web-provider

Package Overview
Dependencies
Maintainers
4
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@spotify-confidence/openfeature-web-provider - npm Package Compare versions

Comparing version 0.2.7 to 0.2.8

7

CHANGELOG.md

@@ -9,2 +9,9 @@ # Changelog

## [0.2.8](https://github.com/spotify/confidence-sdk-js/compare/openfeature-web-provider-v0.2.7...openfeature-web-provider-v0.2.8) (2024-06-04)
### ๐Ÿ› Bug Fixes
* cache timeouts ([#157](https://github.com/spotify/confidence-sdk-js/issues/157)) ([357bb02](https://github.com/spotify/confidence-sdk-js/commit/357bb025b02183f26700fa5df857d3528a51f747)), closes [#155](https://github.com/spotify/confidence-sdk-js/issues/155)
## [0.2.7](https://github.com/spotify/confidence-sdk-js/compare/openfeature-web-provider-v0.2.5...openfeature-web-provider-v0.2.7) (2024-06-03)

@@ -11,0 +18,0 @@

2

dist/index.d.ts

@@ -19,3 +19,3 @@ import { Confidence } from '@spotify-confidence/sdk';

onContextChange(oldContext: EvaluationContext, newContext: EvaluationContext): Promise<void>;
private expectReadyOrTimeout;
private expectReadyOrError;
private evaluateFlag;

@@ -22,0 +22,0 @@ private mapErrorCode;

@@ -78,3 +78,3 @@ import { ErrorCode, OpenFeatureEventEmitter, ProviderEvents } from '@openfeature/web-sdk';

});
return _this.expectReadyOrTimeout();
return _this.expectReadyOrError();
})();

@@ -97,16 +97,13 @@ }

_this.confidence.setContext(convertContext(changes));
return _this.expectReadyOrTimeout();
return _this.expectReadyOrError();
})();
}
expectReadyOrTimeout() {
const timeout = this.confidence.config.timeout;
expectReadyOrError() {
let close;
return new Promise((resolve, reject)=>{
const timeoutId = setTimeout(()=>{
reject(new Error(`Resolve timed out after ${timeout}ms`));
}, timeout);
close = this.confidence.subscribe((state)=>{
if (state === 'READY') {
resolve();
clearTimeout(timeoutId);
} else if (state === 'ERROR') {
reject(new Error('Provider initialization failed'));
}

@@ -113,0 +110,0 @@ });

{
"name": "@spotify-confidence/openfeature-web-provider",
"license": "Apache-2.0",
"version": "0.2.7",
"version": "0.2.8",
"type": "module",

@@ -18,3 +18,3 @@ "types": "dist/index.d.ts",

"@openfeature/web-sdk": "^1.0.3",
"@spotify-confidence/sdk": "0.1.2"
"@spotify-confidence/sdk": "0.1.3"
},

@@ -28,4 +28,5 @@ "publishConfig": {

"scripts": {
"build": "tsc",
"bundle": "rollup -c && api-extractor run"
"build": "tsc -b",
"bundle": "rollup -c && api-extractor run",
"prepack": "yarn build && yarn bundle"
},

@@ -32,0 +33,0 @@ "files": [

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with โšก๏ธ by Socket Inc