Skip to content

Commit

Permalink
Merge branch 'main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
nikmantulenko committed Apr 27, 2023
2 parents e0356b1 + 9fe34b4 commit 3b84583
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 19 deletions.
3 changes: 1 addition & 2 deletions packages/core/src/StaticNavigation.tsx
@@ -1,7 +1,6 @@
import type { NavigationState, ParamListBase } from '@react-navigation/routers';
import * as React from 'react';

import { fromEntries } from './fromEntries';
import type {
DefaultNavigatorOptions,
EventMapBase,
Expand Down Expand Up @@ -369,7 +368,7 @@ export function createPathConfigForStaticNavigation(tree: {
>;
};
}) {
return fromEntries(
return Object.fromEntries(
Object.entries(tree.config.screens)
.map(([key, item]) => {
const screenConfig: PathConfig<ParamListBase> = {};
Expand Down
11 changes: 0 additions & 11 deletions packages/core/src/fromEntries.tsx

This file was deleted.

5 changes: 2 additions & 3 deletions packages/core/src/getPathFromState.tsx
Expand Up @@ -5,7 +5,6 @@ import type {
} from '@react-navigation/routers';
import * as queryString from 'query-string';

import { fromEntries } from './fromEntries';
import type { PathConfig, PathConfigMap } from './types';
import { validatePathConfig } from './validatePathConfig';

Expand Down Expand Up @@ -116,7 +115,7 @@ export function getPathFromState<ParamList extends {}>(
if (route.params) {
const stringify = currentOptions[route.name]?.stringify;

const currentParams = fromEntries(
const currentParams = Object.fromEntries(
Object.entries(route.params).map(([key, value]) => [
key,
stringify?.[key] ? stringify[key](value) : String(value),
Expand Down Expand Up @@ -294,7 +293,7 @@ const createNormalizedConfigs = (
options: PathConfigMap<object>,
pattern?: string
): Record<string, ConfigItem> =>
fromEntries(
Object.fromEntries(
Object.entries(options).map(([name, c]) => {
const result = createConfigItem(c, pattern);

Expand Down
4 changes: 1 addition & 3 deletions packages/core/src/validatePathConfig.tsx
@@ -1,5 +1,3 @@
import { fromEntries } from './fromEntries';

const formatToList = (items: Record<string, string>) =>
Object.entries(items)
.map(([key, value]) => `- ${key} (${value})`)
Expand Down Expand Up @@ -27,7 +25,7 @@ export function validatePathConfig(config: unknown, root = true) {
);
}

const validationErrors = fromEntries(
const validationErrors = Object.fromEntries(
Object.keys(config)
.map((key) => {
if (key in validation) {
Expand Down

0 comments on commit 3b84583

Please sign in to comment.