MCPcopy Create free account
hub / github.com/babel/babel / t

Function t

Makefile.js:28–28  ·  view source on GitHub ↗
(n,i,s)

Source from the content-addressed store, hash-verified

26 * Copyright (c) 2015-present, Jon Schlinkert.
27 * Released under the MIT License.
28 */function et(){if($e)return Ne;$e=1;const e=Je(),t=(n,i,s)=>{if(!1===e(n))throw new TypeError("toRegexRange: expected the first argument to be a number");if(void 0===i||n===i)return String(n);if(!1===e(i))throw new TypeError("toRegexRange: expected the second argument to be a number.");let a={relaxZeros:!0,...s};"boolean"==typeof a.strictZeros&&(a.relaxZeros=!1===a.strictZeros);let c=n+":"+i+"="+String(a.relaxZeros)+String(a.shorthand)+String(a.capture)+String(a.wrap);if(t.cache.hasOwnProperty(c))return t.cache[c].result;let l=Math.min(n,i),u=Math.max(n,i);if(1===Math.abs(l-u)){let e=n+"|"+i;return a.capture?`(${e})`:!1===a.wrap?e:`(?:${e})`}let p=d(n)||d(i),f={min:n,max:i,a:l,b:u},m=[],h=[];if(p&&(f.isPadded=p,f.maxLen=String(f.max).length),l<0){h=r(u<0?Math.abs(u):1,Math.abs(l),f,a),l=f.a=0}return u>=0&&(m=r(l,u,f,a)),f.negatives=h,f.positives=m,f.result=function(e,t){let n=o(e,t,"-",!1)||[],r=o(t,e,"",!1)||[],i=o(e,t,"-?",!0)||[];return n.concat(i).concat(r).join("|")}(h,m),!0===a.capture?f.result=`(${f.result})`:!1!==a.wrap&&m.length+h.length>1&&(f.result=`(?:${f.result})`),t.cache[c]=f,f.result};function n(e,t,n){if(e===t)return{pattern:e,count:[],digits:0};let r=function(e,t){let n=[];for(let r=0;r<e.length;r++)n.push([e[r],t[r]]);return n}(e,t),o=r.length,i="",s=0;for(let e=0;e<o;e++){let[t,n]=r[e];t===n?i+=t:"0"!==t||"9"!==n?i+=u(t,n):s++}return s&&(i+=!0===n.shorthand?"\\d":"[0-9]"),{pattern:i,count:[s],digits:o}}function r(e,t,r,o){let s,u=function(e,t){let n=1,r=1,o=a(e,n),s=new Set([t]);for(;e<=o&&o<=t;)s.add(o),n+=1,o=a(e,n);for(o=c(t+1,r)-1;e<o&&o<=t;)s.add(o),r+=1,o=c(t+1,r)-1;return s=[...s],s.sort(i),s}(e,t),d=[],f=e;for(let e=0;e<u.length;e++){let t=u[e],i=n(String(f),String(t),o),a="";r.isPadded||!s||s.pattern!==i.pattern?(r.isPadded&&(a=p(t,r,o)),i.string=a+i.pattern+l(i.count),d.push(i),f=t+1,s=i):(s.count.length>1&&s.count.pop(),s.count.push(i.count[0]),s.string=s.pattern+l(s.count),f=t+1)}return d}function o(e,t,n,r,o){let i=[];for(let o of e){let{string:e}=o;r||s(t,"string",e)||i.push(n+e),r&&s(t,"string",e)&&i.push(n+e)}return i}function i(e,t){return e>t?1:t>e?-1:0}function s(e,t,n){return e.some(e=>e[t]===n)}function a(e,t){return Number(String(e).slice(0,-t)+"9".repeat(t))}function c(e,t){return e-e%Math.pow(10,t)}function l(e){let[t=0,n=""]=e;return n||t>1?`{${t+(n?","+n:"")}}`:""}function u(e,t,n){return`[${e}${t-e===1?"":"-"}${t}]`}function d(e){return/^-?(0+)\d/.test(e)}function p(e,t,n){if(!t.isPadded)return e;let r=Math.abs(t.maxLen-String(e).length),o=!1!==n.relaxZeros;switch(r){case 0:return"";case 1:return o?"0?":"0";case 2:return o?"0{0,2}":"00";default:return o?`0{0,${r}}`:`0{${r}}`}}return t.cache={},t.clearCache=()=>t.cache={},Ne=t}
29/*!
30 * fill-range <https://github.com/jonschlinkert/fill-range>
31 *

Callers 15

peFunction · 0.70
keFunction · 0.70
lFunction · 0.70
uFunction · 0.70
aFunction · 0.70
rtFunction · 0.70
oFunction · 0.70
EtFunction · 0.70
xtFunction · 0.70
MtFunction · 0.70
KtFunction · 0.70
iFunction · 0.70

Calls 15

removeListenerMethod · 0.80
releaseMethod · 0.80
mapMethod · 0.80
eFunction · 0.70
dFunction · 0.70
rFunction · 0.70
oFunction · 0.70
nFunction · 0.70
pFunction · 0.70
uFunction · 0.70
getMethod · 0.65
callMethod · 0.65

Tested by

no test coverage detected