Skip to content

Commit

Permalink
Ref, rev: using Object.entries() in traverse instead of toPairs().
Browse files Browse the repository at this point in the history
  • Loading branch information
RobinTail committed Nov 15, 2024
1 parent 6d6e330 commit dfd9d72
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
5 changes: 0 additions & 5 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,6 @@ export default [
selector: "ImportDeclaration[source.value=/assert/]",
message: "assert is slow, use throw",
},
{
selector:
"CallExpression > MemberExpression[object.name='Object'][property.name='entries']",
message: "Object.entries() is 2x slower than R.toPairs()",
},
],
},
},
Expand Down
3 changes: 1 addition & 2 deletions src/routing-walker.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { toPairs } from "ramda";
import { DependsOnMethod } from "./depends-on-method";
import { AbstractEndpoint } from "./endpoint";
import { RoutingError } from "./errors";
Expand All @@ -19,7 +18,7 @@ export interface RoutingWalkerParams {
}

const makePairs = (subject: Routing, parent?: string) =>
toPairs(subject).map(([segment, item]) => {
Object.entries(subject).map(([segment, item]) => {
if (segment.includes("/")) {
throw new RoutingError(
`The entry '${segment}' must avoid having slashes — use nesting instead.`,
Expand Down

0 comments on commit dfd9d72

Please sign in to comment.