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

credit-roles

Package Overview
Dependencies
Maintainers
2
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

credit-roles - npm Package Compare versions

Comparing version 2.0.0 to 2.1.0

13

dist/index.js

@@ -45,2 +45,11 @@ export const CREDIT_URL = 'https://credit.niso.org/';

export const ROLES = Object.keys(CreditDescriptions); // enums are not easy to index
const ALIAS_ROLES = {
writing: CreditRole.WritingOriginalDraft,
editing: CreditRole.WritingReviewEditing,
review: CreditRole.WritingReviewEditing,
analysis: CreditRole.FormalAnalysis,
funding: CreditRole.FundingAcquisition,
admin: CreditRole.ProjectAdministration,
administration: CreditRole.ProjectAdministration,
};
/**

@@ -67,3 +76,3 @@ * Standardize various strings to a common string with british spelling, not for external use.

export function normalize(value, opts) {
var _a;
var _a, _b;
if (!value)

@@ -75,3 +84,3 @@ return undefined;

return undefined;
return (_a = STANDARDIZED_ROLES[standardize(value)]) !== null && _a !== void 0 ? _a : undefined;
return ((_b = (_a = STANDARDIZED_ROLES[standardize(value)]) !== null && _a !== void 0 ? _a : ALIAS_ROLES[value.toLowerCase().trim()]) !== null && _b !== void 0 ? _b : undefined);
}

@@ -78,0 +87,0 @@ /**

10

package.json
{
"name": "credit-roles",
"version": "2.0.0",
"version": "2.1.0",
"description": "Enumeration and normalization of CRT Contributor Roles (https://credit.niso.org/)",

@@ -43,9 +43,9 @@ "keywords": [

"devDependencies": {
"eslint": "^8.42.0",
"eslint": "^8.46.0",
"eslint-config-curvenote": "latest",
"npm-run-all": "^4.1.5",
"prettier": "^2.8.8",
"typescript": "^5.1.3",
"vitest": "^0.32.0"
"prettier": "^3.0.1",
"typescript": "^5.1.6",
"vitest": "^0.34.1"
}
}

@@ -20,3 +20,3 @@ # credit-roles

```ts
import credit, { CreditRole, CreditDescriptions } from 'credit-roles';
import { credit, CreditRole, CreditDescriptions } from 'credit-roles';

@@ -51,2 +51,16 @@ // Validate that a string is a role

## Alias
In addition to british english, incorrect case or punctuation, there are also a number of aliases that can be used for various roles:
| Alias | Official CRediT Role |
| -------------- | -------------------------- |
| writing | Writing – original draft |
| editing | Writing – review & editing |
| review | Writing – review & editing |
| analysis | Formal analysis |
| funding | Funding acquisition |
| admin | Project administration |
| administration | Project administration |
## References

@@ -53,0 +67,0 @@

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