@extra-array/insert.min
Version:
Inserts a value to an ordered array.
1 lines • 1.1 kB
JavaScript
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).array_insert=e()}}(function(){return function(){return function e(n,r,t){function o(i,u){if(!r[i]){if(!n[i]){var c="function"==typeof require&&require;if(!u&&c)return c(i,!0);if(f)return f(i,!0);var d=new Error("Cannot find module '"+i+"'");throw d.code="MODULE_NOT_FOUND",d}var p=r[i]={exports:{}};n[i][0].call(p.exports,function(e){return o(n[i][1][e]||e)},p,p.exports,e,n,r,t)}return r[i].exports}for(var f="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}}()({1:[function(e,n,r){n.exports=function(e,n){return e<n?-1:e>n?1:0}},{}],2:[function(e,n,r){const t=e("./insert$");n.exports=function(e,n,r){return t(Array.from(e),n,r)}},{"./insert$":3}],3:[function(e,n,r){const t=e("./_cmp");n.exports=function(e,n,r){r=r||t;var o=e.findIndex(e=>r(e,n)>0);return e.splice(o>=0?o:e.length,0,n),e}},{"./_cmp":1}]},{},[2])(2)});