All files / src/definitions utils.ts

100% Statements 5/5
100% Branches 0/0
100% Functions 2/2
100% Lines 4/4
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20  8x     8x 8x 30x                          
/**
 * Copyright (c) 2017-present, Graphene.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 *
 */
 
class BaseClass {}
 
const BaseClassProperties = Object.getOwnPropertyNames(BaseClass);
 
// We remove the properties automatically included in the BaseClass
// Such as .length, .name and .prototype
export const getStaticProperties = (_class: Object) => {
  return Object.getOwnPropertyNames(_class).filter(
    name => BaseClassProperties.indexOf(name) === -1
  );
};