@sentry/utils
Advanced tools
Comparing version 5.1.2 to 5.2.0-beta.0
@@ -27,2 +27,8 @@ /** | ||
export declare function keysToEventMessage(keys: string[], maxLength?: number): string; | ||
/** | ||
* Checks if the value matches a regex or includes the string | ||
* @param value The string value to be checked against | ||
* @param pattern Either a regex or a string that must be contained in value | ||
*/ | ||
export declare function isMatchingPattern(value: string, pattern: RegExp | string): boolean; | ||
//# sourceMappingURL=string.d.ts.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var is_1 = require("./is"); | ||
/** | ||
@@ -102,2 +103,17 @@ * Truncates given string to the maximum characters count | ||
exports.keysToEventMessage = keysToEventMessage; | ||
/** | ||
* Checks if the value matches a regex or includes the string | ||
* @param value The string value to be checked against | ||
* @param pattern Either a regex or a string that must be contained in value | ||
*/ | ||
function isMatchingPattern(value, pattern) { | ||
if (is_1.isRegExp(pattern)) { | ||
return pattern.test(value); | ||
} | ||
if (typeof pattern === 'string') { | ||
return value.includes(pattern); | ||
} | ||
return false; | ||
} | ||
exports.isMatchingPattern = isMatchingPattern; | ||
//# sourceMappingURL=string.js.map |
@@ -30,3 +30,3 @@ declare type HandlerOnSuccess<T, U = any> = (value: T) => U | Thenable<U>; | ||
/** JSDoc */ | ||
then<TResult1 = T, TResult2 = never>(onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null): SyncPromise<TResult1 | TResult2>; | ||
then<TResult1 = T, TResult2 = never>(onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined): SyncPromise<TResult1 | TResult2>; | ||
/** JSDoc */ | ||
@@ -33,0 +33,0 @@ catch<U>(onFail: HandlerOnFail<U>): SyncPromise<U>; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var is_1 = require("./is"); | ||
/** JSDoc */ | ||
/** SyncPromise internal states */ | ||
var States; | ||
(function (States) { | ||
/** JSDoc */ | ||
States["PENDING"] = "PENDING"; | ||
/** JSDoc */ | ||
States["RESOLVED"] = "RESOLVED"; | ||
/** JSDoc */ | ||
States["REJECTED"] = "REJECTED"; | ||
/** Pending */ | ||
States["P"] = "P"; | ||
/** Resolved / OK */ | ||
States["O"] = "O"; | ||
/** Rejected / Error */ | ||
States["E"] = "E"; | ||
})(States || (States = {})); | ||
@@ -19,3 +19,3 @@ /** JSDoc */ | ||
/** JSDoc */ | ||
this._state = States.PENDING; | ||
this._state = States.P; | ||
/** JSDoc */ | ||
@@ -25,11 +25,11 @@ this._handlers = []; | ||
this._resolve = function (value) { | ||
_this._setResult(value, States.RESOLVED); | ||
_this._setResult(value, States.O); | ||
}; | ||
/** JSDoc */ | ||
this._reject = function (reason) { | ||
_this._setResult(reason, States.REJECTED); | ||
_this._setResult(reason, States.E); | ||
}; | ||
/** JSDoc */ | ||
this._setResult = function (value, state) { | ||
if (_this._state !== States.PENDING) { | ||
if (_this._state !== States.P) { | ||
return; | ||
@@ -47,6 +47,6 @@ } | ||
this._executeHandlers = function () { | ||
if (_this._state === States.PENDING) { | ||
if (_this._state === States.P) { | ||
return; | ||
} | ||
if (_this._state === States.REJECTED) { | ||
if (_this._state === States.E) { | ||
// tslint:disable-next-line:no-unsafe-any | ||
@@ -53,0 +53,0 @@ _this._handlers.forEach(function (h) { return h.onFail && h.onFail(_this._value); }); |
@@ -27,2 +27,8 @@ /** | ||
export declare function keysToEventMessage(keys: string[], maxLength?: number): string; | ||
/** | ||
* Checks if the value matches a regex or includes the string | ||
* @param value The string value to be checked against | ||
* @param pattern Either a regex or a string that must be contained in value | ||
*/ | ||
export declare function isMatchingPattern(value: string, pattern: RegExp | string): boolean; | ||
//# sourceMappingURL=string.d.ts.map |
@@ -0,1 +1,2 @@ | ||
import { isRegExp } from './is'; | ||
/** | ||
@@ -96,2 +97,16 @@ * Truncates given string to the maximum characters count | ||
} | ||
/** | ||
* Checks if the value matches a regex or includes the string | ||
* @param value The string value to be checked against | ||
* @param pattern Either a regex or a string that must be contained in value | ||
*/ | ||
export function isMatchingPattern(value, pattern) { | ||
if (isRegExp(pattern)) { | ||
return pattern.test(value); | ||
} | ||
if (typeof pattern === 'string') { | ||
return value.includes(pattern); | ||
} | ||
return false; | ||
} | ||
//# sourceMappingURL=string.js.map |
@@ -30,3 +30,3 @@ declare type HandlerOnSuccess<T, U = any> = (value: T) => U | Thenable<U>; | ||
/** JSDoc */ | ||
then<TResult1 = T, TResult2 = never>(onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null): SyncPromise<TResult1 | TResult2>; | ||
then<TResult1 = T, TResult2 = never>(onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined): SyncPromise<TResult1 | TResult2>; | ||
/** JSDoc */ | ||
@@ -33,0 +33,0 @@ catch<U>(onFail: HandlerOnFail<U>): SyncPromise<U>; |
import { isThenable } from './is'; | ||
/** JSDoc */ | ||
/** SyncPromise internal states */ | ||
var States; | ||
(function (States) { | ||
/** JSDoc */ | ||
States["PENDING"] = "PENDING"; | ||
/** JSDoc */ | ||
States["RESOLVED"] = "RESOLVED"; | ||
/** JSDoc */ | ||
States["REJECTED"] = "REJECTED"; | ||
/** Pending */ | ||
States["P"] = "P"; | ||
/** Resolved / OK */ | ||
States["O"] = "O"; | ||
/** Rejected / Error */ | ||
States["E"] = "E"; | ||
})(States || (States = {})); | ||
@@ -17,3 +17,3 @@ /** JSDoc */ | ||
/** JSDoc */ | ||
this._state = States.PENDING; | ||
this._state = States.P; | ||
/** JSDoc */ | ||
@@ -23,11 +23,11 @@ this._handlers = []; | ||
this._resolve = function (value) { | ||
_this._setResult(value, States.RESOLVED); | ||
_this._setResult(value, States.O); | ||
}; | ||
/** JSDoc */ | ||
this._reject = function (reason) { | ||
_this._setResult(reason, States.REJECTED); | ||
_this._setResult(reason, States.E); | ||
}; | ||
/** JSDoc */ | ||
this._setResult = function (value, state) { | ||
if (_this._state !== States.PENDING) { | ||
if (_this._state !== States.P) { | ||
return; | ||
@@ -45,6 +45,6 @@ } | ||
this._executeHandlers = function () { | ||
if (_this._state === States.PENDING) { | ||
if (_this._state === States.P) { | ||
return; | ||
} | ||
if (_this._state === States.REJECTED) { | ||
if (_this._state === States.E) { | ||
// tslint:disable-next-line:no-unsafe-any | ||
@@ -51,0 +51,0 @@ _this._handlers.forEach(function (h) { return h.onFail && h.onFail(_this._value); }); |
{ | ||
"name": "@sentry/utils", | ||
"version": "5.1.2", | ||
"version": "5.2.0-beta.0", | ||
"description": "Utilities for all Sentry JavaScript SDKs", | ||
@@ -19,3 +19,3 @@ "repository": "git://github.com/getsentry/sentry-javascript.git", | ||
"dependencies": { | ||
"@sentry/types": "5.1.0", | ||
"@sentry/types": "5.2.0-beta.0", | ||
"tslib": "^1.9.3" | ||
@@ -25,9 +25,9 @@ }, | ||
"chai": "^4.1.2", | ||
"jest": "^24.5.0", | ||
"jest": "^24.7.1", | ||
"npm-run-all": "^4.1.2", | ||
"prettier": "^1.16.4", | ||
"prettier": "^1.17.0", | ||
"prettier-check": "^2.0.0", | ||
"rimraf": "^2.6.3", | ||
"tslint": "^5.14.0", | ||
"typescript": "^3.3.3333" | ||
"tslint": "^5.16.0", | ||
"typescript": "^3.4.5" | ||
}, | ||
@@ -34,0 +34,0 @@ "scripts": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
273790
3562
1
+ Added@sentry/types@5.2.0-beta.0(transitive)
- Removed@sentry/types@5.1.0(transitive)
Updated@sentry/types@5.2.0-beta.0