Son CV dans un terminal web en Javascript!
https://terminal-cv.gregandev.fr
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
844 B
21 lines
844 B
1 year ago
|
var uncurryThis = require('../internals/function-uncurry-this');
|
||
|
var arraySlice = require('../internals/array-slice');
|
||
|
|
||
|
var replace = uncurryThis(''.replace);
|
||
|
var split = uncurryThis(''.split);
|
||
|
var join = uncurryThis([].join);
|
||
|
|
||
|
var TEST = (function (arg) { return String(Error(arg).stack); })('zxcasd');
|
||
|
var V8_OR_CHAKRA_STACK_ENTRY = /\n\s*at [^:]*:[^\n]*/;
|
||
|
var IS_V8_OR_CHAKRA_STACK = V8_OR_CHAKRA_STACK_ENTRY.test(TEST);
|
||
|
var IS_FIREFOX_OR_SAFARI_STACK = /@[^\n]*\n/.test(TEST) && !/zxcasd/.test(TEST);
|
||
|
|
||
|
module.exports = function (stack, dropEntries) {
|
||
|
if (typeof stack != 'string') return stack;
|
||
|
if (IS_V8_OR_CHAKRA_STACK) {
|
||
|
while (dropEntries--) stack = replace(stack, V8_OR_CHAKRA_STACK_ENTRY, '');
|
||
|
} else if (IS_FIREFOX_OR_SAFARI_STACK) {
|
||
|
return join(arraySlice(split(stack, '\n'), dropEntries), '\n');
|
||
|
} return stack;
|
||
|
};
|