Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

monetizer

Package Overview
Dependencies
Maintainers
2
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

monetizer - npm Package Compare versions

Comparing version 49.0.0 to 49.1.2

4

package.json
{
"name": "monetizer",
"version": "49.0.0",
"version": "49.1.2",
"description": "Web Monetization API for JavaScript",

@@ -32,3 +32,3 @@ "main": "./lib/index.js",

},
"gitHead": "af7eecf46321b773a6ef8f0a26aea500eb363b30"
"gitHead": "900f9176025d02d5f05710486bd32c415a9b8602"
}

@@ -28,4 +28,7 @@ export type MonetizationOptions = {

monetize(options: MonetizationOptions | string) {
const { content, weight = 1, priority = 0 } =
typeof options === 'string' ? { content: options } : options
const {
content,
weight = 1,
priority = 0,
} = typeof options === 'string' ? { content: options } : options
const configuration: MonetizationConfiguration = {

@@ -46,5 +49,5 @@ content,

const maxPriority = Math.max(
...active.map(configuration => configuration.priority)
...active.map((configuration) => configuration.priority)
)
const considered = active.filter(item => item.priority === maxPriority)
const considered = active.filter((item) => item.priority === maxPriority)
const sum = considered.reduce((sum, item) => sum + item.weight, 0)

@@ -51,0 +54,0 @@ let choice = this._runtime.Math.random() * sum

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc