@segment/analytics.js-core
Advanced tools
Comparing version 4.0.1 to 4.0.4
@@ -748,9 +748,9 @@ 'use strict'; | ||
var sub; | ||
return foldl(function (acc, val, key) { | ||
return Object.keys(object).reduce(function (acc, key) { | ||
if (key.substr(0, length) === prefix) { | ||
sub = key.substr(length); | ||
acc[sub] = val; | ||
acc[sub] = object[key]; | ||
} | ||
return acc; | ||
}, {}, object); | ||
}, {}); | ||
} | ||
@@ -757,0 +757,0 @@ }; |
@@ -0,1 +1,13 @@ | ||
# 4.0.4 / 2020-09-11 | ||
- Change the arguments of the main methods to be optional in the typedef to match the documentation. (#203) | ||
# 4.0.3 / 2020-09-11 | ||
- Bump `debug` to a version that fixed security vulnerabilities. | ||
# 4.0.2 / 2020-09-01 | ||
- Replace @ndhoule/foldl with Array.prototype.reduce | ||
# 4.0.1 / 2020-08-21 | ||
@@ -2,0 +14,0 @@ |
@@ -300,6 +300,6 @@ 'use strict'; | ||
Analytics.prototype.identify = function( | ||
id: string, | ||
traits: unknown, | ||
options: SegmentOpts, | ||
fn: Function | SegmentOpts | ||
id?: string, | ||
traits?: unknown, | ||
options?: SegmentOpts, | ||
fn?: Function | SegmentOpts | ||
): SegmentAnalytics { | ||
@@ -359,5 +359,5 @@ // Argument reshuffling. | ||
id: string, | ||
traits: unknown, | ||
options: unknown, | ||
fn: unknown | ||
traits?: unknown, | ||
options?: unknown, | ||
fn?: unknown | ||
): SegmentAnalytics { | ||
@@ -404,5 +404,5 @@ /* eslint-disable no-unused-expressions, no-sequences */ | ||
event: string, | ||
properties: unknown, | ||
options: unknown, | ||
fn: unknown | ||
properties?: unknown, | ||
options?: unknown, | ||
fn?: unknown | ||
): SegmentAnalytics { | ||
@@ -570,7 +570,7 @@ // Argument reshuffling. | ||
Analytics.prototype.page = function( | ||
category: string, | ||
name: string, | ||
properties: any, | ||
options: any, | ||
fn: unknown | ||
category?: string, | ||
name?: string, | ||
properties?: any, | ||
options?: any, | ||
fn?: unknown | ||
): SegmentAnalytics { | ||
@@ -946,13 +946,9 @@ // Argument reshuffling. | ||
var sub; | ||
return foldl( | ||
function(acc, val, key) { | ||
if (key.substr(0, length) === prefix) { | ||
sub = key.substr(length); | ||
acc[sub] = val; | ||
} | ||
return acc; | ||
}, | ||
{}, | ||
object | ||
); | ||
return Object.keys(object).reduce(function(acc, key) { | ||
if (key.substr(0, length) === prefix) { | ||
sub = key.substr(length); | ||
acc[sub] = object[key]; | ||
} | ||
return acc; | ||
}, {}); | ||
} | ||
@@ -959,0 +955,0 @@ }; |
@@ -133,6 +133,6 @@ export declare namespace SegmentAnalytics { | ||
identify( | ||
id: string, | ||
traits: unknown, | ||
options: SegmentOpts, | ||
fn: Function | SegmentOpts | ||
id?: string, | ||
traits?: unknown, | ||
options?: SegmentOpts, | ||
fn?: Function | SegmentOpts | ||
): AnalyticsJS; | ||
@@ -151,5 +151,5 @@ | ||
id: string, | ||
traits: unknown, | ||
options: unknown, | ||
fn: unknown | ||
traits?: unknown, | ||
options?: unknown, | ||
fn?: unknown | ||
): AnalyticsJS; | ||
@@ -162,5 +162,5 @@ | ||
event: string, | ||
properties: unknown, | ||
options: unknown, | ||
fn: unknown | ||
properties?: unknown, | ||
options?: unknown, | ||
fn?: unknown | ||
): AnalyticsJS; | ||
@@ -226,7 +226,7 @@ | ||
page( | ||
category: string, | ||
name: string, | ||
properties: any, | ||
options: any, | ||
fn: unknown | ||
category?: string, | ||
name?: string, | ||
properties?: any, | ||
options?: any, | ||
fn?: unknown | ||
): AnalyticsJS; | ||
@@ -233,0 +233,0 @@ |
{ | ||
"name": "@segment/analytics.js-core", | ||
"author": "Segment <friends@segment.com>", | ||
"version": "4.0.1", | ||
"version": "4.0.4", | ||
"description": "The hassle-free way to integrate analytics into any web application.", | ||
@@ -20,3 +20,4 @@ "types": "lib/index.d.ts", | ||
"np": "np --no-publish", | ||
"cz": "git-cz" | ||
"cz": "git-cz", | ||
"check-js": "if [[ $(git status -s | egrep '^(A|R)' | egrep 'jsx?\"?$' | wc -l | awk '{print $1}') > 0 ]] ; then exit 125; else echo 🎉 ; fi; echo" | ||
}, | ||
@@ -35,3 +36,2 @@ "repository": { | ||
"@ndhoule/extend": "^2.0.0", | ||
"@ndhoule/foldl": "^2.0.1", | ||
"@ndhoule/includes": "^2.0.1", | ||
@@ -55,3 +55,3 @@ "@ndhoule/keys": "^2.0.0", | ||
"component-url": "^0.2.1", | ||
"debug": "^0.7.4", | ||
"debug": "^2.6.9", | ||
"extend": "3.0.2", | ||
@@ -73,14 +73,16 @@ "inherits": "^2.0.1", | ||
"@types/express": "^4.17.6", | ||
"@types/lodash": "^4.14.155", | ||
"@types/lodash": "^4.14.161", | ||
"@types/mocha": "^7.0.2", | ||
"@types/node": "^14.0.6", | ||
"@types/node-fetch": "^2.5.7", | ||
"browserify": "13.0.0", | ||
"browserify-istanbul": "^2.0.0", | ||
"assert": "1.5.0", | ||
"browserify": "16.5.2", | ||
"browserify-istanbul": "^3.0.1", | ||
"buffer": "^4.9.2", | ||
"codeceptjs": "^2.6.5", | ||
"codecov": "^3.0.2", | ||
"codecov": "^3.7.2", | ||
"compat-trigger-event": "^1.0.0", | ||
"component-each": "^0.2.6", | ||
"cz-conventional-changelog": "^2.1.0", | ||
"eslint": "^4.19.1", | ||
"eslint": "^7.8.1", | ||
"eslint-config-prettier": "^2.9.0", | ||
@@ -92,35 +94,35 @@ "eslint-plugin-mocha": "^5.0.0", | ||
"husky": "^0.14.3", | ||
"istanbul": "^0.4.3", | ||
"jquery": "^3.2.1", | ||
"karma": "1.3.0", | ||
"karma-browserify": "^5.0.4", | ||
"jquery": "^3.5.0", | ||
"karma": "5.1.1", | ||
"karma-browserify": "^7.0.0", | ||
"karma-chrome-launcher": "^3.1.0", | ||
"karma-coverage": "^1.0.0", | ||
"karma-junit-reporter": "^1.0.0", | ||
"karma-mocha": "1.0.1", | ||
"karma-sauce-launcher": "^1.0.0", | ||
"karma-spec-reporter": "0.0.26", | ||
"karma-summary-reporter": "^1.5.0", | ||
"lint-staged": "^7.2.0", | ||
"lodash": "^4.17.15", | ||
"mocha": "^2.2.5", | ||
"node-fetch": "^2.6.0", | ||
"np": "^3.0.4", | ||
"prettier-eslint-cli": "^4.7.1", | ||
"proclaim": "^3.4.1", | ||
"puppeteer": "^3.3.0", | ||
"karma-coverage": "^2.0.3", | ||
"karma-junit-reporter": "^2.0.1", | ||
"karma-mocha": "2.0.1", | ||
"karma-sauce-launcher": "^1.2.0", | ||
"karma-spec-reporter": "0.0.32", | ||
"karma-summary-reporter": "^1.8.0", | ||
"karma-typescript": "^5.1.0", | ||
"lint-staged": "^10.2.13", | ||
"lodash": "^4.17.20", | ||
"mocha": "^4.1.0", | ||
"np": "^6.5.0", | ||
"prettier-eslint-cli": "5.0.0", | ||
"proclaim": "^3.5.1", | ||
"puppeteer": "^5.3.0", | ||
"sinon": "^1.7.3", | ||
"snyk": "^1.83.0", | ||
"snyk": "^1.393.0", | ||
"ts-node": "^8.10.2", | ||
"typescript": "^4.0.2", | ||
"wait-on": "^5.0.1", | ||
"watchify": "^3.7.0" | ||
"watchify": "^3.11.1" | ||
}, | ||
"lint-staged": { | ||
"linters": { | ||
"*.{js,json,md}": [ | ||
"prettier-eslint --write", | ||
"git add" | ||
] | ||
} | ||
"*.{js,jsx}": [ | ||
"yarn check-js" | ||
], | ||
"*.{js,json,md}": [ | ||
"prettier-eslint --write", | ||
"git add" | ||
] | ||
}, | ||
@@ -131,3 +133,11 @@ "browserify": { | ||
] | ||
}, | ||
"resolutions": { | ||
"buffer": "^4.9.2", | ||
"assert": "1.5.0", | ||
"browserify": "16.5.2", | ||
"lodash": "4.17.20", | ||
"node-fetch": "2.6.1", | ||
"elliptic": "^6.5.3" | ||
} | ||
} |
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
188866
31
48
4644
- Removed@ndhoule/foldl@^2.0.1
- Removed@ndhoule/foldl@2.0.1(transitive)
- Removeddebug@0.7.4(transitive)
Updateddebug@^2.6.9