
Product
Introducing Webhook Events for Alert Changes
Add real-time Socket webhook events to your workflows to automatically receive software supply chain alert changes in real time.
@oqton/utils-core
Advanced tools
A collection of standard helpers: like lodash, nothing specific for Oqton
A collection of standard helpers: like lodash, nothing specific for Oqton
Run the tests
yarn test
Run lint
yarn lint
Run lint and attempt to automatically fix issues
yarn fix-lint
Run formatting check
yarn check-formatting
Run formatter
yarn fix-formatting
Return an array of ids into a bitmask. Each id has to be > 0 and <= maxValue
ids Array<number>maxValue number (optional, default 10016)array Int32Array?Returns Int32Array
File with helper functions to deal with datetime/date/time objects. E.g. calculate duration between datetimes, calculate end of day, ... Not to be used to define formatting of datetime objects.
Type: number
1 millisecond
Type: number
1 second in milliseconds
Type: number
1 minute in milliseconds
Type: number
1 hour in milliseconds
Type: number
1 day in milliseconds
Type: number
Given date, return as RFC3339 valid date like 2011-09-29 Only used for html form date input
Returns string the given date (or now) as RFC3339 valid date like 2011-09-29
Get the time duration in milliseconds
Returns number
Get the ISO string of the end time based on type.
Returns string
Get the ISO string of the start time based on type.
Returns string
get the ISO string of the start time of the day
Returns string
Add number of days to date
days numberReturns Date
Add number of hours to date
hours numberReturns Date
Get an array of dates between 2 dates
Get all the hours between 2 dates
Get all the hours between 2 dates
Turn a date object and a time string ('01:23:45') into a single date object
Turn a date object and a time string ('01:23:45') into a single date object
Given 2 intervals in milliseconds { startMillis, endMillis } compare to see if they overlap
a Intervalb IntervalReturns boolean
Converts { startTime: '2019-01-07T01:00:00.000Z', endTime: '2019-01-07T02:00:00.000Z' } to { startMillis:1546822800000, endMillis:1546826400000 }
period PeriodReturns Interval
Given a list of periods, split them in to arrays, pushing any overlapping periods down to the next level
periods Array<Period> {Array} An array of periods
[{ startTime: '2019-01-07T01:00:00.000Z', endTime: '2019-01-07T02:00:00.000Z' }] (optional, default [])Check if user has appended #debug to the url Or if server was started with DEBUG=true as command line variable
Returns boolean Returns true if user appended #debug to the url
Check if two objects or arrays have the same keys and values.
Returns boolean
Check if two objects or arrays are equal, but treat null values the same as undefined or not defined
v anyo anyThe inverse of Object.entries({a: 1, b: 2}). objectFromEntries([['a', 1], ['b', 2]]) = {a: 1, b: 2}.
entries Array<any>Create a clone of an object tree and apply a function to each leaf.
Returns Object
Wraps an object so that accessing a non-existing property throws an error.
({a:1, b:2}).c returns undefined but throwUndefinedProperties({a:1, b:2}).c throws an error.
object Object the object to wrapReturns T
Check if one object (obj2) is nested in an other (obj1)
Returns boolean
A collection of functions that help with working with immutable JSON data.
path PathReturns Path
Unify: accepts two jsons, and returns a json that is deepequal to the first, and shares as many objects as possible with the second.
obj Msource (M | null | undefined)Returns M
Check if all values in an array are the same
arr Array<any>Object tree traversal, execute fn on leaves https://gist.github.com/tushariscoolster/567c1d22ca8d5498cbc0
Maintain the object structure but remove anything that does not include the given keys Similar to lodash pick https://lodash.com/docs/4.17.15#pick but for deep objects
Returns object
File with helper functions to deal with urls. E.g. check if a url is external.
link stringCheck if the given url is external
link stringFAQs
A collection of standard helpers: like lodash, nothing specific for Oqton
We found that @oqton/utils-core demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 5 open source maintainers 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.

Product
Add real-time Socket webhook events to your workflows to automatically receive software supply chain alert changes in real time.

Security News
ENISA has become a CVE Program Root, giving the EU a central authority for coordinating vulnerability reporting, disclosure, and cross-border response.

Product
Socket now scans OpenVSX extensions, giving teams early detection of risky behaviors, hidden capabilities, and supply chain threats in developer tools.