ensure-start
Version:
Ensures that a string or an array starts with specified value.
6 lines • 17.4 kB
JavaScript
/*!
*** ensure-start 1.0.6
*** Copyright © 2019, Jaid <jaid.jsx@gmail.com> (https://github.com/Jaid)
*** See https://github.com/Jaid/ensure-start#readme
!*/
var t,e;t=this,e=function(){return function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=24)}([function(t,e,r){var n=r(12),o="object"==typeof self&&self&&self.Object===Object&&self,i=n||o||Function("return this")();t.exports=i},function(t,e,r){var n=r(46),o=r(49);t.exports=function(t,e){var r=o(t,e);return n(r)?r:void 0}},function(t,e,r){var n=r(9),o=r(31),i=r(32),u="[object Null]",c="[object Undefined]",a=n?n.toStringTag:void 0;t.exports=function(t){return null==t?void 0===t?c:u:a&&a in Object(t)?o(t):i(t)}},function(t,e){t.exports=function(t){return null!=t&&"object"==typeof t}},function(t,e,r){var n=r(36),o=r(37),i=r(38),u=r(39),c=r(40);function a(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}a.prototype.clear=n,a.prototype.delete=o,a.prototype.get=i,a.prototype.has=u,a.prototype.set=c,t.exports=a},function(t,e,r){var n=r(13);t.exports=function(t,e){for(var r=t.length;r--;)if(n(t[r][0],e))return r;return-1}},function(t,e,r){var n=r(1)(Object,"create");t.exports=n},function(t,e,r){var n=r(58);t.exports=function(t,e){var r=t.__data__;return n(e)?r["string"==typeof e?"string":"hash"]:r.map}},function(t,e){t.exports=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}},function(t,e,r){var n=r(0).Symbol;t.exports=n},function(t,e,r){var n=r(1)(r(0),"Map");t.exports=n},function(t,e){var r=Array.isArray;t.exports=r},function(t,e,r){(function(e){var r="object"==typeof e&&e&&e.Object===Object&&e;t.exports=r}).call(this,r(30))},function(t,e){t.exports=function(t,e){return t===e||t!=t&&e!=e}},function(t,e,r){var n=r(2),o=r(8),i="[object AsyncFunction]",u="[object Function]",c="[object GeneratorFunction]",a="[object Proxy]";t.exports=function(t){if(!o(t))return!1;var e=n(t);return e==u||e==c||e==i||e==a}},function(t,e){var r=Function.prototype.toString;t.exports=function(t){if(null!=t){try{return r.call(t)}catch(t){}try{return t+""}catch(t){}}return""}},function(t,e,r){var n=r(50),o=r(57),i=r(59),u=r(60),c=r(61);function a(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}a.prototype.clear=n,a.prototype.delete=o,a.prototype.get=i,a.prototype.has=u,a.prototype.set=c,t.exports=a},function(t,e,r){var n=r(62),o=r(65),i=r(66),u=1,c=2;t.exports=function(t,e,r,a,f,s){var p=r&u,l=t.length,v=e.length;if(!(l==v||p&&v>l))return!1;var y=s.get(t);if(y&&s.get(e))return y==e;var b=-1,h=!0,_=r&c?new n:void 0;for(s.set(t,e),s.set(e,t);++b<l;){var d=t[b],x=e[b];if(a)var j=p?a(x,d,b,e,t,s):a(d,x,b,t,e,s);if(void 0!==j){if(j)continue;h=!1;break}if(_){if(!o(e,(function(t,e){if(!i(_,e)&&(d===t||f(d,t,r,a,s)))return _.push(e)}))){h=!1;break}}else if(d!==x&&!f(d,x,r,a,s)){h=!1;break}}return s.delete(t),s.delete(e),h}},function(t,e,r){(function(t){var n=r(0),o=r(83),i=e&&!e.nodeType&&e,u=i&&"object"==typeof t&&t&&!t.nodeType&&t,c=u&&u.exports===i?n.Buffer:void 0,a=(c?c.isBuffer:void 0)||o;t.exports=a}).call(this,r(19)(t))},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e,r){var n=r(85),o=r(86),i=r(87),u=i&&i.isTypedArray,c=u?o(u):n;t.exports=c},function(t,e){var r=9007199254740991;t.exports=function(t){return"number"==typeof t&&t>-1&&t%1==0&&r>=t}},function(t,e,r){var n=r(25),o=r(26);t.exports=function(t,e,r){return t&&t.length?(e=r||void 0===e?1:o(e),n(t,0,0>e?0:e)):[]}},function(t,e,r){var n=r(33);t.exports=function(t,e){return n(t,e)}},function(t,e,r){r.r(e);var n=r(22),o=r.n(n),i=r(23),u=r.n(i);e.default=(t,e)=>"string"==typeof t?t.startsWith(e)?t:`${e}${t}`:Array.isArray(t)?(Array.isArray(e)||(e=[e]),u()(o()(t,e.length),e)?t:[...e,...t]):t},function(t,e){t.exports=function(t,e,r){var n=-1,o=t.length;0>e&&(e=-e>o?0:o+e),0>(r=r>o?o:r)&&(r+=o),o=e>r?0:r-e>>>0,e>>>=0;for(var i=Array(o);++n<o;)i[n]=t[n+e];return i}},function(t,e,r){var n=r(27);t.exports=function(t){var e=n(t),r=e%1;return e==e?r?e-r:e:0}},function(t,e,r){var n=r(28),o=1/0,i=17976931348623157e292;t.exports=function(t){return t?(t=n(t))===o||t===-o?(0>t?-1:1)*i:t==t?t:0:0===t?t:0}},function(t,e,r){var n=r(8),o=r(29),i=NaN,u=/^\s+|\s+$/g,c=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,f=/^0o[0-7]+$/i,s=parseInt;t.exports=function(t){if("number"==typeof t)return t;if(o(t))return i;if(n(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=n(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(u,"");var r=a.test(t);return r||f.test(t)?s(t.slice(2),r?2:8):c.test(t)?i:+t}},function(t,e,r){var n=r(2),o=r(3),i="[object Symbol]";t.exports=function(t){return"symbol"==typeof t||o(t)&&n(t)==i}},function(t,e){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(t){"object"==typeof window&&(r=window)}t.exports=r},function(t,e,r){var n=r(9),o=Object.prototype,i=o.hasOwnProperty,u=o.toString,c=n?n.toStringTag:void 0;t.exports=function(t){var e=i.call(t,c),r=t[c];try{t[c]=void 0;var n=!0}catch(t){}var o=u.call(t);return n&&(e?t[c]=r:delete t[c]),o}},function(t,e){var r=Object.prototype.toString;t.exports=function(t){return r.call(t)}},function(t,e,r){var n=r(34),o=r(3);t.exports=function t(e,r,i,u,c){return e===r||(null==e||null==r||!o(e)&&!o(r)?e!=e&&r!=r:n(e,r,i,u,t,c))}},function(t,e,r){var n=r(35),o=r(17),i=r(67),u=r(71),c=r(93),a=r(11),f=r(18),s=r(20),p=1,l="[object Arguments]",v="[object Array]",y="[object Object]",b=Object.prototype.hasOwnProperty;t.exports=function(t,e,r,h,_,d){var x=a(t),j=a(e),g=x?v:c(t),O=j?v:c(e),w=(g=g==l?y:g)==y,m=(O=O==l?y:O)==y,A=g==O;if(A&&f(t)){if(!f(e))return!1;x=!0,w=!1}if(A&&!w)return d||(d=new n),x||s(t)?o(t,e,r,h,_,d):i(t,e,g,r,h,_,d);if(!(r&p)){var S=w&&b.call(t,"__wrapped__"),P=m&&b.call(e,"__wrapped__");if(S||P){var z=S?t.value():t,k=P?e.value():e;return d||(d=new n),_(z,k,r,h,d)}}return!!A&&(d||(d=new n),u(t,e,r,h,_,d))}},function(t,e,r){var n=r(4),o=r(41),i=r(42),u=r(43),c=r(44),a=r(45);function f(t){var e=this.__data__=new n(t);this.size=e.size}f.prototype.clear=o,f.prototype.delete=i,f.prototype.get=u,f.prototype.has=c,f.prototype.set=a,t.exports=f},function(t,e){t.exports=function(){this.__data__=[],this.size=0}},function(t,e,r){var n=r(5),o=Array.prototype.splice;t.exports=function(t){var e=this.__data__,r=n(e,t);return r>=0&&(r==e.length-1?e.pop():o.call(e,r,1),--this.size,!0)}},function(t,e,r){var n=r(5);t.exports=function(t){var e=this.__data__,r=n(e,t);return 0>r?void 0:e[r][1]}},function(t,e,r){var n=r(5);t.exports=function(t){return n(this.__data__,t)>-1}},function(t,e,r){var n=r(5);t.exports=function(t,e){var r=this.__data__,o=n(r,t);return 0>o?(++this.size,r.push([t,e])):r[o][1]=e,this}},function(t,e,r){var n=r(4);t.exports=function(){this.__data__=new n,this.size=0}},function(t,e){t.exports=function(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}},function(t,e){t.exports=function(t){return this.__data__.get(t)}},function(t,e){t.exports=function(t){return this.__data__.has(t)}},function(t,e,r){var n=r(4),o=r(10),i=r(16),u=200;t.exports=function(t,e){var r=this.__data__;if(r instanceof n){var c=r.__data__;if(!o||c.length<u-1)return c.push([t,e]),this.size=++r.size,this;r=this.__data__=new i(c)}return r.set(t,e),this.size=r.size,this}},function(t,e,r){var n=r(14),o=r(47),i=r(8),u=r(15),c=/^\[object .+?Constructor\]$/,a=Function.prototype,f=Object.prototype,s=a.toString,p=f.hasOwnProperty,l=RegExp("^"+s.call(p).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");t.exports=function(t){return!(!i(t)||o(t))&&(n(t)?l:c).test(u(t))}},function(t,e,r){var n,o=r(48),i=(n=/[^.]+$/.exec(o&&o.keys&&o.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"";t.exports=function(t){return!!i&&i in t}},function(t,e,r){var n=r(0)["__core-js_shared__"];t.exports=n},function(t,e){t.exports=function(t,e){return null==t?void 0:t[e]}},function(t,e,r){var n=r(51),o=r(4),i=r(10);t.exports=function(){this.size=0,this.__data__={hash:new n,map:new(i||o),string:new n}}},function(t,e,r){var n=r(52),o=r(53),i=r(54),u=r(55),c=r(56);function a(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}a.prototype.clear=n,a.prototype.delete=o,a.prototype.get=i,a.prototype.has=u,a.prototype.set=c,t.exports=a},function(t,e,r){var n=r(6);t.exports=function(){this.__data__=n?n(null):{},this.size=0}},function(t,e){t.exports=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}},function(t,e,r){var n=r(6),o="__lodash_hash_undefined__",i=Object.prototype.hasOwnProperty;t.exports=function(t){var e=this.__data__;if(n){var r=e[t];return r===o?void 0:r}return i.call(e,t)?e[t]:void 0}},function(t,e,r){var n=r(6),o=Object.prototype.hasOwnProperty;t.exports=function(t){var e=this.__data__;return n?void 0!==e[t]:o.call(e,t)}},function(t,e,r){var n=r(6),o="__lodash_hash_undefined__";t.exports=function(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=n&&void 0===e?o:e,this}},function(t,e,r){var n=r(7);t.exports=function(t){var e=n(this,t).delete(t);return this.size-=e?1:0,e}},function(t,e){t.exports=function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t}},function(t,e,r){var n=r(7);t.exports=function(t){return n(this,t).get(t)}},function(t,e,r){var n=r(7);t.exports=function(t){return n(this,t).has(t)}},function(t,e,r){var n=r(7);t.exports=function(t,e){var r=n(this,t),o=r.size;return r.set(t,e),this.size+=r.size==o?0:1,this}},function(t,e,r){var n=r(16),o=r(63),i=r(64);function u(t){var e=-1,r=null==t?0:t.length;for(this.__data__=new n;++e<r;)this.add(t[e])}u.prototype.add=u.prototype.push=o,u.prototype.has=i,t.exports=u},function(t,e){var r="__lodash_hash_undefined__";t.exports=function(t){return this.__data__.set(t,r),this}},function(t,e){t.exports=function(t){return this.__data__.has(t)}},function(t,e){t.exports=function(t,e){for(var r=-1,n=null==t?0:t.length;++r<n;)if(e(t[r],r,t))return!0;return!1}},function(t,e){t.exports=function(t,e){return t.has(e)}},function(t,e,r){var n=r(9),o=r(68),i=r(13),u=r(17),c=r(69),a=r(70),f=1,s=2,p="[object Boolean]",l="[object Date]",v="[object Error]",y="[object Map]",b="[object Number]",h="[object RegExp]",_="[object Set]",d="[object String]",x="[object Symbol]",j="[object ArrayBuffer]",g="[object DataView]",O=n?n.prototype:void 0,w=O?O.valueOf:void 0;t.exports=function(t,e,r,n,O,m,A){switch(r){case g:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case j:return!(t.byteLength!=e.byteLength||!m(new o(t),new o(e)));case p:case l:case b:return i(+t,+e);case v:return t.name==e.name&&t.message==e.message;case h:case d:return t==e+"";case y:var S=c;case _:var P=n&f;if(S||(S=a),t.size!=e.size&&!P)return!1;var z=A.get(t);if(z)return z==e;n|=s,A.set(t,e);var k=u(S(t),S(e),n,O,m,A);return A.delete(t),k;case x:if(w)return w.call(t)==w.call(e)}return!1}},function(t,e,r){var n=r(0).Uint8Array;t.exports=n},function(t,e){t.exports=function(t){var e=-1,r=Array(t.size);return t.forEach((function(t,n){r[++e]=[n,t]})),r}},function(t,e){t.exports=function(t){var e=-1,r=Array(t.size);return t.forEach((function(t){r[++e]=t})),r}},function(t,e,r){var n=r(72),o=1,i=Object.prototype.hasOwnProperty;t.exports=function(t,e,r,u,c,a){var f=r&o,s=n(t),p=s.length;if(p!=n(e).length&&!f)return!1;for(var l=p;l--;){var v=s[l];if(!(f?v in e:i.call(e,v)))return!1}var y=a.get(t);if(y&&a.get(e))return y==e;var b=!0;a.set(t,e),a.set(e,t);for(var h=f;++l<p;){var _=t[v=s[l]],d=e[v];if(u)var x=f?u(d,_,v,e,t,a):u(_,d,v,t,e,a);if(!(void 0===x?_===d||c(_,d,r,u,a):x)){b=!1;break}h||(h="constructor"==v)}if(b&&!h){var j=t.constructor,g=e.constructor;j!=g&&"constructor"in t&&"constructor"in e&&!("function"==typeof j&&j instanceof j&&"function"==typeof g&&g instanceof g)&&(b=!1)}return a.delete(t),a.delete(e),b}},function(t,e,r){var n=r(73),o=r(75),i=r(78);t.exports=function(t){return n(t,i,o)}},function(t,e,r){var n=r(74),o=r(11);t.exports=function(t,e,r){var i=e(t);return o(t)?i:n(i,r(t))}},function(t,e){t.exports=function(t,e){for(var r=-1,n=e.length,o=t.length;++r<n;)t[o+r]=e[r];return t}},function(t,e,r){var n=r(76),o=r(77),i=Object.prototype.propertyIsEnumerable,u=Object.getOwnPropertySymbols,c=u?function(t){return null==t?[]:(t=Object(t),n(u(t),(function(e){return i.call(t,e)})))}:o;t.exports=c},function(t,e){t.exports=function(t,e){for(var r=-1,n=null==t?0:t.length,o=0,i=[];++r<n;){var u=t[r];e(u,r,t)&&(i[o++]=u)}return i}},function(t,e){t.exports=function(){return[]}},function(t,e,r){var n=r(79),o=r(88),i=r(92);t.exports=function(t){return i(t)?n(t):o(t)}},function(t,e,r){var n=r(80),o=r(81),i=r(11),u=r(18),c=r(84),a=r(20),f=Object.prototype.hasOwnProperty;t.exports=function(t,e){var r=i(t),s=!r&&o(t),p=!r&&!s&&u(t),l=!r&&!s&&!p&&a(t),v=r||s||p||l,y=v?n(t.length,String):[],b=y.length;for(var h in t)!e&&!f.call(t,h)||v&&("length"==h||p&&("offset"==h||"parent"==h)||l&&("buffer"==h||"byteLength"==h||"byteOffset"==h)||c(h,b))||y.push(h);return y}},function(t,e){t.exports=function(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}},function(t,e,r){var n=r(82),o=r(3),i=Object.prototype,u=i.hasOwnProperty,c=i.propertyIsEnumerable,a=n(function(){return arguments}())?n:function(t){return o(t)&&u.call(t,"callee")&&!c.call(t,"callee")};t.exports=a},function(t,e,r){var n=r(2),o=r(3),i="[object Arguments]";t.exports=function(t){return o(t)&&n(t)==i}},function(t,e){t.exports=function(){return!1}},function(t,e){var r=9007199254740991,n=/^(?:0|[1-9]\d*)$/;t.exports=function(t,e){var o=typeof t;return!!(e=null==e?r:e)&&("number"==o||"symbol"!=o&&n.test(t))&&t>-1&&t%1==0&&e>t}},function(t,e,r){var n=r(2),o=r(21),i=r(3),u={};u["[object Float32Array]"]=u["[object Float64Array]"]=u["[object Int8Array]"]=u["[object Int16Array]"]=u["[object Int32Array]"]=u["[object Uint8Array]"]=u["[object Uint8ClampedArray]"]=u["[object Uint16Array]"]=u["[object Uint32Array]"]=!0,u["[object Arguments]"]=u["[object Array]"]=u["[object ArrayBuffer]"]=u["[object Boolean]"]=u["[object DataView]"]=u["[object Date]"]=u["[object Error]"]=u["[object Function]"]=u["[object Map]"]=u["[object Number]"]=u["[object Object]"]=u["[object RegExp]"]=u["[object Set]"]=u["[object String]"]=u["[object WeakMap]"]=!1,t.exports=function(t){return i(t)&&o(t.length)&&!!u[n(t)]}},function(t,e){t.exports=function(t){return function(e){return t(e)}}},function(t,e,r){(function(t){var n=r(12),o=e&&!e.nodeType&&e,i=o&&"object"==typeof t&&t&&!t.nodeType&&t,u=i&&i.exports===o&&n.process,c=function(){try{var t=i&&i.require&&i.require("util").types;return t||u&&u.binding&&u.binding("util")}catch(t){}}();t.exports=c}).call(this,r(19)(t))},function(t,e,r){var n=r(89),o=r(90),i=Object.prototype.hasOwnProperty;t.exports=function(t){if(!n(t))return o(t);var e=[];for(var r in Object(t))i.call(t,r)&&"constructor"!=r&&e.push(r);return e}},function(t,e){var r=Object.prototype;t.exports=function(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||r)}},function(t,e,r){var n=r(91)(Object.keys,Object);t.exports=n},function(t,e){t.exports=function(t,e){return function(r){return t(e(r))}}},function(t,e,r){var n=r(14),o=r(21);t.exports=function(t){return null!=t&&o(t.length)&&!n(t)}},function(t,e,r){var n=r(94),o=r(10),i=r(95),u=r(96),c=r(97),a=r(2),f=r(15),s=f(n),p=f(o),l=f(i),v=f(u),y=f(c),b=a;(n&&"[object DataView]"!=b(new n(new ArrayBuffer(1)))||o&&"[object Map]"!=b(new o)||i&&"[object Promise]"!=b(i.resolve())||u&&"[object Set]"!=b(new u)||c&&"[object WeakMap]"!=b(new c))&&(b=function(t){var e=a(t),r="[object Object]"==e?t.constructor:void 0,n=r?f(r):"";if(n)switch(n){case s:return"[object DataView]";case p:return"[object Map]";case l:return"[object Promise]";case v:return"[object Set]";case y:return"[object WeakMap]"}return e}),t.exports=b},function(t,e,r){var n=r(1)(r(0),"DataView");t.exports=n},function(t,e,r){var n=r(1)(r(0),"Promise");t.exports=n},function(t,e,r){var n=r(1)(r(0),"Set");t.exports=n},function(t,e,r){var n=r(1)(r(0),"WeakMap");t.exports=n}])},"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.ensureStart=e():t.ensureStart=e();