smartnpm/ts/smartnpm.classes.npmpackage.ts

42 lines
836 B
TypeScript
Raw Normal View History

2018-09-01 14:40:42 +00:00
import * as plugins from './smartnpm.plugins';
2017-08-14 15:50:48 +00:00
export class NpmPackage {
2018-09-01 14:40:42 +00:00
name: string = null;
scope: string = null;
version: string = null;
description: string = null;
keywords: string[] = null;
date: '2017-08-02T11:22:49.144Z';
2017-08-15 15:03:21 +00:00
links: {
2018-09-01 14:40:42 +00:00
npm: string;
homepage: string;
repository: string;
bugs: string;
} = null;
2017-08-15 15:03:21 +00:00
author: {
2018-09-01 14:40:42 +00:00
name: 'Lossless GmbH';
} = null;
2017-08-15 15:03:21 +00:00
publisher: {
2018-09-01 14:40:42 +00:00
username: 'gitzone';
email: 'npm@git.zone';
} = null;
maintainers: any = null;
2017-08-15 15:03:21 +00:00
score: {
2018-09-01 14:40:42 +00:00
final: number;
2017-08-15 15:03:21 +00:00
detail: {
2018-09-01 14:40:42 +00:00
quality: number;
popularity: number;
maintenance: number;
};
} = null;
searchScore: number = null;
2017-08-15 15:03:21 +00:00
2018-09-01 14:40:42 +00:00
constructor(descriptionArg) {
2017-08-15 15:03:21 +00:00
for (let key in descriptionArg) {
if (this[key] === null) {
2018-09-01 14:40:42 +00:00
this[key] = descriptionArg[key];
2017-08-15 15:03:21 +00:00
}
}
2017-08-14 15:50:48 +00:00
}
}