raml-typesystem
Advanced tools
Comparing version 0.0.18 to 0.0.19
@@ -46,3 +46,3 @@ export import nominalTypes = require("./nominal-types"); | ||
validate(i: any, autoClose?: boolean): IStatus; | ||
validateType(reg: ITypeRegistry): IStatus; | ||
validateType(reg?: ITypeRegistry): IStatus; | ||
ac(i: any): IParsedType; | ||
@@ -49,0 +49,0 @@ canDoAc(i: any): IStatus; |
@@ -106,3 +106,3 @@ /// <reference path="../../typings/main.d.ts" /> | ||
superTypes(): AbstractType[]; | ||
validateType(tr: TypeRegistry): Status; | ||
validateType(tr?: TypeRegistry): Status; | ||
validateHierarchy(rs: Status): void; | ||
@@ -109,0 +109,0 @@ private familyWithArray(); |
@@ -331,2 +331,3 @@ "use strict"; | ||
var _this = this; | ||
if (tr === void 0) { tr = builtInRegistry(); } | ||
var rs = new Status(Status.OK, 0, "", this); | ||
@@ -333,0 +334,0 @@ this.validateHierarchy(rs); |
@@ -32,3 +32,3 @@ var gulp = require('gulp'); | ||
mode: "file", | ||
readme:"readmeTypeDoc.txt" | ||
readme:"readmeTypeDoc.md" | ||
})) | ||
@@ -58,2 +58,1 @@ ; | ||
gulp.task('build',['typescript:compile']); | ||
{ | ||
"name": "raml-typesystem", | ||
"version": "0.0.18", | ||
"private": false, | ||
"version": "0.0.19", | ||
"main": "dist/src/index.js", | ||
"scripts": { | ||
"test-cov": " ./node_modules/.bin/istanbul cover _mocha dist/tests/*Tests.js", | ||
"typings-for-idea": "node ./tools/createDeclarations", | ||
"build": "rm -rf dist/ && ./node_modules/typescript/bin/tsc ", | ||
"build-browser": "./node_modules/.bin/webpack --entry ./src/browser.js --output-path ./browser --output-filename bundle.js --verbose --profile --display-modules " | ||
"build": "rm -rf dist/ && ./node_modules/typescript/bin/tsc " | ||
}, | ||
@@ -21,3 +18,3 @@ "dependencies": { | ||
"type": "git", | ||
"url": "https://github.com/mulesoft/typesystem-ts.git" | ||
"url": "https://github.com/raml-org/typesystem-ts.git" | ||
}, | ||
@@ -28,6 +25,6 @@ "keywords": [ | ||
], | ||
"homepage": "https://github.com/mulesoft/typesystem-ts", | ||
"homepage": "https://github.com/raml-org/typesystem-ts", | ||
"license": "Apache-2.0", | ||
"bugs": { | ||
"url": "https://github.com/mulesoft/typesystem-ts/issues" | ||
"url": "https://github.com/raml-org/typesystem-ts/issues" | ||
}, | ||
@@ -41,9 +38,7 @@ "typings": "./dist/src/index.d.ts", | ||
"istanbul": "^0.4.2", | ||
"json-loader": "^0.5.1", | ||
"mocha": "^2.2.1", | ||
"typedoc": "^0.3.12", | ||
"typescript": "1.8.7", | ||
"typings": "^0.5.1", | ||
"webpack": "^1.3.7" | ||
"typings": "^0.5.1" | ||
} | ||
} | ||
} |
@@ -1,5 +0,49 @@ | ||
RAML TypeSystem | ||
# RAML Data Type System | ||
This module contains an lightweight implementation of typesystem for [RAML 1.0](http://raml.org) | ||
This module contains a lightweight implementation of the type system that was introduced with [RAML 1.0](http://raml.org). | ||
It allows you to to parse, validate , modify RAML types, as well as store them back to JSON | ||
It allows you to to parse, validate , modify RAML types, as well as store them back to JSON. | ||
## Installation | ||
``` | ||
npm install raml-typesystem --save | ||
``` | ||
## Usage | ||
Parsing and validating a single type: | ||
```js | ||
import ts = require("raml-typesystem") | ||
var personType = ts.parseJSON("Person", { | ||
type: "string[]", | ||
minItems:3, | ||
maxItems:2 | ||
}) | ||
var isValid = personType.validateType(); | ||
``` | ||
Parsing and validating a `types` collection: | ||
```js | ||
import ts = require("raml-typesystem") | ||
var typeCollection = ts.parseJSONTypeCollection({ | ||
types: { | ||
Person: { | ||
type: "object", | ||
properties:{ | ||
kind: "string" | ||
} | ||
}, | ||
Man: { | ||
type: "Person", | ||
discriminator: "kind" | ||
} | ||
} | ||
}) | ||
var isValid = typeCollection.getType("Person").validateType() | ||
``` |
@@ -189,3 +189,3 @@ import ts=require("./typesystem") | ||
validateType(reg:ITypeRegistry):IStatus | ||
validateType(reg?:ITypeRegistry):IStatus | ||
@@ -192,0 +192,0 @@ ac(i:any):IParsedType |
@@ -411,3 +411,3 @@ /// <reference path="../typings/main.d.ts" /> | ||
validateType(tr:TypeRegistry):Status{ | ||
validateType(tr:TypeRegistry=builtInRegistry()):Status{ | ||
var rs=new Status(Status.OK,0,"",this); | ||
@@ -414,0 +414,0 @@ this.validateHierarchy(rs); |
@@ -1703,2 +1703,2 @@ import ps= require("./actualParse") | ||
}) | ||
}) |
@@ -1,3 +0,3 @@ | ||
// Compiled using typings@0.3.3 | ||
// Source: https://raw.githubusercontent.com/definitelytyped/DefinitelyTyped/be0b6b394f77a59e192ad7cfec18078706e44db5/chai/chai.d.ts | ||
// Compiled using typings@0.6.8 | ||
// Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/be0b6b394f77a59e192ad7cfec18078706e44db5/chai/chai.d.ts | ||
// Type definitions for chai 2.0.0 | ||
@@ -4,0 +4,0 @@ // Project: http://chaijs.com/ |
@@ -1,3 +0,3 @@ | ||
// Compiled using typings@0.3.3 | ||
// Source: https://raw.githubusercontent.com/definitelytyped/DefinitelyTyped/7de6c3dd94feaeb21f20054b9f30d5dabc5efabd/mocha/mocha.d.ts | ||
// Compiled using typings@0.6.8 | ||
// Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/7de6c3dd94feaeb21f20054b9f30d5dabc5efabd/mocha/mocha.d.ts | ||
// Type definitions for mocha 2.2.5 | ||
@@ -4,0 +4,0 @@ // Project: http://mochajs.org/ |
@@ -1,3 +0,3 @@ | ||
// Compiled using typings@0.3.3 | ||
// Source: https://raw.githubusercontent.com/definitelytyped/DefinitelyTyped/7304e0770d53762f89af7fcf14517d5f45a04cc2/xml2js/xml2js.d.ts | ||
// Compiled using typings@0.6.8 | ||
// Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/7304e0770d53762f89af7fcf14517d5f45a04cc2/xml2js/xml2js.d.ts | ||
// Type definitions for node-xml2js | ||
@@ -4,0 +4,0 @@ // Project: https://github.com/Leonidas-from-XIV/node-xml2js |
@@ -1,3 +0,3 @@ | ||
// Compiled using typings@0.3.3 | ||
// Source: https://raw.githubusercontent.com/definitelytyped/DefinitelyTyped/be0b6b394f77a59e192ad7cfec18078706e44db5/chai/chai.d.ts | ||
// Compiled using typings@0.6.8 | ||
// Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/be0b6b394f77a59e192ad7cfec18078706e44db5/chai/chai.d.ts | ||
// Type definitions for chai 2.0.0 | ||
@@ -4,0 +4,0 @@ // Project: http://chaijs.com/ |
@@ -1,3 +0,3 @@ | ||
// Compiled using typings@0.3.3 | ||
// Source: https://raw.githubusercontent.com/definitelytyped/DefinitelyTyped/7de6c3dd94feaeb21f20054b9f30d5dabc5efabd/mocha/mocha.d.ts | ||
// Compiled using typings@0.6.8 | ||
// Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/7de6c3dd94feaeb21f20054b9f30d5dabc5efabd/mocha/mocha.d.ts | ||
// Type definitions for mocha 2.2.5 | ||
@@ -4,0 +4,0 @@ // Project: http://mochajs.org/ |
@@ -1,3 +0,3 @@ | ||
// Compiled using typings@0.3.3 | ||
// Source: https://raw.githubusercontent.com/definitelytyped/DefinitelyTyped/7304e0770d53762f89af7fcf14517d5f45a04cc2/xml2js/xml2js.d.ts | ||
// Compiled using typings@0.6.8 | ||
// Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/7304e0770d53762f89af7fcf14517d5f45a04cc2/xml2js/xml2js.d.ts | ||
// Type definitions for node-xml2js | ||
@@ -4,0 +4,0 @@ // Project: https://github.com/Leonidas-from-XIV/node-xml2js |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
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
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
9
1
1
50
3
1465951
128
33323