var types = require("../lib/types"); var Type = types.Type; var builtin = types.builtInTypes; var isNumber = builtin.number; // An example of constructing a new type with arbitrary constraints from // an existing type. exports.geq = function(than) { return new Type(function(value) { return isNumber.check(value) && value >= than; }, isNumber + " >= " + than); }; // Default value-returning functions that may optionally be passed as a // third argument to Def.prototype.field. exports.defaults = { // Functions were used because (among other reasons) that's the most // elegant way to allow for the emptyArray one always to give a new // array instance. "null": function() { return null }, "emptyArray": function() { return [] }, "false": function() { return false }, "true": function() { return true }, "undefined": function() {} }; var naiveIsPrimitive = Type.or( builtin.string, builtin.number, builtin.boolean, builtin.null, builtin.undefined ); exports.isPrimitive = new Type(function(value) { if (value === null) return true; var type = typeof value; return !(type === "object" || type === "function"); }, naiveIsPrimitive.toString());
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#1 | 19553 | swellard | Move and rename clients | ||
//guest/perforce_software/helix-web-services/main/source/clients/2016.1.0/javascript/node_modules/ast-types/lib/shared.js | |||||
#1 | 19053 | tjuricek |
Rebuild JavaScript Client SDK. The JavaScript client now is a "typed" approach that tends to be similar in approach to the other clients, based on the swagger definition for the platform version. Importantly, client SDK tests are individual scripts (that run under node) that are actually controlled via TestNG. This approach now lets us use a consistent test reporting format so we can at least collect reports from each of the jobs. The documentation is still in progress, that I want to validate as the tests are generated. |