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

@krlwlfrt/tsg

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@krlwlfrt/tsg - npm Package Compare versions

Comparing version 0.7.0 to 0.8.0

4

CHANGELOG.md

@@ -0,1 +1,5 @@

# [0.8.0](https://gitlab.com/krlwlfrt/tsg/compare/v0.7.0...v0.8.0) (2021-03-05)
# [0.7.0](https://gitlab.com/krlwlfrt/tsg/compare/v0.6.1...v0.7.0) (2021-02-22)

@@ -2,0 +6,0 @@

10

lib/examples.d.ts
import { Property, ThingWithNameAndNamespace } from './index';
/**
* Generate name for a thing
*
* @param thing Thing to generate name for
*/
export declare function generateName(thing: ThingWithNameAndNamespace): string;
/**
* Example implementation to generate property types
*
* @param property Property to generate type for
*/
export declare function generatePropertyType(property: Property): string;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.generatePropertyType = exports.generateName = void 0;
/*
* Copyright (C) 2019, 2020 Karl-Philipp Wulfert
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
* Software Foundation, version 3.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <https://www.gnu.org/licenses/>.
*/
const index_1 = require("./index");
/**
* Generate name for a thing
*
* @param thing Thing to generate name for
*/
function generateName(thing) {

@@ -34,7 +15,2 @@ if (index_1.isAttribute(thing)) {

exports.generateName = generateName;
/**
* Example implementation to generate property types
*
* @param property Property to generate type for
*/
function generatePropertyType(property) {

@@ -55,2 +31,2 @@ let type = generateName(property.type);

exports.generatePropertyType = generatePropertyType;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZXh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QUFFLENBQUM7S0FDekM7SUFFRCxJQUFJLEtBQUssQ0FBQyxPQUFPLENBQUMsUUFBUSxDQUFDLFVBQVUsQ0FBQyxFQUFFO1FBQ3RDLEtBQUssTUFBTSxTQUFTLElBQUksUUFBUSxDQUFDLFVBQVUsRUFBRTtZQUMzQyxJQUFJLFNBQVMsQ0FBQyxJQUFJLEtBQUssVUFBVSxJQUFJLE9BQU8sU0FBUyxDQUFDLEtBQUssS0FBSyxTQUFTLElBQUksU0FBUyxDQUFDLEtBQUssRUFBRTtnQkFDNUYsSUFBSSxJQUFJLFNBQVMsQ0FBQzthQUNuQjtTQUNGO0tBQ0Y7SUFFRCxPQUFPLElBQUksQ0FBQztBQUNkLENBQUM7QUFoQkQsb0RBZ0JDIn0=

@@ -1,134 +0,35 @@

/**
* A thing with a name and a namespace
*/
export interface ThingWithNameAndNamespace {
/**
* An optional description for a thing
*/
description?: string;
/**
* Name of the thing
*/
name: string;
/**
* Namespace of the thing
*/
namespace?: string;
/**
* Default value
*/
value?: unknown;
}
/**
* A type
*/
export declare type Type = Entity | Property | Union | Enum;
/**
* An entity
*/
export interface Entity extends ThingWithNameAndNamespace {
/**
* Parent entity
*/
parent?: ThingWithNameAndNamespace;
/**
* List of properties
*/
properties: Property[];
}
/**
* A property of an entity
*/
export interface Property extends ThingWithNameAndNamespace {
/**
* Additional attributes that further define the property
*/
attributes?: Attribute[];
/**
* Whether or not the property can contain multiple instances
*/
multiple?: boolean;
/**
* Whether or not the property is required
*/
required?: boolean;
/**
* Type of the property
*/
type: ThingWithNameAndNamespace;
}
/**
* An attribute of a property
*/
export interface Attribute extends ThingWithNameAndNamespace {
/**
* Value of the attribute
*/
value: boolean | number | string;
}
/**
* A union of types
*/
export interface Union extends ThingWithNameAndNamespace {
/**
* List of united types
*/
unitedTypes: Array<(Type | string | number | boolean)>;
}
/**
* An enumeration of values
*/
export interface Enum extends ThingWithNameAndNamespace {
/**
* List of values
*/
items: Array<{
/**
* Key of the item
*/
key: string;
/**
* Value of the item
*/
value: string | number | boolean;
}>;
}
/**
* Check if a Type is an Entity
*
* @param type Type to check
*/
export declare function isEntity(type: Type): type is Entity;
/**
* Check if a Type is a Union
*
* @param type Type to check
*/
export declare function isUnion(type: Type): type is Union;
/**
* Check if a Type is an Enum
*
* @param type Type to check
*/
export declare function isEnum(type: Type): type is Enum;
/**
* Check if a ThingWithNameAndNamespace is an Attribute
*
* @param thing Thing to check
*/
export declare function isAttribute(thing: ThingWithNameAndNamespace): thing is Attribute;
/**
* Check for duplicate names
*
* @param types List of types to check
* @param checkNamespace Whether or not to check the namespace additionally to the name
*/
export declare function checkDuplicateNames(types: Type[], checkNamespace?: boolean): boolean;
/**
* Compile types to TypeScript code
*
* @param types List of types to compile
* @param nameGenerator Function to generate the name of a thing
* @param propertyTypeGenerator Function to generate the type of a property
*/
export declare function generateTypeScript(types: Type[], nameGenerator: (thing: ThingWithNameAndNamespace) => string, propertyTypeGenerator: (property: Property) => string): string;
"use strict";
/*
* Copyright (C) 2019, 2020 Karl-Philipp Wulfert
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
* Software Foundation, version 3.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <https://www.gnu.org/licenses/>.
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.generateTypeScript = exports.checkDuplicateNames = exports.isAttribute = exports.isEnum = exports.isUnion = exports.isEntity = void 0;
/**
* Check if a Type is an Entity
*
* @param type Type to check
*/
function isEntity(type) {

@@ -30,7 +11,2 @@ if (!('properties' in type)) {

exports.isEntity = isEntity;
/**
* Check if a Type is a Union
*
* @param type Type to check
*/
function isUnion(type) {

@@ -43,7 +19,2 @@ if (!('unitedTypes' in type)) {

exports.isUnion = isUnion;
/**
* Check if a Type is an Enum
*
* @param type Type to check
*/
function isEnum(type) {

@@ -56,7 +27,2 @@ if (!('items' in type)) {

exports.isEnum = isEnum;
/**
* Check if a ThingWithNameAndNamespace is an Attribute
*
* @param thing Thing to check
*/
function isAttribute(thing) {

@@ -69,10 +35,3 @@ if (!('value' in thing)) {

exports.isAttribute = isAttribute;
/**
* Check for duplicate names
*
* @param types List of types to check
* @param checkNamespace Whether or not to check the namespace additionally to the name
*/
function checkDuplicateNames(types, checkNamespace = false) {
// tslint:disable-next-line:no-magic-numbers
if (types.length < 2) {

@@ -86,3 +45,2 @@ return false;

if (!checkNamespace || types[i].namespace === types[j].namespace) {
// tslint:disable-next-line:no-console
console.info(`Found duplicate name '${types[i].name}' for pair [${i}, ${j}].`);

@@ -97,6 +55,2 @@ duplicateFound = true;

exports.checkDuplicateNames = checkDuplicateNames;
/**
* Quote property name if it is not alphanumerical
* @param name Name to quote
*/
function quotePropertyName(name) {

@@ -108,15 +62,9 @@ if (!/^[a-z0-9]*$/i.test(name)) {

}
/**
* Compile types to TypeScript code
*
* @param types List of types to compile
* @param nameGenerator Function to generate the name of a thing
* @param propertyTypeGenerator Function to generate the type of a property
*/
function generateTypeScript(types, nameGenerator, propertyTypeGenerator) {
if (checkDuplicateNames(types)) {
// tslint:disable-next-line:no-console
console.info('CAUTION: Duplicate names found!');
}
let output = `/* tslint:disable */\n`;
let output = `/* eslint-disable */
/* tslint:disable */
`;
while (types.length > 0) {

@@ -218,2 +166,2 @@ const type = types.shift();

exports.generateTypeScript = generateTypeScript;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBOzs7Ozs7Ozs7Ozs7O0dBYUc7OztBQStHSDs7OztHQUlHO0FBQ0gsU0FBZ0IsUUFBUSxDQUFDLElBQVU7SUFDakMsSUFBSSxDQUFDL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UFBYSxDQUFDLElBQUksQ0FBQyxLQUFLLENBQUM7WUFFbEQsSUFBSSxJQUFJLENBQUMsUUFBUSxLQUFLLElBQUksRUFBRTtnQkFDMUIsSUFBSSxZQUFZLENBQUMsT0FBTyxDQUFDLEdBQUcsQ0FBQyxJQUFJLENBQUMsRUFBRTtvQkFDbEMsTUFBTSxJQUFJLFNBQVMsWUFBWSxHQUFHLENBQUM7aUJBQ3BDO3FCQUFNO29CQUNMLE1BQU0sSUFBSSxHQUFHLFlBQVksSUFBSSxDQUFDO2lCQUMvQjthQUNGO2lCQUFNO2dCQUNMLE1BQU0sSUFBSSxHQUFHLFlBQVksRUFBRSxDQUFDO2FBQzdCO1lBRUQsTUFBTSxJQUFJLEtBQUssQ0FBQztTQUNqQjtLQUNGO0lBRUQsT0FBTyxNQUFNLENBQUM7QUFDaEIsQ0FBQztBQTlIRCxnREE4SEMifQ==
{
"name": "@krlwlfrt/tsg",
"version": "0.7.0",
"version": "0.8.0",
"description": "TypeScript generator",

@@ -16,32 +16,26 @@ "repository": {

"devDependencies": {
"@openstapps/configuration": "0.26.0",
"@krlwlfrt/otpc": "0.1.3",
"@testdeck/mocha": "0.1.2",
"@types/chai": "4.2.15",
"@types/mocha": "8.2.1",
"@types/node": "14.14.31",
"chai": "4.3.0",
"@typescript-eslint/eslint-plugin": "4.16.1",
"@typescript-eslint/parser": "4.16.1",
"conventional-changelog-cli": "2.1.1",
"eslint": "7.21.0",
"mocha": "8.3.0",
"nyc": "15.1.0",
"prepend-file-cli": "1.0.6",
"rimraf": "3.0.2",
"ts-node": "9.1.1",
"tslint": "6.1.3",
"tslint-eslint-rules": "5.4.0",
"typedoc": "0.20.27",
"typescript": "4.1.5"
"typedoc": "0.20.29",
"typescript": "4.2.3"
},
"scripts": {
"build": "npm run tslint && npm run compile",
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 0 && git add CHANGELOG.md && git commit -m 'docs: update changelog'",
"check-configuration": "openstapps-configuration",
"build": "npm run lint && npm run compile",
"compile": "rimraf lib && tsc",
"documentation": "typedoc --out docs --readme README.md --listInvalidSymbolLinks src",
"postversion": "npm run changelog",
"prepublishOnly": "npm ci && npm run build",
"preversion": "npm run prepublishOnly",
"lint": "eslint src --ext .ts",
"prepublishOnly": "npm ci && npm run build && npm test",
"push": "git push && git push origin \"v$npm_package_version\"",
"test": "nyc mocha --require ts-node/register 'test/**/*.spec.ts'",
"tslint": "tslint -p tsconfig.json -c tslint.json 'src/**/*.ts'",
"typedoc": "typedoc --includeDeclarations --mode modules --out docs --readme README.md --listInvalidSymbolLinks src"
"version": "conventional-changelog -p angular -i CHANGELOG.md -s -r 0 && git add CHANGELOG.md"
},

@@ -73,3 +67,3 @@ "main": "./lib/index.js",

"html",
"text-summary"
"text"
],

@@ -80,11 +74,3 @@ "require": [

"statements": 95
},
"openstappsConfiguration": {
"ignoreScripts": [
"compile"
],
"ignoreCiEntries": [
"package"
]
}
}

@@ -184,3 +184,3 @@ /*

export function checkDuplicateNames(types: Type[], checkNamespace = false): boolean {
// tslint:disable-next-line:no-magic-numbers
// eslint-disable-next-line no-magic-numbers
if (types.length < 2) {

@@ -192,3 +192,5 @@ return false;

// eslint-disable-next-line no-magic-numbers
for (let i = 0; i < types.length - 1; i++) {
// eslint-disable-next-line no-magic-numbers
for (let j = i + 1; j < types.length; j++) {

@@ -236,3 +238,5 @@ if (types[i].name === types[j].name) {

let output = `/* tslint:disable */\n`;
let output = `/* eslint-disable */
/* tslint:disable */
`;

@@ -239,0 +243,0 @@ while (types.length > 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