{"id":16440685,"url":"https://github.com/danilosampaio/outersections","last_synced_at":"2025-02-26T01:25:22.684Z","repository":{"id":57316899,"uuid":"89428035","full_name":"danilosampaio/outersections","owner":"danilosampaio","description":"It Calculates “Outersections” of ranges.","archived":false,"fork":false,"pushed_at":"2017-05-06T01:09:48.000Z","size":10,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-09T20:19:25.254Z","etag":null,"topics":["intersection","ranges","set-theory"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/danilosampaio.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"license","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-04-26T02:21:42.000Z","updated_at":"2017-05-16T23:55:57.000Z","dependencies_parsed_at":"2022-08-25T20:00:50.667Z","dependency_job_id":null,"html_url":"https://github.com/danilosampaio/outersections","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danilosampaio%2Foutersections","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danilosampaio%2Foutersections/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danilosampaio%2Foutersections/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danilosampaio%2Foutersections/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/danilosampaio","download_url":"https://codeload.github.com/danilosampaio/outersections/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240774127,"owners_count":19855335,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["intersection","ranges","set-theory"],"created_at":"2024-10-11T09:12:46.090Z","updated_at":"2025-02-26T01:25:22.621Z","avatar_url":"https://github.com/danilosampaio.png","language":"JavaScript","readme":"# outersections [![Build Status](https://travis-ci.org/danilosampaio/outersections.svg?branch=master)](https://travis-ci.org/danilosampaio/outersections) [![Coverage Status](https://coveralls.io/repos/github/danilosampaio/outersections/badge.svg?branch=master)](https://coveralls.io/github/danilosampaio/outersections?branch=master)\n\n\u003e It Calculates “Outersections” of ranges.\n\nGiven a list of ranges:\n\n![Ranges](/outersection.png?raw=true \"Ranges\")\n\nit calculates the \"Outersection\" intervals (Hatched area, with no intersections between the A,B,C date ranges).\n\n[Stackoverflow discussion](http://stackoverflow.com/questions/43592891/how-to-calculate-outersections-from-sets-of-date-range)\n\n## Install\n\n```\n$ npm install --save outersections\n```\n\n\n## Usage\n\n```js\nconst outersections = require('outersections');\n\nlet ranges = [\n\t{begin: new Date(2017, 0, 1), end: new Date(2017, 0, 10)},\n\t{begin: new Date(2017, 0, 20), end: new Date(2017, 0, 30)},\n\t{begin: new Date(2017, 0, 1), end: new Date(2017, 0, 7)},\n\t{begin: new Date(2017, 0, 25), end: new Date(2017, 1, 5)}\n];\n\noutersections(ranges);\n//=\u003e [{ begin: Date(2017, 0, 10), end: Date(2017, 0, 20) }]\n\n\nconst ranges = [\n\t{begin: 1, end: 10},\n\t{begin: 20, end: 30},\n\t{begin: 1, end: 7},\n\t{begin: 25, end: 35}\n];\n\noutersections(ranges);\n//=\u003e [{begin: 10, end: 20}]\n\n```\n\n\n## API\n\n### outersections(ranges)\n\n#### input\n\nType: `Array`\n\nArray of ranges\n\n\n## License\n\nMIT © [Danilo Sampaio](http://github.com/danilosampaio)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanilosampaio%2Foutersections","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdanilosampaio%2Foutersections","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanilosampaio%2Foutersections/lists"}