hissssst / pathex

Fastest tool to access data in Elixir
BSD 2-Clause "Simplified" License
337 stars 17 forks source link

path(y :: :list, :json) #28

Closed hissssst closed 1 year ago

hissssst commented 1 year ago
iex> path(y :: :list, :json)
** (FunctionClauseError) no function clause matching in Pathex.Builder.ForceUpdater.reduce_into/2

    The following arguments were given to Pathex.Builder.ForceUpdater.reduce_into/2:

        # 1
        []

        # 2
        {{:|>, [context: Pathex.Builder.ForceUpdater, imports: [{2, Kernel}]],
          [
            {{:., [], [{:function, [], Elixir}]}, [], []},
            {:case, [],
             [
               [
                 do: [
                   {:->, [],
                    [
                      [ok: {:value, [], Pathex.Builder.ForceUpdater}],
                      {:value, [], Pathex.Builder.ForceUpdater}
                    ]},
                   {:->, [],
                    [
                      [:error],
                      {:throw,
                       [context: Pathex.Builder.ForceUpdater, imports: [{1, Kernel}]],
                       [:path_not_found]}
                    ]}
                 ]
               ]
             ]}
          ]}, {:default, [], Elixir}}

    Attempted function clauses (showing 1 out of 1):

        defp reduce_into([path_item | _] = path_items, {acc_code, acc_items})

    (pathex 2.5.1) lib/pathex/builder/updaters/force_updater.ex:26: Pathex.Builder.ForceUpdater.reduce_into/2
    (elixir 1.14.3) lib/enum.ex:2468: Enum."-reduce/3-lists^foldl/2-0-"/3
    (pathex 2.5.1) lib/pathex/builder/updaters/force_updater.ex:21: Pathex.Builder.ForceUpdater.build/1
    (pathex 2.5.1) lib/pathex/builder.ex:47: anonymous fn/2 in Pathex.Builder.build/2
    (elixir 1.14.3) lib/enum.ex:1662: anonymous fn/3 in Enum.map/2
    (stdlib 4.2) maps.erl:411: :maps.fold_1/3
    (elixir 1.14.3) lib/enum.ex:2480: Enum.map/2
    (pathex 2.5.1) lib/pathex/builder.ex:46: Pathex.Builder.build/2