Comparing version 0.0.2 to 0.0.3
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
var desc = Object.getOwnPropertyDescriptor(m, k); | ||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
desc = { enumerable: true, get: function() { return m[k]; } }; | ||
} | ||
Object.defineProperty(o, k2, desc); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { | ||
Object.defineProperty(o, "default", { enumerable: true, value: v }); | ||
}) : function(o, v) { | ||
o["default"] = v; | ||
}); | ||
var __importStar = (this && this.__importStar) || function (mod) { | ||
if (mod && mod.__esModule) return mod; | ||
var result = {}; | ||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); | ||
__setModuleDefault(result, mod); | ||
return result; | ||
}; | ||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
@@ -20,3 +43,3 @@ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } | ||
const node_fetch_1 = __importDefault(require("node-fetch")); | ||
const __1 = require(".."); | ||
const __1 = __importStar(require("..")); | ||
function fetchAuthor(session, id) { | ||
@@ -51,3 +74,3 @@ return __awaiter(this, void 0, void 0, function* () { | ||
session.log.info(`${chalk_1.default.green.bold(result.author.display_name)}`); | ||
session.log.info(`${chalk_1.default.blue.bold((0, __1.normalize)(result.author.orcid))}`); | ||
session.log.info(`${chalk_1.default.blue.bold(__1.default.normalize(result.author.orcid))}`); | ||
session.log.info(` Hint: ${chalk_1.default.dim(result.query.hint)}`); | ||
@@ -54,0 +77,0 @@ session.log.info(` Last Institution: ${chalk_1.default.dim((_b = (_a = result.author.last_known_institution) === null || _a === void 0 ? void 0 : _a.display_name) !== null && _b !== void 0 ? _b : 'Unknown')}`); |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.buildUrl = exports.normalize = exports.validate = exports.ORCID_URL = void 0; | ||
exports.ORCID_URL = void 0; | ||
exports.ORCID_URL = 'https://orcid.org'; | ||
@@ -19,3 +19,2 @@ const ORCID_REGEX_STRICT = '^([0-9]{4}-){3}[0-9]{3}[0-9X]$'; | ||
} | ||
exports.validate = validate; | ||
/** | ||
@@ -32,3 +31,2 @@ * Normalize an input string to the ID part of an ORCID | ||
} | ||
exports.normalize = normalize; | ||
/** | ||
@@ -46,3 +44,2 @@ * Builds a canonical URL pointing to https://orcid.org | ||
} | ||
exports.buildUrl = buildUrl; | ||
exports.default = { | ||
@@ -49,0 +46,0 @@ validate, |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const version = '0.0.2'; | ||
const version = '0.0.3'; | ||
exports.default = version; |
@@ -14,3 +14,3 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
import fetch from 'node-fetch'; | ||
import { normalize, ORCID_URL } from '..'; | ||
import orcid, { ORCID_URL } from '..'; | ||
function fetchAuthor(session, id) { | ||
@@ -45,3 +45,3 @@ return __awaiter(this, void 0, void 0, function* () { | ||
session.log.info(`${chalk.green.bold(result.author.display_name)}`); | ||
session.log.info(`${chalk.blue.bold(normalize(result.author.orcid))}`); | ||
session.log.info(`${chalk.blue.bold(orcid.normalize(result.author.orcid))}`); | ||
session.log.info(` Hint: ${chalk.dim(result.query.hint)}`); | ||
@@ -48,0 +48,0 @@ session.log.info(` Last Institution: ${chalk.dim((_b = (_a = result.author.last_known_institution) === null || _a === void 0 ? void 0 : _a.display_name) !== null && _b !== void 0 ? _b : 'Unknown')}`); |
@@ -10,3 +10,3 @@ export const ORCID_URL = 'https://orcid.org'; | ||
*/ | ||
export function validate(value, opts) { | ||
function validate(value, opts) { | ||
const match = value === null || value === void 0 ? void 0 : value.match((opts === null || opts === void 0 ? void 0 : opts.strict) ? ORCID_REGEX_STRICT : ORCID_REGEX); | ||
@@ -23,3 +23,3 @@ if (!match) | ||
*/ | ||
export function normalize(value, opts) { | ||
function normalize(value, opts) { | ||
if (!value || !validate(value, opts)) | ||
@@ -35,3 +35,3 @@ return undefined; | ||
*/ | ||
export function buildUrl(value, opts) { | ||
function buildUrl(value, opts) { | ||
const orcid = normalize(value, opts); | ||
@@ -38,0 +38,0 @@ if (!orcid) |
@@ -1,2 +0,2 @@ | ||
const version = '0.0.2'; | ||
const version = '0.0.3'; | ||
export default version; |
@@ -11,3 +11,3 @@ export declare const ORCID_URL = "https://orcid.org"; | ||
*/ | ||
export declare function validate(value?: string | null, opts?: Options): boolean; | ||
declare function validate(value?: string | null, opts?: Options): boolean; | ||
/** | ||
@@ -19,3 +19,3 @@ * Normalize an input string to the ID part of an ORCID | ||
*/ | ||
export declare function normalize(value?: string | null, opts?: Options): string | undefined; | ||
declare function normalize(value?: string | null, opts?: Options): string | undefined; | ||
/** | ||
@@ -27,3 +27,3 @@ * Builds a canonical URL pointing to https://orcid.org | ||
*/ | ||
export declare function buildUrl(value?: string | null, opts?: Options): string | undefined; | ||
declare function buildUrl(value?: string | null, opts?: Options): string | undefined; | ||
declare const _default: { | ||
@@ -30,0 +30,0 @@ validate: typeof validate; |
@@ -1,3 +0,3 @@ | ||
declare const version = "0.0.2"; | ||
declare const version = "0.0.3"; | ||
export default version; | ||
//# sourceMappingURL=version.d.ts.map |
{ | ||
"name": "orcid", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"description": "Utilities for working with ORCID identifiers and service.", | ||
@@ -5,0 +5,0 @@ "sideEffects": false, |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
367497
20
9475
6