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

@flopflip/adapter-utilities

Package Overview
Dependencies
Maintainers
1
Versions
244
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@flopflip/adapter-utilities - npm Package Compare versions

Comparing version 0.0.1 to 1.0.0

dist/declarations/src/denormalize-flag-name/denormalize-flag-name.d.ts

22

CHANGELOG.md
# @flopflip/adapter-utilities
## 1.0.0
### Major Changes
- [`b099b51`](https://github.com/tdeekens/flopflip/commit/b099b5175aebc472281ef40f3d67c5cb298d1be9) [#1362](https://github.com/tdeekens/flopflip/pull/1362) Thanks [@tdeekens](https://github.com/tdeekens)! - refactor: updateFlags to be only on adapter
The `updateFlags` export from each adapter is no longer present. Please use the `adapter.updateFlags` function instead. The prior was a re-export of the latter for longer anyway.
This affects also other locations you should hopefully not be affected by:
1. `test-utils`: does not export `updateFlags` anymore. Use `adapter.updateFlags`
2. Globals: The globals on the window do not contain a `window.__flopflip__.[id].updateFlags` anymore
* [`2310e35`](https://github.com/tdeekens/flopflip/commit/2310e356c2c9f81d68bc88b7aaf25442da100c57) [#1356](https://github.com/tdeekens/flopflip/pull/1356) Thanks [@tdeekens](https://github.com/tdeekens)! - refactor: add and use shared adapter utilities
### Patch Changes
- [`0aff3a2`](https://github.com/tdeekens/flopflip/commit/0aff3a21d4b6ac581db0e795d48fde9aa63b61bb) [#1360](https://github.com/tdeekens/flopflip/pull/1360) Thanks [@tdeekens](https://github.com/tdeekens)! - fix/splitio normlaization
- Updated dependencies [[`521660c`](https://github.com/tdeekens/flopflip/commit/521660c2452628e336896300fd1ab743cf6a4b12), [`3d2a174`](https://github.com/tdeekens/flopflip/commit/3d2a1742f9e6c99ba0360e8f33de6ce077fbd404), [`b9c74ed`](https://github.com/tdeekens/flopflip/commit/b9c74ed24b5e695c914b8c82a3a81926558b78f7), [`339a427`](https://github.com/tdeekens/flopflip/commit/339a42745a7131ee18aaa27d196a0cdc4207ee88), [`4c1d86b`](https://github.com/tdeekens/flopflip/commit/4c1d86be23e0c0f50b07191e6984db4fd4b0139c)]:
- @flopflip/types@4.0.0

3

dist/declarations/src/index.d.ts

@@ -1,3 +0,4 @@

export { default as normalizeFlag } from './normalize-flags';
export { default as normalizeFlag } from './normalize-flag';
export { default as normalizeFlags } from './normalize-flags';
export { default as denormalizeFlagName } from './denormalize-flag-name';
export { default as exposeGlobally } from './expose-globally';

@@ -5,11 +5,13 @@ 'use strict';

var camelCase = require('lodash/camelCase');
var _slicedToArray = require('@babel/runtime/helpers/slicedToArray');
var camelCase = require('lodash/camelCase');
var kebabCase = require('lodash/kebabCase');
var getGlobalThis = require('globalthis');
function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
var camelCase__default = /*#__PURE__*/_interopDefault(camelCase);
var _slicedToArray__default = /*#__PURE__*/_interopDefault(_slicedToArray);
var camelCase__default = /*#__PURE__*/_interopDefault(camelCase);
var kebabCase__default = /*#__PURE__*/_interopDefault(kebabCase);
var getGlobalThis__default = /*#__PURE__*/_interopDefault(getGlobalThis);

@@ -22,3 +24,4 @@ var normalizeFlag = function normalizeFlag(flagName, flagValue) {

var normalizeFlags = function normalizeFlags(rawFlags) {
return Object.entries(rawFlags).reduce(function (normalizedFlags, _ref) {
var normalizeFlag$1 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : normalizeFlag;
return Object.entries(rawFlags || {}).reduce(function (normalizedFlags, _ref) {
var _ref2 = _slicedToArray__default['default'](_ref, 2),

@@ -28,3 +31,3 @@ flagName = _ref2[0],

var _normalizeFlag = normalizeFlag(flagName, flagValue),
var _normalizeFlag = normalizeFlag$1(flagName, flagValue),
_normalizeFlag2 = _slicedToArray__default['default'](_normalizeFlag, 2),

@@ -44,4 +47,15 @@ normalizedFlagName = _normalizeFlag2[0],

var exposeGlobally = function exposeGlobally(adapter) {
var globalThis = getGlobalThis__default['default']();
if (!globalThis.__flopflip__) {
globalThis.__flopflip__ = {};
}
globalThis.__flopflip__[adapter.id] = adapter;
};
exports.denormalizeFlagName = denormalizeFlagName;
exports.normalizeFlag = normalizeFlags;
exports.exposeGlobally = exposeGlobally;
exports.normalizeFlag = normalizeFlag;
exports.normalizeFlags = normalizeFlags;

@@ -5,11 +5,13 @@ 'use strict';

var camelCase = require('lodash/camelCase');
var _slicedToArray = require('@babel/runtime/helpers/slicedToArray');
var camelCase = require('lodash/camelCase');
var kebabCase = require('lodash/kebabCase');
var getGlobalThis = require('globalthis');
function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
var camelCase__default = /*#__PURE__*/_interopDefault(camelCase);
var _slicedToArray__default = /*#__PURE__*/_interopDefault(_slicedToArray);
var camelCase__default = /*#__PURE__*/_interopDefault(camelCase);
var kebabCase__default = /*#__PURE__*/_interopDefault(kebabCase);
var getGlobalThis__default = /*#__PURE__*/_interopDefault(getGlobalThis);

@@ -22,3 +24,4 @@ var normalizeFlag = function normalizeFlag(flagName, flagValue) {

var normalizeFlags = function normalizeFlags(rawFlags) {
return Object.entries(rawFlags).reduce(function (normalizedFlags, _ref) {
var normalizeFlag$1 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : normalizeFlag;
return Object.entries(rawFlags || {}).reduce(function (normalizedFlags, _ref) {
var _ref2 = _slicedToArray__default['default'](_ref, 2),

@@ -28,3 +31,3 @@ flagName = _ref2[0],

var _normalizeFlag = normalizeFlag(flagName, flagValue),
var _normalizeFlag = normalizeFlag$1(flagName, flagValue),
_normalizeFlag2 = _slicedToArray__default['default'](_normalizeFlag, 2),

@@ -44,4 +47,15 @@ normalizedFlagName = _normalizeFlag2[0],

var exposeGlobally = function exposeGlobally(adapter) {
var globalThis = getGlobalThis__default['default']();
if (!globalThis.__flopflip__) {
globalThis.__flopflip__ = {};
}
globalThis.__flopflip__[adapter.id] = adapter;
};
exports.denormalizeFlagName = denormalizeFlagName;
exports.normalizeFlag = normalizeFlags;
exports.exposeGlobally = exposeGlobally;
exports.normalizeFlag = normalizeFlag;
exports.normalizeFlags = normalizeFlags;

@@ -0,4 +1,5 @@

import camelCase from 'lodash/camelCase';
import _slicedToArray from '@babel/runtime/helpers/esm/slicedToArray';
import camelCase from 'lodash/camelCase';
import kebabCase from 'lodash/kebabCase';
import getGlobalThis from 'globalthis';

@@ -11,3 +12,4 @@ var normalizeFlag = function normalizeFlag(flagName, flagValue) {

var normalizeFlags = function normalizeFlags(rawFlags) {
return Object.entries(rawFlags).reduce(function (normalizedFlags, _ref) {
var normalizeFlag$1 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : normalizeFlag;
return Object.entries(rawFlags || {}).reduce(function (normalizedFlags, _ref) {
var _ref2 = _slicedToArray(_ref, 2),

@@ -17,3 +19,3 @@ flagName = _ref2[0],

var _normalizeFlag = normalizeFlag(flagName, flagValue),
var _normalizeFlag = normalizeFlag$1(flagName, flagValue),
_normalizeFlag2 = _slicedToArray(_normalizeFlag, 2),

@@ -33,2 +35,12 @@ normalizedFlagName = _normalizeFlag2[0],

export { denormalizeFlagName, normalizeFlags as normalizeFlag, normalizeFlags };
var exposeGlobally = function exposeGlobally(adapter) {
var globalThis = getGlobalThis();
if (!globalThis.__flopflip__) {
globalThis.__flopflip__ = {};
}
globalThis.__flopflip__[adapter.id] = adapter;
};
export { denormalizeFlagName, exposeGlobally, normalizeFlag, normalizeFlags };
{
"name": "@flopflip/adapter-utilities",
"version": "0.0.1",
"version": "1.0.0",
"description": "Adapter utilities for flipflop",

@@ -31,5 +31,6 @@ "main": "dist/flopflip-adapter-utilities.cjs.js",

"dependencies": {
"@flopflip/types": "4.0.0",
"@babel/runtime": "7.12.5",
"lodash": "4.17.20",
"@flopflip/types": "3.1.0"
"globalthis": "1.0.1"
},

@@ -36,0 +37,0 @@ "peerDependencies": {

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