This commit is contained in:
2024-12-17 14:36:15 -08:00
parent b2dbf46d28
commit 06d106de53
17731 changed files with 3037186 additions and 144 deletions

16
backend/frontend/node_modules/tcomb/lib/isIdentity.js generated vendored Normal file
View File

@@ -0,0 +1,16 @@
var assert = require('./assert');
var Boolean = require('./Boolean');
var isType = require('./isType');
var getTypeName = require('./getTypeName');
// return true if the type constructor behaves like the identity function
module.exports = function isIdentity(type) {
if (isType(type)) {
if (process.env.NODE_ENV !== 'production') {
assert(Boolean.is(type.meta.identity), function () { return 'Invalid meta identity ' + assert.stringify(type.meta.identity) + ' supplied to type ' + getTypeName(type); });
}
return type.meta.identity;
}
// for tcomb the other constructors, like ES6 classes, are identity-like
return true;
};