rtts-assert
Advanced tools
Comparing version 0.0.7 to 2.0.0-alpha.6
{ | ||
"name": "rtts-assert", | ||
"version": "0.0.7", | ||
"description": "A type assertion library for Traceur.", | ||
"main": "./dist/cjs/assert.js", | ||
"homepage": "https://github.com/angular/assert", | ||
"repository": { | ||
"type": "git", | ||
"url": "git://github.com/angular/assert.git" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/angular/assert/issues" | ||
}, | ||
"dependencies": {}, | ||
"version": "2.0.0-alpha.6", | ||
"description": "A run-time type assertion library for JavaScript", | ||
"homepage": "https://github.com/angular/angular", | ||
"bugs": "https://github.com/angular/angular/issues", | ||
"contributors": {"Alex Eagle":"alexeagle@google.com","Chirayu Krishnappa":"chirayu@google.com","Jeff Cross":"crossj@google.com","Misko Hevery":"misko@google.com","Rado Kirov":"radokirov@google.com","Tobias Bosch":"tbosch@google.com","Victor Savkin":"vsavkin@google.com","Yegor Jbanov":"yjbanov@google.com"}, | ||
"license": "Apache-2.0", | ||
"devDependencies": { | ||
"gulp": "^3.5.6", | ||
"gulp-connect": "~1.0.5", | ||
"gulp-traceur": "~0.4.0", | ||
"karma": "^0.12.1", | ||
"karma-chrome-launcher": "^0.1.2", | ||
"karma-jasmine": "^0.2.2", | ||
"karma-requirejs": "^0.2.1", | ||
"karma-traceur-preprocessor": "^0.2.2", | ||
"pipe": "git://github.com/angular/pipe#remove-transitive-deps" | ||
}, | ||
"scripts": { | ||
"test": "karma start --single-run" | ||
}, | ||
"author": "Vojta Jína <vojta.jina@gmail.com>", | ||
"license": "Apache-2.0" | ||
"yargs": "2.3.*", | ||
"gulp-sourcemaps": "1.3.*", | ||
"gulp-traceur": "0.16.*", | ||
"gulp": "^3.8.8", | ||
"gulp-rename": "^1.2.0", | ||
"through2": "^0.6.1" | ||
} | ||
} |
@@ -1,1 +0,60 @@ | ||
http://angular.github.io/assert/ | ||
# Rtts-Assert | ||
A run-time type assertion library for JavaScript. | ||
Designed to be used with [Traceur](https://github.com/google/traceur-compiler). | ||
All sources are in ES6 format and have the suffix `.es6`. They don't depend on any runtime | ||
and can be used by any modern ES6 -> ES5 transpiler. | ||
As a convenience, we provide you with `es5build.js`, a script to transpile the sources into es5 | ||
using [Google Traceur](https://github.com/google/traceur-compiler/). | ||
License: Apache MIT 2.0 | ||
## API | ||
``` | ||
// Asserting APIs: | ||
// - generated by Traceur (based on type annotations) | ||
// - can be also used in tests for instance | ||
assert.type(something, Type); | ||
assert.returnType(returnValue, Type); | ||
assert.argumentTypes(firstArg, Type, secondArg, Type); | ||
// this can be used anywhere in the code | ||
// (useful inside test, when we don't wanna define an interface) | ||
assert(value).is(...) | ||
// Custom type assert: | ||
// - i have a custom type | ||
// - adding an assert methos | ||
assert.define(MyUser, function(value) { | ||
assert(value).is(Type, Type2); // or | ||
assert(value, 'name').is(assert.string); | ||
assert(value, 'contact').is(assert.structure({ | ||
email: assert.string, | ||
cell: assert.string | ||
})); | ||
assert(value, 'contacts').is(assert.arrayOf(assert.structure({email: assert.string}))); | ||
}); | ||
// Define interface (an empty type with assert method) | ||
// - returns an empty class with assert method | ||
var Email = assert.define('IEmail', function(value) { | ||
assert(value).is(String); | ||
if (value.indexOf('@') !== -1) { | ||
assert.fail('has to contain "@"'); | ||
} | ||
}); | ||
// Predefined types | ||
assert.string | ||
assert.number | ||
assert.boolean | ||
assert.arrayOf(...types) | ||
assert.structure(object) | ||
``` |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
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 contributors or author data
MaintenancePackage does not specify a list of contributors or an author in package.json.
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 repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
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
NPM Shrinkwrap
Supply chain riskPackage contains a shrinkwrap file. This may allow the package to bypass normal install procedures.
Found 1 instance in 1 package
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 3 instances in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
6
60
0
2
40202
8
74
3
2