@datadog/browser-core
Advanced tools
Comparing version 4.11.3 to 4.11.4
@@ -9,3 +9,3 @@ "use strict"; | ||
var publicApi = (0, utils_1.assign)({ | ||
version: "4.11.3", | ||
version: "4.11.4", | ||
// This API method is intentionally not monitored, since the only thing executed is the | ||
@@ -12,0 +12,0 @@ // user-provided 'callback'. All SDK usages executed in the callback should be monitored, and |
@@ -28,5 +28,5 @@ "use strict"; | ||
var parameters = 'ddsource=browser' + | ||
"&ddtags=".concat(encodeURIComponent(["sdk_version:".concat("4.11.3")].concat(tags).join(','))) + | ||
"&ddtags=".concat(encodeURIComponent(["sdk_version:".concat("4.11.4")].concat(tags).join(','))) + | ||
"&dd-api-key=".concat(clientToken) + | ||
"&dd-evp-origin-version=".concat(encodeURIComponent("4.11.3")) + | ||
"&dd-evp-origin-version=".concat(encodeURIComponent("4.11.4")) + | ||
'&dd-evp-origin=browser' + | ||
@@ -33,0 +33,0 @@ "&dd-request-id=".concat((0, utils_1.generateUUID)()); |
@@ -40,3 +40,3 @@ "use strict"; | ||
service: 'browser-sdk', | ||
version: "4.11.3", | ||
version: "4.11.4", | ||
source: 'browser', | ||
@@ -43,0 +43,0 @@ _dd: { |
@@ -85,2 +85,3 @@ export declare const ONE_SECOND = 1000; | ||
export declare function includes<T>(candidate: T[], search: T): boolean; | ||
export declare function arrayFrom<T>(arrayLike: ArrayLike<T>): T[]; | ||
export declare function find<T, S extends T>(array: T[], predicate: (item: T, index: number, array: T[]) => item is S): S | undefined; | ||
@@ -201,2 +202,3 @@ export declare function findLast<T, S extends T>(array: T[], predicate: (item: T, index: number, array: T[]) => item is S): S | undefined; | ||
export declare function matchList(list: Array<string | RegExp>, value: string): boolean; | ||
export declare function cssEscape(str: string): string; | ||
export {}; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.matchList = exports.removeDuplicates = exports.setToArray = exports.requestIdleCallback = exports.combine = exports.deepClone = exports.mergeInto = exports.getType = exports.runOnReadyState = exports.addEventListeners = exports.addEventListener = exports.safeTruncate = exports.findCommaSeparatedValue = exports.getLinkElementOrigin = exports.getLocationOrigin = exports.getGlobalObject = exports.startsWith = exports.mapValues = exports.isEmptyObject = exports.objectEntries = exports.objectHasValue = exports.objectValues = exports.isNumber = exports.isPercentage = exports.findLast = exports.find = exports.includes = exports.jsonStringify = exports.noop = exports.round = exports.performDraw = exports.generateUUID = exports.shallowClone = exports.assign = exports.throttle = exports.ONE_KILO_BYTE = exports.ONE_YEAR = exports.ONE_DAY = exports.ONE_HOUR = exports.ONE_MINUTE = exports.ONE_SECOND = void 0; | ||
exports.cssEscape = exports.matchList = exports.removeDuplicates = exports.setToArray = exports.requestIdleCallback = exports.combine = exports.deepClone = exports.mergeInto = exports.getType = exports.runOnReadyState = exports.addEventListeners = exports.addEventListener = exports.safeTruncate = exports.findCommaSeparatedValue = exports.getLinkElementOrigin = exports.getLocationOrigin = exports.getGlobalObject = exports.startsWith = exports.mapValues = exports.isEmptyObject = exports.objectEntries = exports.objectHasValue = exports.objectValues = exports.isNumber = exports.isPercentage = exports.findLast = exports.find = exports.arrayFrom = exports.includes = exports.jsonStringify = exports.noop = exports.round = exports.performDraw = exports.generateUUID = exports.shallowClone = exports.assign = exports.throttle = exports.ONE_KILO_BYTE = exports.ONE_YEAR = exports.ONE_DAY = exports.ONE_HOUR = exports.ONE_MINUTE = exports.ONE_SECOND = void 0; | ||
var monitor_1 = require("./monitor"); | ||
@@ -148,2 +148,10 @@ exports.ONE_SECOND = 1000; | ||
exports.includes = includes; | ||
function arrayFrom(arrayLike) { | ||
var array = []; | ||
for (var i = 0; i < arrayLike.length; i++) { | ||
array.push(arrayLike[i]); | ||
} | ||
return array; | ||
} | ||
exports.arrayFrom = arrayFrom; | ||
function find(array, predicate) { | ||
@@ -466,2 +474,22 @@ for (var i = 0; i < array.length; i += 1) { | ||
exports.matchList = matchList; | ||
// https://github.com/jquery/jquery/blob/a684e6ba836f7c553968d7d026ed7941e1a612d8/src/selector/escapeSelector.js | ||
function cssEscape(str) { | ||
if (window.CSS && window.CSS.escape) { | ||
return window.CSS.escape(str); | ||
} | ||
// eslint-disable-next-line no-control-regex | ||
return str.replace(/([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g, function (ch, asCodePoint) { | ||
if (asCodePoint) { | ||
// U+0000 NULL becomes U+FFFD REPLACEMENT CHARACTER | ||
if (ch === '\0') { | ||
return '\uFFFD'; | ||
} | ||
// Control characters and (dependent upon position) numbers get escaped as code points | ||
return "".concat(ch.slice(0, -1), "\\").concat(ch.charCodeAt(ch.length - 1).toString(16), " "); | ||
} | ||
// Other potentially-special ASCII characters get backslash-escaped | ||
return "\\".concat(ch); | ||
}); | ||
} | ||
exports.cssEscape = cssEscape; | ||
//# sourceMappingURL=utils.js.map |
@@ -22,3 +22,3 @@ "use strict"; | ||
endpointType: endpointType, | ||
version: "4.11.3", | ||
version: "4.11.4", | ||
connection: navigator.connection ? navigator.connection.effectiveType : undefined, | ||
@@ -25,0 +25,0 @@ onLine: navigator.onLine, |
@@ -6,3 +6,3 @@ import { catchUserErrors } from '../tools/catchUserErrors'; | ||
var publicApi = assign({ | ||
version: "4.11.3", | ||
version: "4.11.4", | ||
// This API method is intentionally not monitored, since the only thing executed is the | ||
@@ -9,0 +9,0 @@ // user-provided 'callback'. All SDK usages executed in the callback should be monitored, and |
@@ -25,5 +25,5 @@ import { timeStampNow } from '../../tools/timeUtils'; | ||
var parameters = 'ddsource=browser' + | ||
"&ddtags=".concat(encodeURIComponent(["sdk_version:".concat("4.11.3")].concat(tags).join(','))) + | ||
"&ddtags=".concat(encodeURIComponent(["sdk_version:".concat("4.11.4")].concat(tags).join(','))) + | ||
"&dd-api-key=".concat(clientToken) + | ||
"&dd-evp-origin-version=".concat(encodeURIComponent("4.11.3")) + | ||
"&dd-evp-origin-version=".concat(encodeURIComponent("4.11.4")) + | ||
'&dd-evp-origin=browser' + | ||
@@ -30,0 +30,0 @@ "&dd-request-id=".concat(generateUUID()); |
@@ -37,3 +37,3 @@ import { ConsoleApiName } from '../../tools/display'; | ||
service: 'browser-sdk', | ||
version: "4.11.3", | ||
version: "4.11.4", | ||
source: 'browser', | ||
@@ -40,0 +40,0 @@ _dd: { |
@@ -85,2 +85,3 @@ export declare const ONE_SECOND = 1000; | ||
export declare function includes<T>(candidate: T[], search: T): boolean; | ||
export declare function arrayFrom<T>(arrayLike: ArrayLike<T>): T[]; | ||
export declare function find<T, S extends T>(array: T[], predicate: (item: T, index: number, array: T[]) => item is S): S | undefined; | ||
@@ -201,2 +202,3 @@ export declare function findLast<T, S extends T>(array: T[], predicate: (item: T, index: number, array: T[]) => item is S): S | undefined; | ||
export declare function matchList(list: Array<string | RegExp>, value: string): boolean; | ||
export declare function cssEscape(str: string): string; | ||
export {}; |
@@ -136,2 +136,9 @@ import { monitor } from './monitor'; | ||
} | ||
export function arrayFrom(arrayLike) { | ||
var array = []; | ||
for (var i = 0; i < arrayLike.length; i++) { | ||
array.push(arrayLike[i]); | ||
} | ||
return array; | ||
} | ||
export function find(array, predicate) { | ||
@@ -428,2 +435,21 @@ for (var i = 0; i < array.length; i += 1) { | ||
} | ||
// https://github.com/jquery/jquery/blob/a684e6ba836f7c553968d7d026ed7941e1a612d8/src/selector/escapeSelector.js | ||
export function cssEscape(str) { | ||
if (window.CSS && window.CSS.escape) { | ||
return window.CSS.escape(str); | ||
} | ||
// eslint-disable-next-line no-control-regex | ||
return str.replace(/([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g, function (ch, asCodePoint) { | ||
if (asCodePoint) { | ||
// U+0000 NULL becomes U+FFFD REPLACEMENT CHARACTER | ||
if (ch === '\0') { | ||
return '\uFFFD'; | ||
} | ||
// Control characters and (dependent upon position) numbers get escaped as code points | ||
return "".concat(ch.slice(0, -1), "\\").concat(ch.charCodeAt(ch.length - 1).toString(16), " "); | ||
} | ||
// Other potentially-special ASCII characters get backslash-escaped | ||
return "\\".concat(ch); | ||
}); | ||
} | ||
//# sourceMappingURL=utils.js.map |
@@ -18,3 +18,3 @@ import { isExperimentalFeatureEnabled } from '../domain/configuration'; | ||
endpointType: endpointType, | ||
version: "4.11.3", | ||
version: "4.11.4", | ||
connection: navigator.connection ? navigator.connection.effectiveType : undefined, | ||
@@ -21,0 +21,0 @@ onLine: navigator.onLine, |
{ | ||
"name": "@datadog/browser-core", | ||
"version": "4.11.3", | ||
"version": "4.11.4", | ||
"license": "Apache-2.0", | ||
@@ -24,3 +24,3 @@ "main": "cjs/index.js", | ||
}, | ||
"gitHead": "2833c9db3336b373ae24804293321f3c6cf2151c" | ||
"gitHead": "c059f7a31fc28a270511780f3cc9a2dd4f260a37" | ||
} |
@@ -5,2 +5,3 @@ import type { Clock } from '../../test/specHelper' | ||
combine, | ||
cssEscape, | ||
deepClone, | ||
@@ -573,1 +574,10 @@ findCommaSeparatedValue, | ||
}) | ||
describe('cssEscape', () => { | ||
it('should escape a string', () => { | ||
expect(cssEscape('.foo#bar')).toEqual('\\.foo\\#bar') | ||
expect(cssEscape('()[]{}')).toEqual('\\(\\)\\[\\]\\{\\}') | ||
expect(cssEscape('--a')).toEqual('--a') | ||
expect(cssEscape('\0')).toEqual('\ufffd') | ||
}) | ||
}) |
@@ -211,2 +211,10 @@ import { monitor } from './monitor' | ||
export function arrayFrom<T>(arrayLike: ArrayLike<T>): T[] { | ||
const array = [] | ||
for (let i = 0; i < arrayLike.length; i++) { | ||
array.push(arrayLike[i]) | ||
} | ||
return array | ||
} | ||
export function find<T, S extends T>( | ||
@@ -639,1 +647,22 @@ array: T[], | ||
} | ||
// https://github.com/jquery/jquery/blob/a684e6ba836f7c553968d7d026ed7941e1a612d8/src/selector/escapeSelector.js | ||
export function cssEscape(str: string) { | ||
if (window.CSS && window.CSS.escape) { | ||
return window.CSS.escape(str) | ||
} | ||
// eslint-disable-next-line no-control-regex | ||
return str.replace(/([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g, function (ch, asCodePoint) { | ||
if (asCodePoint) { | ||
// U+0000 NULL becomes U+FFFD REPLACEMENT CHARACTER | ||
if (ch === '\0') { | ||
return '\uFFFD' | ||
} | ||
// Control characters and (dependent upon position) numbers get escaped as code points | ||
return `${ch.slice(0, -1)}\\${ch.charCodeAt(ch.length - 1).toString(16)} ` | ||
} | ||
// Other potentially-special ASCII characters get backslash-escaped | ||
return `\\${ch}` | ||
}) | ||
} |
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
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
825135
16366