@objectiv/plugin-path-context-from-url
Version:
Plugin for Objectiv trackers to automatically generate and attach PathContext from URLs
2 lines • 2.7 kB
JavaScript
;var n=Object.defineProperty;var l=Object.getOwnPropertyDescriptor;var p=Object.getOwnPropertyNames;var d=Object.prototype.hasOwnProperty;var u=(t,e)=>{for(var i in e)n(t,i,{get:e[i],enumerable:!0})},m=(t,e,i,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of p(e))!d.call(t,s)&&s!==i&&n(t,s,{get:()=>e[s],enumerable:!(o=l(e,s))||o.enumerable});return t};var b=t=>m(n({},"__esModule",{value:!0}),t);var v={};u(v,{PathContextFromURLPlugin:()=>c});module.exports=b(v);var r={name:"@objectiv/plugin-path-context-from-url",version:"0.0.26",description:"Plugin for Objectiv trackers to automatically generate and attach PathContext from URLs",license:"Apache-2.0",homepage:"https://objectiv.io",keywords:["objectiv","tracking","web","analytics","events","taxonomy","plugin","url"],repository:{type:"git",url:"https://github.com/objectiv/objectiv-analytics.git",directory:"tracker/plugins/path-context-from-url"},bugs:"https://github.com/objectiv/objectiv-analytics/issues",contributors:[{name:"Surai Di Rosa",email:"surai.dirosa@gmail.com",url:"https://github.com/sdirosa"}],main:"./dist/index.js",module:"./dist/esm/index.js",types:"./dist/index.d.ts",files:["dist"],exports:{".":{require:"./dist/index.js",import:"./dist/esm/index.js",types:"./dist/index.d.ts"}},scripts:{build:"tsup src/index.ts --format cjs,esm --legacy-output --minify --dts --sourcemap --clean","deploy:verdaccio":"npm publish",prettify:"prettier --write .",tsc:"tsc --noEmit",test:"jest --silent","test:ci":"jest --silent --ci","test:coverage":"jest --silent --coverage",depcheck:"npx depcheck"},devDependencies:{"@objectiv/developer-tools":"^0.0.26","@objectiv/testing-tools":"^0.0.26",jest:"^28.1.3",prettier:"^2.7.1","ts-jest":"^28.0.7",tsup:"^6.2.1",typescript:"^4.7.4"},peerDependencies:{"@objectiv/tracker-core":"^0.0.26"}};var a=require("@objectiv/tracker-core"),c=class{constructor(){this.pluginName="PathContextFromURLPlugin"}initialize(){var e;(e=globalThis.objectiv.devTools)==null||e.TrackerConsole.log(`%c\uFF62objectiv:${this.pluginName}\uFF63 Initialized`,"font-weight: bold")}enrich(e){var o;if(!this.isUsable()){(o=globalThis.objectiv.devTools)==null||o.TrackerConsole.error(`\uFF62objectiv:${this.pluginName}\uFF63 Cannot enrich. Plugin is not usable (document: ${typeof document}).`);return}let i=(0,a.makePathContext)({id:document.location.href});e.global_contexts.push(i)}isUsable(){return typeof document<"u"&&typeof document.location<"u"}};globalThis.objectiv=globalThis.objectiv??{};globalThis.objectiv.versions=globalThis.objectiv.versions??new Map;globalThis.objectiv.versions.set(r.name,r.version);0&&(module.exports={PathContextFromURLPlugin});
//# sourceMappingURL=index.js.map