![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Simplistic library for dealing with Durations
The strings that this module outputs could be represented with the following ABNF, which is a subset of that found in RFC3339 for Durations:
dur-second = 1*DIGIT "S"
dur-minute = 1*DIGIT "M" [dur-second]
dur-hour = 1*DIGIT "H" [dur-minute]
dur-time = "T" (dur-hour / dur-minute / dur-second)
duration = "P" dur-time
Specifically, this module does not handle Years, Months, Days, or Weeks. It also doesn't accept fractional seconds (milli / nano seconds).
PT20S // 0 Hours, 0 Minutes, 20 Seconds
PT10M // 0 Hours, 10 Minutes, 0 Seconds
PT1H // 1 Hours, 0 Minutes, 0 Seconds
PT1H20S // 1 Hours, 0 Minutes, 20 Seconds
PT1H10M // 1 Hours, 10 Minutes, 0 Seconds
PT1H10M20S // 1 Hours, 10 Minutes, 20 Seconds
PT26H10M20S // 26 Hours, 10 Minutes, 20 Seconds
When a method accepts or returns an object, it'll use the following structure:
{
hours: Integer,
minutes: Integer,
seconds: Integer
}
Takes an integer and creates a Duration Object. See the source code for details, but seconds are used first, then minutes, then hours.
For example, fromSeconds(60)
would return { hours: 0, minutes: 1, seconds: 0 }
Parses a given String using the format specified above. Returns an Duration Object
.
Accepts a Duration Object
or a integer
value representing the duration in seconds. When an integer
argument is given, the value is first passed to fromSeconds
, in order to get it's Duration Object
representation.
Returns a String matching the ABNF listed above. In the case of the duration having a total length of 0 seconds, PT0S
is returned, such that you still can parse it at a later date.
FAQs
Small library for dealing with Durations
The npm package durational receives a total of 86 weekly downloads. As such, durational popularity was classified as not popular.
We found that durational 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.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.