Commit 38a88a1a authored by Marcel Nellesen's avatar Marcel Nellesen
Browse files

Update: Extracted merge functionality (coscine/issues#959)

parent 9138b39f
This diff is collapsed.
......@@ -11,6 +11,9 @@
"lint": "vue-cli-service lint",
"test:unit": "vue-cli-service test:unit"
},
"dependencies": {
"@coscine/app-util": "^1.4.0"
},
"devDependencies": {
"@babel/preset-env": "^7.10.2",
"@hutson/semantic-delivery-gitlab": "^9.1.0",
......
import Default from './default';
import MergeUtil from '../util/MergeUtil';
import { MergeUtil } from '@coscine/app-util';
const appLanguageStrings = {
en: {
......
import Default from './default';
import MergeUtil from '../util/MergeUtil';
import { MergeUtil } from '@coscine/app-util';
const appLanguageStrings = {
en: {
......
import Default from './default';
import MergeUtil from '../util/MergeUtil';
import { MergeUtil } from '@coscine/app-util';
const appLanguageStrings = {
en: {
......
import Default from './default';
import MergeUtil from '../util/MergeUtil';
import { MergeUtil } from '@coscine/app-util';
const appLanguageStrings = {
en: {
......
import Default from './default';
import MergeUtil from '../util/MergeUtil';
import { MergeUtil } from '@coscine/app-util';
const appLanguageStrings = {
en: {
......
import Default from './default';
import MergeUtil from '../util/MergeUtil';
import { MergeUtil } from '@coscine/app-util';
const appLanguageStrings = {
en: {
......
import Default from './default';
import MergeUtil from '../util/MergeUtil';
import { MergeUtil } from '@coscine/app-util';
const appLanguageStrings = {
en: {
......
import Default from './default';
import MergeUtil from '../util/MergeUtil';
import { MergeUtil } from '@coscine/app-util';
const appLanguageStrings = {
en: {
......
import Default from './default';
import MergeUtil from '../util/MergeUtil';
import { MergeUtil } from '@coscine/app-util';
const appLanguageStrings = {
en: {
......
import Default from './default';
import MergeUtil from '../util/MergeUtil';
import { MergeUtil } from '@coscine/app-util';
const appLanguageStrings = {
en: {
......
import Default from './default';
import MergeUtil from '../util/MergeUtil';
import { MergeUtil } from '@coscine/app-util';
const appLanguageStrings = {
en: {
......
import Default from './default';
import MergeUtil from '../util/MergeUtil';
import { MergeUtil } from '@coscine/app-util';
const appLanguageStrings = {
en: {
......
import Default from './default';
import MergeUtil from '../util/MergeUtil';
import { MergeUtil } from '@coscine/app-util';
const appLanguageStrings = {
en: {
......
import Default from './default';
import MergeUtil from '../util/MergeUtil';
import { MergeUtil } from '@coscine/app-util';
const appLanguageStrings = {
en: {
......
import Default from './default';
import MergeUtil from '../util/MergeUtil';
import { MergeUtil } from '@coscine/app-util';
const appLanguageStrings = {
en: {
......
import Default from './default';
import MergeUtil from '../util/MergeUtil';
import { MergeUtil } from '@coscine/app-util';
const appLanguageStrings = {
en: {
......
import Default from './default';
import MergeUtil from '../util/MergeUtil';
import { MergeUtil } from '@coscine/app-util';
const appLanguageStrings = {
en: {
......
export default{
merge(obj1: any, obj2: any) {
if (obj1 === undefined) {
obj1 = {};
}
for (const prop in obj2) {
if (obj2.hasOwnProperty(prop)) {
if (Object.prototype.toString.call(obj2[prop]) === '[object Object]') {
obj1[prop] = this.merge(obj1[prop], obj2[prop]);
} else {
obj1[prop] = obj2[prop];
}
}
}
return obj1;
},
};
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment