2016-02-18 11:59:34 -08:00
|
|
|
////////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
|
|
|
// Copyright 2016 Realm Inc.
|
|
|
|
//
|
|
|
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
// you may not use this file except in compliance with the License.
|
|
|
|
// You may obtain a copy of the License at
|
|
|
|
//
|
|
|
|
// http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
//
|
|
|
|
// Unless required by applicable law or agreed to in writing, software
|
|
|
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
// See the License for the specific language governing permissions and
|
|
|
|
// limitations under the License.
|
|
|
|
//
|
|
|
|
////////////////////////////////////////////////////////////////////////////
|
2015-10-28 10:37:17 -07:00
|
|
|
|
2015-10-19 16:19:43 -07:00
|
|
|
'use strict';
|
|
|
|
|
2016-02-28 12:36:30 -08:00
|
|
|
export const keys = {};
|
|
|
|
export const objectTypes = {};
|
|
|
|
export const propTypes = {};
|
2015-10-19 16:19:43 -07:00
|
|
|
|
|
|
|
[
|
|
|
|
'id',
|
|
|
|
'realm',
|
|
|
|
'type',
|
|
|
|
].forEach(function(name) {
|
2017-01-11 18:22:41 +01:00
|
|
|
keys[name] = Symbol(name);
|
2015-10-19 16:19:43 -07:00
|
|
|
});
|
|
|
|
|
|
|
|
[
|
2015-11-02 22:16:50 -08:00
|
|
|
'DATA',
|
|
|
|
'DATE',
|
2015-11-02 16:36:24 -08:00
|
|
|
'DICT',
|
2015-10-19 16:19:43 -07:00
|
|
|
'FUNCTION',
|
2015-11-02 22:16:50 -08:00
|
|
|
'LIST',
|
|
|
|
'OBJECT',
|
2015-10-19 16:19:43 -07:00
|
|
|
'REALM',
|
|
|
|
'RESULTS',
|
2017-01-31 14:07:29 +01:00
|
|
|
'USER',
|
2017-02-01 14:18:59 +01:00
|
|
|
'SESSION',
|
2015-11-02 22:16:50 -08:00
|
|
|
'UNDEFINED',
|
2015-10-19 16:19:43 -07:00
|
|
|
].forEach(function(type) {
|
|
|
|
Object.defineProperty(objectTypes, type, {
|
2015-11-02 22:16:50 -08:00
|
|
|
value: type.toLowerCase(),
|
2015-10-19 16:19:43 -07:00
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
[
|
|
|
|
'BOOL',
|
|
|
|
'INT',
|
|
|
|
'FLOAT',
|
|
|
|
'DOUBLE',
|
|
|
|
'STRING',
|
|
|
|
'DATE',
|
|
|
|
'DATA',
|
|
|
|
'OBJECT',
|
|
|
|
'LIST',
|
|
|
|
].forEach(function(type) {
|
|
|
|
Object.defineProperty(propTypes, type, {
|
2015-11-18 17:55:30 -08:00
|
|
|
value: type.toLowerCase(),
|
2015-10-19 16:19:43 -07:00
|
|
|
enumerable: true,
|
|
|
|
});
|
|
|
|
});
|