12345678910111213141516171819202122232425262728 |
- "use strict";
- var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
- var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
- _Object$defineProperty(exports, "__esModule", {
- value: true
- });
- exports.default = unique;
- var _forEach = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/for-each"));
- var _indexOf = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/index-of"));
- var _arrayContainsObject = _interopRequireDefault(require("./arrayContainsObject"));
- var _CoreManager = _interopRequireDefault(require("./CoreManager"));
- function unique(arr) {
- const uniques = [];
- (0, _forEach.default)(arr).call(arr, value => {
- const ParseObject = _CoreManager.default.getParseObject();
- if (value instanceof ParseObject) {
- if (!(0, _arrayContainsObject.default)(uniques, value)) {
- uniques.push(value);
- }
- } else {
- if ((0, _indexOf.default)(uniques).call(uniques, value) < 0) {
- uniques.push(value);
- }
- }
- });
- return uniques;
- }
|