MCPcopy
hub / github.com/williamngan/pts / f

Function f

demo/edit/vs/editor/editor.main.js:112–112  ·  view source on GitHub ↗
(e)

Source from the content-addressed store, hash-verified

110this._tail.next=e,this._tail=e}},e.prototype.toJSON=function(){var e=[];return this.forEach(function(t,n){e.push([n,t])}),e},e.prototype.fromJSON=function(e){this.clear();for(var t=0,n=e;t<n.length;t++){var i=n[t],o=i[0],r=i[1];this.set(o,r)}},e}();t.LinkedMap=h;var p=function(e){function t(t,n){void 0===n&&(n=1);var i=e.call(this)||this;return i._limit=t,i._ratio=Math.min(Math.max(0,n),1),i}return o(t,e),Object.defineProperty(t.prototype,"limit",{get:function(){return this._limit},set:function(e){this._limit=e,this.checkTrim()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"ratio",{get:function(){return this._ratio},set:function(e){this._ratio=Math.min(Math.max(0,e),1),this.checkTrim()},enumerable:!0,configurable:!0}),t.prototype.get=function(t){return e.prototype.get.call(this,t,d.AsNew)},t.prototype.peek=function(t){return e.prototype.get.call(this,t,d.None)},t.prototype.set=function(t,n){e.prototype.set.call(this,t,n,d.AsNew),this.checkTrim()},t.prototype.checkTrim=function(){
111this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))},t}(h);t.LRUCache=p}),define(t[538],n([0,1,29]),function(e,t,n){"use strict";function i(e,t){return t instanceof RegExp?{$mid:2,source:t.source,flags:(t.global?"g":"")+(t.ignoreCase?"i":"")+(t.multiline?"m":"")}:t}function o(e,t){if(!e||t>200)return e;if("object"==typeof e){switch(e.$mid){case 1:return n.default.revive(e);case 2:return new RegExp(e.source,e.flags)}for(var i in e)Object.hasOwnProperty.call(e,i)&&(e[i]=o(e[i],t+1))}return e}Object.defineProperty(t,"__esModule",{value:!0}),t.stringify=function(e){return JSON.stringify(e,i)},t.parse=function(e){var t=JSON.parse(e);return t=o(t,0)},t.revive=o}),define(t[7],n([0,1,75]),function(e,t,n){"use strict";function i(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\[\]\(\)\#]/g,"\\$&")}function o(e,t){if(!e||!t)return e;var n=t.length;if(0===n||0===e.length)return e;for(var i=0;e.indexOf(t,i)===i;)i+=n;return e.substring(i)}function r(e,t){if(!e||!t)return e;var n=t.length,i=e.length
112;if(0===n||0===i)return e;for(var o=i,r=-1;;){if(-1===(r=e.lastIndexOf(t,o-1))||r+n!==o)break;if(0===r)return"";o=r}return e.substring(0,o)}function s(e,n,i){if(!t.canNormalize||!e)return e;var o=i.get(e);if(o)return o;var r;return r=_.test(e)?e.normalize(n):e,i.set(e,r),r}function a(e,t){return e<t?-1:e>t?1:0}function l(e){return e>=97&&e<=122}function u(e){return e>=65&&e<=90}function c(e){return l(e)||u(e)}function d(e,t,n){if(void 0===n&&(n=e.length),"string"!=typeof e||"string"!=typeof t)return!1;for(var i=0;i<n;i++){var o=e.charCodeAt(i),r=t.charCodeAt(i);if(o!==r)if(c(o)&&c(r)){var s=Math.abs(o-r);if(0!==s&&32!==s)return!1}else if(String.fromCharCode(o).toLowerCase()!==String.fromCharCode(r).toLowerCase())return!1}return!0}function h(e,t,n,i,o,r){for(;t<n&&o<r;){if(e[t]!==i[o])return!1;t+=1,o+=1}return!0}function p(e){return(e=+e)>=11904&&e<=55215||e>=63744&&e<=64255||e>=65281&&e<=65374}function f(e){return e&&e.length>0&&65279===e.charCodeAt(0)}Object.defineProperty(t,"__esModule",{value:!0}),
113t.empty="",t.isFalsyOrWhitespace=function(e){return!e||"string"!=typeof e||0===e.trim().length},t.pad=function(e,t,n){void 0===n&&(n="0");for(var i=""+e,o=[i],r=i.length;r<t;r++)o.push(n);return o.reverse().join("")};var g=/{(\d+)}/g;t.format=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return 0===t.length?e:e.replace(g,function(e,n){var i=parseInt(n,10);return isNaN(i)||i<0||i>=t.length?e:t[i]})},t.escape=function(e){return e.replace(/[<|>|&]/g,function(e){switch(e){case"<":return"&lt;";case">":return"&gt;";case"&":return"&amp;";default:return e}})},t.escapeRegExpCharacters=i,t.trim=function(e,t){return void 0===t&&(t=" "),r(o(e,t),t)},t.ltrim=o,t.rtrim=r,t.convertSimple2RegExpPattern=function(e){return e.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")},t.stripWildcards=function(e){return e.replace(/\*/g,"")},t.startsWith=function(e,t){if(e.length<t.length)return!1;if(e===t)return!0;for(var n=0;n<t.length;n++)if(e[n]!==t[n])return!1;return!0},
114t.endsWith=function(e,t){var n=e.length-t.length;return n>0?e.indexOf(t,n)===n:0===n&&e===t},t.createRegExp=function(e,t,n){if(void 0===n&&(n={}),!e)throw new Error("Cannot create regex from empty string");t||(e=i(e)),n.wholeWord&&(/\B/.test(e.charAt(0))||(e="\\b"+e),/\B/.test(e.charAt(e.length-1))||(e+="\\b"));var o="";return n.global&&(o+="g"),n.matchCase||(o+="i"),n.multiline&&(o+="m"),new RegExp(e,o)},t.regExpLeadsToEndlessLoop=function(e){return"^"!==e.source&&"^$"!==e.source&&"$"!==e.source&&"^\\s*$"!==e.source&&e.exec("")&&0===e.lastIndex},t.regExpContainsBackreference=function(e){return!!e.match(/([^\\]|^)(\\\\)*\\\d+/)},t.canNormalize="function"==typeof"".normalize;var m=new n.LRUCache(1e4);t.normalizeNFC=function(e){return s(e,"NFC",m)};var v=new n.LRUCache(1e4);t.normalizeNFD=function(e){return s(e,"NFD",v)};var _=/[^\u0000-\u0080]/;t.firstNonWhitespaceIndex=function(e){for(var t=0,n=e.length;t<n;t++){var i=e.charCodeAt(t);if(32!==i&&9!==i)return t}return-1},t.getLeadingWhitespace=function(e,t,n){
115void 0===t&&(t=0),void 0===n&&(n=e.length);for(var i=t;i<n;i++){var o=e.charCodeAt(i);if(32!==o&&9!==o)return e.substring(t,i)}return e.substring(t,n)},t.lastNonWhitespaceIndex=function(e,t){void 0===t&&(t=e.length-1);for(var n=t;n>=0;n--){var i=e.charCodeAt(n);if(32!==i&&9!==i)return n}return-1},t.compare=a,t.compareIgnoreCase=function(e,t){for(var n=Math.min(e.length,t.length),i=0;i<n;i++){var o=e.charCodeAt(i),r=t.charCodeAt(i);if(o!==r){u(o)&&(o+=32),u(r)&&(r+=32);var s=o-r;if(0!==s)return l(o)&&l(r)?s:a(e.toLowerCase(),t.toLowerCase())}}return e.length<t.length?-1:e.length>t.length?1:0},t.equalsIgnoreCase=function(e,t){return(e?e.length:0)===(t?t.length:0)&&d(e,t)},t.startsWithIgnoreCase=function(e,t){var n=t.length;return!(t.length>e.length)&&d(e,t,n)},t.commonPrefixLength=function(e,t){var n,i=Math.min(e.length,t.length);for(n=0;n<i;n++)if(e.charCodeAt(n)!==t.charCodeAt(n))return n;return i},t.commonSuffixLength=function(e,t){var n,i=Math.min(e.length,t.length),o=e.length-1,r=t.length-1

Callers 8

hFunction · 0.70
editor.main.jsFile · 0.70
lFunction · 0.70
mFunction · 0.70
_Function · 0.70
tFunction · 0.70
aFunction · 0.70
pFunction · 0.70

Calls 11

filterMethod · 0.80
mapMethod · 0.80
vFunction · 0.70
eFunction · 0.70
gFunction · 0.70
cFunction · 0.70
mFunction · 0.70
uFunction · 0.70
DFunction · 0.70
hFunction · 0.70
tFunction · 0.70

Tested by

no test coverage detected