realm-js/lib/constants.js

49 lines
698 B
JavaScript

'use strict';
let keys = {};
let objectTypes = {};
let propTypes = {};
[
'id',
'realm',
'resize',
'type',
].forEach(function(name) {
keys[name] = Symbol();
});
[
'FUNCTION',
'NOTIFICATION',
'REALM',
'RESULTS',
].forEach(function(type) {
Object.defineProperty(objectTypes, type, {
value: 'ObjectTypes' + type,
});
});
[
'BOOL',
'INT',
'FLOAT',
'DOUBLE',
'STRING',
'DATE',
'DATA',
'OBJECT',
'LIST',
].forEach(function(type) {
Object.defineProperty(propTypes, type, {
value: 'PropTypes' + type,
enumerable: true,
});
});
module.exports = {
keys,
objectTypes,
propTypes
};