|
- import Vue from 'vue'
- import App from './App.vue'
-
- declare global {
- interface Array<T> {
- joinGeneral (item: T, endItem: T|null): Array<T>;
- }
- }
-
- /* eslint-disable-next-line */
- Array.prototype.joinGeneral = function (item, endItem = null) {
- if (endItem === null) {
- return this.slice(0, -1).flatMap(x => [x, item]).concat(this.slice(-1))
- } else {
- return this.slice(0, -2).flatMap(x => [x, item]).concat(this.slice(-2, -1).flatMap(x => [x, endItem])).concat(this.slice(-1))
- }
- }
-
- Vue.config.productionTip = false
-
- new Vue({
- render: h => h(App)
- }).$mount('#app')
|