
Research
/Security News
Weaponizing Discord for Command and Control Across npm, PyPI, and RubyGems.org
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.
contained-periodic-values
Advanced tools
Find how many values of a discrete periodic function are contained in an interval.
Find how many values of a discrete periodic function contained in an interval.
Periodic functions are functions that repeat. Discrete functions are functions whose values do not connect. An example of a discrete periodic function is the function of "Wednesdays" on a calendar. Wednesdays are discrete values along a timeline, and they repeat every 7 days.
Continuing the example from above, this library could be used to determine the number of Wednesdays between two days. You could extend this to find the number of work days or week days between two days.
The members of a periodic function's output are the "values." A single member is a "value."
The distance that the function repeats itself along is the "period."
An interval is defined by a "start" and "end".
containedPeriodicValues(start, end, value, period)
Find the number of values contained with the "start" and "end." This method works with
intervals with inclusive starts and exclusive ends. In math syntax, this would be written
as [start, end)
.
The order that you specify the start and end does not matter.
FAQs
Find how many values of a discrete periodic function are contained in an interval.
The npm package contained-periodic-values receives a total of 39,977 weekly downloads. As such, contained-periodic-values popularity was classified as popular.
We found that contained-periodic-values demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
/Security News
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.
Security News
Socket now integrates with Bun 1.3’s Security Scanner API to block risky packages at install time and enforce your organization’s policies in local dev and CI.
Research
The Socket Threat Research Team is tracking weekly intrusions into the npm registry that follow a repeatable adversarial playbook used by North Korean state-sponsored actors.