-
Notifications
You must be signed in to change notification settings - Fork 59
/
Copy pathlicense.js
47 lines (34 loc) · 1.97 KB
/
license.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/**
* @type {Record<string, (repoOwner: string, repoName: string, defaultBranch: string) => string>}
*/
const licenses = {
ipfs: (repoOwner, repoName, defaultBranch) => `
## License
Licensed under either of
* Apache 2.0, ([LICENSE-APACHE](LICENSE-APACHE) / http://www.apache.org/licenses/LICENSE-2.0)
* MIT ([LICENSE-MIT](LICENSE-MIT) / http://opensource.org/licenses/MIT)
## Contribute
Contributions welcome! Please check out [the issues](https://github.com/${repoOwner}/${repoName}/issues).
Also see our [contributing document](https://github.com/ipfs/community/blob/master/CONTRIBUTING_JS.md) for more information on how we work, and about contributing in general.
Please be aware that all interactions related to this repo are subject to the IPFS [Code of Conduct](https://github.com/ipfs/community/blob/master/code-of-conduct.md).
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
[](https://github.com/ipfs/community/blob/master/CONTRIBUTING.md)
`,
default: (repoOwner, repoName, defaultBranch) => `
## License
Licensed under either of
* Apache 2.0, ([LICENSE-APACHE](LICENSE-APACHE) / http://www.apache.org/licenses/LICENSE-2.0)
* MIT ([LICENSE-MIT](LICENSE-MIT) / http://opensource.org/licenses/MIT)
## Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
`
}
/**
* @param {*} pkg
* @param {string} repoOwner
* @param {string} repoName
* @param {string} defaultBranch
*/
export const LICENSE = (pkg, repoOwner, repoName, defaultBranch) => {
return (licenses[repoOwner] ?? licenses.default)(repoOwner, repoName, defaultBranch)
}