ts-graphviz
Advanced tools
Comparing version 1.4.1-dev.d42db466f to 1.5.0
@@ -0,1 +1,11 @@ | ||
function escapeValue(value) { | ||
if (value !== true) { | ||
if (typeof value === 'string' && /\s/g.test(value)) { | ||
return `="${value}"`; | ||
} else { | ||
return `=${value}`; | ||
} | ||
} | ||
return ''; | ||
} | ||
function* args(options) { | ||
@@ -7,4 +17,3 @@ const { suppressWarnings = true, format = 'svg', attributes = {}, library = [], y = false, scale } = options; | ||
for (const [key, value] of Object.entries(attributes.graph)) { | ||
if (value === true) yield `-G${key}`; | ||
else yield `-G${key}="${value}"`; | ||
yield `-G${key}${escapeValue(value)}`; | ||
} | ||
@@ -14,4 +23,3 @@ } | ||
for (const [key, value] of Object.entries(attributes.node)) { | ||
if (value === true) yield `-N${key}`; | ||
else yield `-N${key}="${value}"`; | ||
yield `-N${key}${escapeValue(value)}`; | ||
} | ||
@@ -21,4 +29,3 @@ } | ||
for (const [key, value] of Object.entries(attributes.edge)) { | ||
if (value === true) yield `-E${key}`; | ||
else yield `-E${key}="${value}"`; | ||
yield `-E${key}${escapeValue(value)}`; | ||
} | ||
@@ -25,0 +32,0 @@ } |
238
package.json
{ | ||
"name": "ts-graphviz", | ||
"version": "1.4.1-dev.d42db466f", | ||
"author": "kamiazya <yuki@kamiazya.tech>", | ||
"description": "Graphviz library for TypeScript.", | ||
"homepage": "https://ts-graphviz.github.io/ts-graphviz/", | ||
"type": "module", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/ts-graphviz/ts-graphviz.git" | ||
"name": "ts-graphviz", | ||
"version": "1.5.0", | ||
"author": "kamiazya <yuki@kamiazya.tech>", | ||
"description": "Graphviz library for TypeScript.", | ||
"homepage": "https://ts-graphviz.github.io/ts-graphviz/", | ||
"type": "module", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/ts-graphviz/ts-graphviz.git" | ||
}, | ||
"keywords": [ | ||
"graphviz", | ||
"dot" | ||
], | ||
"bugs": { | ||
"url": "https://github.com/ts-graphviz/ts-graphviz/issues" | ||
}, | ||
"funding": { | ||
"type": "github", | ||
"url": "https://github.com/sponsors/kamiazya" | ||
}, | ||
"main": "./lib/index.cjs", | ||
"module": "./lib/index.js", | ||
"types": "lib/index.d.ts", | ||
"exports": { | ||
".": { | ||
"require": { | ||
"types": "./lib/index.d.ts", | ||
"default": "./lib/index.cjs" | ||
}, | ||
"import": { | ||
"types": "./lib/index.d.ts", | ||
"default": "./lib/index.js" | ||
} | ||
}, | ||
"keywords": [ | ||
"graphviz", | ||
"dot" | ||
], | ||
"bugs": { | ||
"url": "https://github.com/ts-graphviz/ts-graphviz/issues" | ||
"./ast": { | ||
"require": { | ||
"types": "./lib/ast/index.d.ts", | ||
"default": "./lib/ast/index.cjs" | ||
}, | ||
"import": { | ||
"types": "./lib/ast/index.d.ts", | ||
"default": "./lib/ast/index.js" | ||
} | ||
}, | ||
"funding": { | ||
"type": "github", | ||
"url": "https://github.com/sponsors/kamiazya" | ||
"./adapter": { | ||
"browser": { | ||
"require": "./lib/adapter/browser/index.cjs", | ||
"import": "./lib/adapter/browser/index.js", | ||
"types": "./lib/adapter/browser/index.d.ts" | ||
}, | ||
"deno": { | ||
"types": "./lib/adapter/deno/mod.d.ts", | ||
"default": "./lib/adapter/deno/mod.js" | ||
}, | ||
"node": { | ||
"require": "./lib/adapter/node/index.cjs", | ||
"import": "./lib/adapter/node/index.js", | ||
"types": "./lib/adapter/node/index.d.ts" | ||
}, | ||
"default": { | ||
"types": "./lib/adapter/node/index.d.ts", | ||
"require": "./lib/adapter/node/index.cjs", | ||
"import": "./lib/adapter/node/index.js" | ||
} | ||
}, | ||
"main": "./lib/index.cjs", | ||
"module": "./lib/index.js", | ||
"types": "lib/index.d.ts", | ||
"exports": { | ||
".": { | ||
"require": { | ||
"types": "./lib/index.d.ts", | ||
"default": "./lib/index.cjs" | ||
}, | ||
"import": { | ||
"types": "./lib/index.d.ts", | ||
"default": "./lib/index.js" | ||
} | ||
}, | ||
"./ast": { | ||
"require": { | ||
"types": "./lib/ast/index.d.ts", | ||
"default": "./lib/ast/index.cjs" | ||
}, | ||
"import": { | ||
"types": "./lib/ast/index.d.ts", | ||
"default": "./lib/ast/index.js" | ||
} | ||
}, | ||
"./adapter": { | ||
"browser": { | ||
"require": "./lib/adapter/browser/index.cjs", | ||
"import": "./lib/adapter/browser/index.js", | ||
"types": "./lib/adapter/browser/index.d.ts" | ||
}, | ||
"deno": { | ||
"types": "./lib/adapter/deno/mod.d.ts", | ||
"default": "./lib/adapter/deno/mod.js" | ||
}, | ||
"node": { | ||
"require": "./lib/adapter/node/index.cjs", | ||
"import": "./lib/adapter/node/index.js", | ||
"types": "./lib/adapter/node/index.d.ts" | ||
}, | ||
"default": { | ||
"types": "./lib/adapter/node/index.d.ts", | ||
"require": "./lib/adapter/node/index.cjs", | ||
"import": "./lib/adapter/node/index.js" | ||
} | ||
}, | ||
"./package.json": "./package.json" | ||
}, | ||
"typesVersions": { | ||
"*": { | ||
"ast": [ | ||
"lib/ast" | ||
], | ||
"adapter": [ | ||
"lib/adapter/node" | ||
] | ||
} | ||
}, | ||
"license": "MIT", | ||
"engines": { | ||
"node": ">=14.16" | ||
}, | ||
"scripts": { | ||
"build:peggy": "peggy --plugin ts-pegjs --extra-options-file src/ast/dot-shim/parser/peggy.options.json -o src/ast/dot-shim/parser/_parse.ts src/ast/dot-shim/parser/dot.peggy", | ||
"prebuild": "yarn build:peggy", | ||
"build:deno": "mkdir -p lib/adapter/deno && cp -r src/adapter/deno/* lib/adapter/deno && sed -i \"s/index.ts/index.js/g\" lib/adapter/deno/mod.js && sed -i \"s/index.ts/index.d.ts/g\" lib/adapter/deno/mod.d.ts", | ||
"build:node": "tsc -p tsconfig.build.json && rollup -c", | ||
"build": "yarn build:node && yarn build:deno", | ||
"postbuild": "prettier --write ./lib/**/*.{js,cjs,d.ts}", | ||
"pretest": "yarn build:peggy", | ||
"test": "NODE_OPTIONS='--experimental-vm-modules --no-warnings' jest", | ||
"format": "eslint --ext ts src --fix && prettier --write './**/*.{ts,js,json,yaml}' '!lib'", | ||
"lint": "eslint --ext ts src", | ||
"predoc": "yarn build:peggy", | ||
"doc": "typedoc" | ||
}, | ||
"devDependencies": { | ||
"@rollup/plugin-replace": "^4.0.0", | ||
"@types/jest": "^28.1.6", | ||
"@types/jest-specific-snapshot": "^0.5.6", | ||
"@typescript-eslint/eslint-plugin": "^5.33.0", | ||
"@typescript-eslint/parser": "^5.33.0", | ||
"eslint": "^8.22.0", | ||
"eslint-config-prettier": "^8.5.0", | ||
"eslint-plugin-import": "^2.26.0", | ||
"eslint-plugin-jest": "^26.8.2", | ||
"eslint-plugin-prettier": "^4.2.1", | ||
"jest": "^28.1.3", | ||
"jest-snapshot-serializer-raw": "^1.2.0", | ||
"jest-specific-snapshot": "^5.0.0", | ||
"peggy": "^2.0.1", | ||
"prettier": "^2.7.1", | ||
"prettier-plugin-pegjs": "^0.5.0", | ||
"rollup": "^2.77.3", | ||
"rollup-plugin-delete": "^2.0.0", | ||
"rollup-plugin-dts": "^4.2.2", | ||
"svgo": "^2.8.0", | ||
"ts-jest": "^28.0.7", | ||
"ts-pegjs": "^2.1.0", | ||
"typedoc": "^0.23.15", | ||
"typescript": "^4.7.4" | ||
"./package.json": "./package.json" | ||
}, | ||
"typesVersions": { | ||
"*": { | ||
"ast": [ | ||
"lib/ast" | ||
], | ||
"adapter": [ | ||
"lib/adapter/node" | ||
] | ||
} | ||
} | ||
}, | ||
"license": "MIT", | ||
"engines": { | ||
"node": ">=14.16" | ||
}, | ||
"scripts": { | ||
"build:peggy": "peggy --plugin ts-pegjs --extra-options-file src/ast/dot-shim/parser/peggy.options.json -o src/ast/dot-shim/parser/_parse.ts src/ast/dot-shim/parser/dot.peggy", | ||
"prebuild": "yarn build:peggy", | ||
"build:deno": "mkdir -p lib/adapter/deno && cp -r src/adapter/deno/* lib/adapter/deno && sed -i \"s/index.ts/index.js/g\" lib/adapter/deno/mod.js && sed -i \"s/index.ts/index.d.ts/g\" lib/adapter/deno/mod.d.ts", | ||
"build:node": "tsc -p tsconfig.build.json && rollup -c", | ||
"build": "yarn build:node && yarn build:deno", | ||
"postbuild": "prettier --write ./lib/**/*.{js,cjs,d.ts}", | ||
"pretest": "yarn build:peggy", | ||
"test": "NODE_OPTIONS='--experimental-vm-modules --no-warnings' jest", | ||
"format": "eslint --ext ts src --fix && prettier --write './**/*.{ts,js,json,yaml}' '!lib'", | ||
"lint": "eslint --ext ts src", | ||
"predoc": "yarn build:peggy", | ||
"doc": "typedoc" | ||
}, | ||
"devDependencies": { | ||
"@rollup/plugin-replace": "^4.0.0", | ||
"@types/jest": "^28.1.6", | ||
"@types/jest-specific-snapshot": "^0.5.6", | ||
"@typescript-eslint/eslint-plugin": "^5.33.0", | ||
"@typescript-eslint/parser": "^5.33.0", | ||
"eslint": "^8.22.0", | ||
"eslint-config-prettier": "^8.5.0", | ||
"eslint-plugin-import": "^2.26.0", | ||
"eslint-plugin-jest": "^26.8.2", | ||
"eslint-plugin-prettier": "^4.2.1", | ||
"jest": "^28.1.3", | ||
"jest-snapshot-serializer-raw": "^1.2.0", | ||
"jest-specific-snapshot": "^5.0.0", | ||
"peggy": "^2.0.1", | ||
"prettier": "^2.7.1", | ||
"prettier-plugin-pegjs": "^0.5.0", | ||
"rollup": "^2.77.3", | ||
"rollup-plugin-delete": "^2.0.0", | ||
"rollup-plugin-dts": "^4.2.2", | ||
"svgo": "^2.8.0", | ||
"ts-jest": "^28.0.7", | ||
"ts-pegjs": "^2.1.0", | ||
"typedoc": "^0.23.15", | ||
"typescript": "^4.7.4" | ||
} | ||
} |
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
18915
0
567967