![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.
object-interpolator
Advanced tools
object-interpolator takes an object and replaces date tokens with date formats
##Install
npm install object-interpolator
##Purpose
Allows for strings or objects containing strings in a particular format to be interpolated to a date String.
This would allow for a string to "always" be 30 days in the past. "{{date('-30days', 'YYYY-MM-DD')}}"
##Usage
var interpolator = require('object-interpolator');
var obj = {
a: 'test',
b: 'test',
c: "{{date('YYYY-MM-DD')}}",
d: "{{date('-1days', 'YYYY-MM-DD')}}",
e: "{{date('YYYY-MM-DD')}}",
f: "{{date('-30days', 'YYYY-MM-DD')}}",
g: "{{date('-1years', '-1years', 'start of year')}}"
};
var newObj = interpolator.interpolateSpecialValues(obj);
//{ a: 'test',
//b: 'test',
//c: '2015-04-08',
//d: '2015-04-07',
//e: '2015-04-08',
//f: '2015-03-09',
//g: '2014-01-01' }
##Notes
You can + or - any # of (seconds|minutes|hours|days|weeks|months|years)
You can start of (year|month|quarter|week|isoWeek|day|hour|minute|second)
You can now pass multiple date prompts together, like in example 'g'
If no format is given, it will default to YYYY-MM-DD
With really bad input, an Error will be thrown, otherwise garbage in - garbage out
FAQs
Nodejs interpolator
The npm package object-interpolator receives a total of 0 weekly downloads. As such, object-interpolator popularity was classified as not popular.
We found that object-interpolator demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 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.
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.