stacktracey
Advanced tools
Comparing version
{ | ||
"name": "stacktracey", | ||
"version": "1.0.32", | ||
"version": "1.0.33", | ||
"description": "Parses call stacks, reads sources and meta-information.", | ||
@@ -5,0 +5,0 @@ "main": "stacktracey", |
@@ -108,6 +108,15 @@ # StackTracey | ||
You can augment `isThirdParty` predicate with new rules: | ||
```javascript | ||
StackTracey.isThirdParty.include (path => path.includes ('my-lib')) // my-lib paths will be marked as thirdParty | ||
``` | ||
```javascript | ||
StackTracey.isThirdParty.except (path => path.includes ('jquery')) // jquery paths won't be marked as thirdParty | ||
``` | ||
You can add exceptions to the `isThirdParty` predicate: | ||
```javascript | ||
StackTracey.isThirdParty.except (path => path.includes ('jquery')) // jquery paths won't be marked as thirdParty | ||
``` | ||
@@ -114,0 +123,0 @@ |
@@ -171,10 +171,23 @@ "use strict"; | ||
StackTracey.isThirdParty.except = pred => { | ||
(() => { | ||
const impl = StackTracey.isThirdParty | ||
const methods = { | ||
StackTracey.isThirdParty = path => impl (path) && !pred (path) | ||
StackTracey.isThirdParty.except = impl.except | ||
} | ||
include (pred) { | ||
const f = StackTracey.isThirdParty | ||
O.assign (StackTracey.isThirdParty = (path => f (path) || pred (path)), methods) | ||
}, | ||
except (pred) { | ||
const f = StackTracey.isThirdParty | ||
O.assign (StackTracey.isThirdParty = (path => f (path) && !pred (path)), methods) | ||
}, | ||
} | ||
O.assign (StackTracey.isThirdParty, methods) | ||
}) () | ||
/* Array methods | ||
@@ -181,0 +194,0 @@ ------------------------------------------------------------------------ */ |
20979
2.19%276
2.99%159
6%