mirror of
https://github.com/reduxjs/redux-devtools.git
synced 2025-07-22 14:09:46 +03:00
Format
This commit is contained in:
parent
5b388bec7f
commit
7408db7d7d
|
@ -62,13 +62,13 @@ const migrateOldOptions = (oldOptions: OldOrNewOptions): Options => ({
|
||||||
? oldOptions.filter && oldOptions.whitelist.length > 0
|
? oldOptions.filter && oldOptions.whitelist.length > 0
|
||||||
? FilterState.ALLOWLIST_SPECIFIC
|
? FilterState.ALLOWLIST_SPECIFIC
|
||||||
: oldOptions.filter
|
: oldOptions.filter
|
||||||
? FilterState.DENYLIST_SPECIFIC
|
? FilterState.DENYLIST_SPECIFIC
|
||||||
: FilterState.DO_NOT_FILTER
|
: FilterState.DO_NOT_FILTER
|
||||||
: oldOptions.filter === 'WHITELIST_SPECIFIC'
|
: oldOptions.filter === 'WHITELIST_SPECIFIC'
|
||||||
? FilterState.ALLOWLIST_SPECIFIC
|
? FilterState.ALLOWLIST_SPECIFIC
|
||||||
: oldOptions.filter === 'BLACKLIST_SPECIFIC'
|
: oldOptions.filter === 'BLACKLIST_SPECIFIC'
|
||||||
? FilterState.DENYLIST_SPECIFIC
|
? FilterState.DENYLIST_SPECIFIC
|
||||||
: oldOptions.filter,
|
: oldOptions.filter,
|
||||||
});
|
});
|
||||||
|
|
||||||
const get = (callback: (options: Options) => void) => {
|
const get = (callback: (options: Options) => void) => {
|
||||||
|
|
|
@ -401,8 +401,8 @@ export default function (DOMNode: HTMLElement, options: Partial<Options> = {}) {
|
||||||
d.data._children && d.data._children.length > 0
|
d.data._children && d.data._children.length > 0
|
||||||
? nodeStyleOptions.colors.collapsed
|
? nodeStyleOptions.colors.collapsed
|
||||||
: d.data.children && d.data.children.length > 0
|
: d.data.children && d.data.children.length > 0
|
||||||
? nodeStyleOptions.colors.parent
|
? nodeStyleOptions.colors.parent
|
||||||
: nodeStyleOptions.colors.default,
|
: nodeStyleOptions.colors.default,
|
||||||
);
|
);
|
||||||
|
|
||||||
// transition nodes to their new position
|
// transition nodes to their new position
|
||||||
|
|
|
@ -190,8 +190,8 @@ export const invertBase16Theme = (base16Theme: Base16Theme): Base16Theme =>
|
||||||
(t[key as keyof Base16Theme] = /^base/.test(key)
|
(t[key as keyof Base16Theme] = /^base/.test(key)
|
||||||
? invertColor(base16Theme[key as keyof Base16Theme])
|
? invertColor(base16Theme[key as keyof Base16Theme])
|
||||||
: key === 'scheme'
|
: key === 'scheme'
|
||||||
? base16Theme[key] + ':inverted'
|
? base16Theme[key] + ':inverted'
|
||||||
: base16Theme[key as keyof Base16Theme]),
|
: base16Theme[key as keyof Base16Theme]),
|
||||||
t
|
t
|
||||||
),
|
),
|
||||||
{} as Base16Theme,
|
{} as Base16Theme,
|
||||||
|
|
|
@ -34,17 +34,17 @@ export const composeWithDevTools: ReduxDevtoolsExtensionCompose =
|
||||||
process.env.NODE_ENV === 'production'
|
process.env.NODE_ENV === 'production'
|
||||||
? logOnly.composeWithDevTools
|
? logOnly.composeWithDevTools
|
||||||
: typeof window !== 'undefined' &&
|
: typeof window !== 'undefined' &&
|
||||||
window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__
|
window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__
|
||||||
? window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__
|
? window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__
|
||||||
: extensionComposeStub;
|
: extensionComposeStub;
|
||||||
|
|
||||||
export const devToolsEnhancer: (options?: EnhancerOptions) => StoreEnhancer =
|
export const devToolsEnhancer: (options?: EnhancerOptions) => StoreEnhancer =
|
||||||
process.env.NODE_ENV === 'production'
|
process.env.NODE_ENV === 'production'
|
||||||
? logOnly.devToolsEnhancer
|
? logOnly.devToolsEnhancer
|
||||||
: typeof window !== 'undefined' && window.__REDUX_DEVTOOLS_EXTENSION__
|
: typeof window !== 'undefined' && window.__REDUX_DEVTOOLS_EXTENSION__
|
||||||
? window.__REDUX_DEVTOOLS_EXTENSION__
|
? window.__REDUX_DEVTOOLS_EXTENSION__
|
||||||
: function () {
|
: function () {
|
||||||
return function (noop) {
|
return function (noop) {
|
||||||
return noop;
|
return noop;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
|
||||||
|
|
|
@ -173,10 +173,10 @@ export const rootReducer: Reducer<DemoAppState, DemoAppAction> =
|
||||||
action.type === 'PUSH'
|
action.type === 'PUSH'
|
||||||
? [...state, Math.random()]
|
? [...state, Math.random()]
|
||||||
: action.type === 'POP'
|
: action.type === 'POP'
|
||||||
? state.slice(0, state.length - 1)
|
? state.slice(0, state.length - 1)
|
||||||
: action.type === 'REPLACE'
|
: action.type === 'REPLACE'
|
||||||
? [Math.random(), ...state.slice(1)]
|
? [Math.random(), ...state.slice(1)]
|
||||||
: state,
|
: state,
|
||||||
hugeArrays: (state = [], action) =>
|
hugeArrays: (state = [], action) =>
|
||||||
action.type === 'PUSH_HUGE_ARRAY' ? [...state, ...HUGE_ARRAY] : state,
|
action.type === 'PUSH_HUGE_ARRAY' ? [...state, ...HUGE_ARRAY] : state,
|
||||||
hugeObjects: (state = [], action) =>
|
hugeObjects: (state = [], action) =>
|
||||||
|
|
|
@ -203,10 +203,10 @@ export const rootReducer: Reducer<DemoAppState, DemoAppAction> =
|
||||||
action.type === 'PUSH'
|
action.type === 'PUSH'
|
||||||
? [...state, Math.random()]
|
? [...state, Math.random()]
|
||||||
: action.type === 'POP'
|
: action.type === 'POP'
|
||||||
? state.slice(0, state.length - 1)
|
? state.slice(0, state.length - 1)
|
||||||
: action.type === 'REPLACE'
|
: action.type === 'REPLACE'
|
||||||
? [Math.random(), ...state.slice(1)]
|
? [Math.random(), ...state.slice(1)]
|
||||||
: state,
|
: state,
|
||||||
hugeArrays: (state = [], action) =>
|
hugeArrays: (state = [], action) =>
|
||||||
action.type === 'PUSH_HUGE_ARRAY' ? [...state, ...HUGE_ARRAY] : state,
|
action.type === 'PUSH_HUGE_ARRAY' ? [...state, ...HUGE_ARRAY] : state,
|
||||||
hugeObjects: (state = [], action) =>
|
hugeObjects: (state = [], action) =>
|
||||||
|
|
|
@ -127,8 +127,8 @@ export default function ActionList<A extends Action<string>>({
|
||||||
overIndex < activeIndex
|
overIndex < activeIndex
|
||||||
? (over.id as number)
|
? (over.id as number)
|
||||||
: overIndex < actionIds.length - 1
|
: overIndex < actionIds.length - 1
|
||||||
? actionIds[overIndex + 1]
|
? actionIds[overIndex + 1]
|
||||||
: actionIds.length;
|
: actionIds.length;
|
||||||
|
|
||||||
onReorderAction(active.id as number, beforeActionId);
|
onReorderAction(active.id as number, beforeActionId);
|
||||||
}
|
}
|
||||||
|
|
|
@ -113,8 +113,8 @@ class ActionPreview<S, A extends Action<string>> extends Component<
|
||||||
typeof tabs === 'function'
|
typeof tabs === 'function'
|
||||||
? tabs(DEFAULT_TABS as Tab<S, A>[])
|
? tabs(DEFAULT_TABS as Tab<S, A>[])
|
||||||
: tabs
|
: tabs
|
||||||
? tabs
|
? tabs
|
||||||
: (DEFAULT_TABS as Tab<S, A>[]);
|
: (DEFAULT_TABS as Tab<S, A>[]);
|
||||||
|
|
||||||
const { component: TabComponent } =
|
const { component: TabComponent } =
|
||||||
renderedTabs.find((tab) => tab.name === tabName) ||
|
renderedTabs.find((tab) => tab.name === tabName) ||
|
||||||
|
|
|
@ -41,8 +41,8 @@ function str2array(
|
||||||
return typeof str === 'string'
|
return typeof str === 'string'
|
||||||
? [str]
|
? [str]
|
||||||
: str && str.length > 0
|
: str && str.length > 0
|
||||||
? str
|
? str
|
||||||
: undefined;
|
: undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getRandomId() {
|
function getRandomId() {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user