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

@georges-tech/tardis

Package Overview
Dependencies
Maintainers
4
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@georges-tech/tardis - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

5

dist/src/index.js

@@ -17,5 +17,4 @@ "use strict";

function _getConfigurationsOnDateRange({ configurationTimeline, startDate, endDate, }) {
return lodash_1.default.filter(configurationTimeline, (configuration) => moment_1.default(configuration.effective_date).isSameOrAfter(startDate) &&
moment_1.default(configuration.effective_date).isBefore(endDate) &&
(!configuration.end_date || moment_1.default(configuration.end_date).isBefore(endDate)));
return lodash_1.default.filter(configurationTimeline, (configuration) => moment_1.default(configuration.effective_date).isBetween(startDate, endDate, 'ms', '[)') ||
moment_1.default(configuration.effective_date).isBefore(startDate) && (!configuration.end_date || moment_1.default(configuration.end_date).isAfter(startDate)));
}

@@ -22,0 +21,0 @@ function filterEffectiveDocuments({ filteredDocuments = [], orderedDocuments, }) {

2

package.json
{
"name": "@georges-tech/tardis",
"version": "1.0.1",
"version": "1.0.2",
"description": "Temporal property implementation for reading historized data",

@@ -5,0 +5,0 @@ "main": "dist/src/index.js",

@@ -326,4 +326,61 @@ import chai from 'chai';

});
it('should known all valid configurations between a start and end date with three effective configurations', () => {
const historyService = createHistoryService({ documents: [
{
known_at : new Date("2020-01-20"),
effective_date: new Date("2000-01-01"),
data: {
number: 1,
},
},
{
known_at : new Date("2020-02-20"),
effective_date : new Date("2019-03-01"),
data: {
number: 2,
},
},
{
known_at: new Date("2020-03-20"),
effective_date : new Date("2019-10-01"),
data: {
number: 3,
},
},
]});
expect(
historyService.getConfigurationsOnDateRange({
startDate: new Date('2019-01-01'),
endDate: new Date('2019-12-31'),
})
).to.deep.equal([
{
known_at : new Date("2020-01-20"),
effective_date: new Date("2000-01-01"),
end_date : new Date("2019-03-01"),
data: {
number: 1,
},
},{
known_at : new Date("2020-02-20"),
effective_date : new Date("2019-03-01"),
end_date : new Date("2019-10-01"),
data: {
number: 2,
},
},
{
known_at: new Date("2020-03-20"),
effective_date : new Date("2019-10-01"),
end_date : undefined,
data: {
number: 3,
},
}]);
});
})
});
});
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