From b46860a56dc8b492c168c878302944038bfa486c Mon Sep 17 00:00:00 2001 From: Andrew Smith Date: Sat, 14 Jul 2018 22:58:37 -0400 Subject: [PATCH] style(store): remove prettier overrides --- packages/store/.prettierignore | 3 - packages/store/.prettierrc | 4 - packages/store/CHANGELOG.md | 18 +- .../store/articles/action-creator-service.md | 6 +- packages/store/articles/di-middleware.md | 6 +- packages/store/articles/epics.md | 14 +- packages/store/articles/fractal-store.md | 8 +- packages/store/articles/immutable-js.md | 6 +- packages/store/articles/intro-tutorial.md | 28 +- packages/store/articles/quickstart.md | 10 +- packages/store/articles/redux-dev-tools.md | 4 +- packages/store/articles/select-pattern.md | 4 +- .../store/articles/strongly-typed-reducers.md | 20 +- packages/store/docs/assets/js/main.js | 425 +++++++++--------- packages/store/docs/assets/js/search.js | 100 ++--- packages/store/package.json | 1 - .../src/components/fractal-reducer-map.ts | 8 +- packages/store/src/components/ng-redux.ts | 8 +- .../store/src/components/observable-store.ts | 4 +- .../store/src/components/root-store.spec.ts | 6 +- packages/store/src/components/root-store.ts | 24 +- packages/store/src/components/selectors.ts | 8 +- .../store/src/components/sub-store.spec.ts | 28 +- packages/store/src/components/sub-store.ts | 18 +- .../store/src/decorators/dispatch.spec.ts | 52 +-- packages/store/src/decorators/dispatch.ts | 4 +- packages/store/src/decorators/helpers.ts | 18 +- packages/store/src/decorators/select.spec.ts | 26 +- packages/store/src/decorators/select.ts | 8 +- .../src/decorators/with-sub-store.spec.ts | 14 +- .../store/src/decorators/with-sub-store.ts | 4 +- packages/store/src/index.ts | 4 +- packages/store/src/ng-redux.module.ts | 4 +- packages/store/src/utils/get-in.spec.ts | 9 +- packages/store/src/utils/get-in.ts | 2 +- packages/store/src/utils/set-in.spec.ts | 18 +- packages/store/src/utils/set-in.ts | 6 +- packages/store/testing/index.ts | 2 +- .../store/testing/ng-redux-testing.module.ts | 4 +- packages/store/testing/ng-redux.mock.spec.ts | 4 +- packages/store/testing/ng-redux.mock.ts | 12 +- .../store/testing/observable-store.mock.ts | 12 +- packages/store/tests.js | 6 +- 43 files changed, 483 insertions(+), 487 deletions(-) delete mode 100644 packages/store/.prettierignore delete mode 100644 packages/store/.prettierrc diff --git a/packages/store/.prettierignore b/packages/store/.prettierignore deleted file mode 100644 index 2254ab2a..00000000 --- a/packages/store/.prettierignore +++ /dev/null @@ -1,3 +0,0 @@ -/coverage -/docs -/lib \ No newline at end of file diff --git a/packages/store/.prettierrc b/packages/store/.prettierrc deleted file mode 100644 index 40b64728..00000000 --- a/packages/store/.prettierrc +++ /dev/null @@ -1,4 +0,0 @@ -{ - "singleQuote": true, - "printWidth": 80 -} \ No newline at end of file diff --git a/packages/store/CHANGELOG.md b/packages/store/CHANGELOG.md index 3d8fa735..1c4d7b05 100644 --- a/packages/store/CHANGELOG.md +++ b/packages/store/CHANGELOG.md @@ -161,7 +161,7 @@ You can now create an encapsulated 'sub-store' that only operates on a section o ```typescript const subStore = ngRedux.configureSubStore( ['path', 'to', 'somewhere'], - localReducer + localReducer, ); ``` @@ -210,7 +210,7 @@ export class AnimalActions { @dispatch() loadAnimals = (animalType: AnimalType): Action => ({ type: AnimalActions.LOAD_ANIMALS, - meta: { animalType } + meta: { animalType }, }); // ... @@ -356,7 +356,7 @@ import { NgReduxModule } from 'ng2-redux'; declarations: [AppComponent], imports: [NgReduxModule.forRoot(), BrowserModule], providers: [], - bootstrap: [AppComponent] + bootstrap: [AppComponent], }) class AppModule { // etc. @@ -374,7 +374,7 @@ import { NgReduxModule } from 'ng2-redux'; declarations: [AppComponent], imports: [NgReduxModule, BrowserModule], providers: [], - bootstrap: [AppComponent] + bootstrap: [AppComponent], }) class AppModule { // etc. @@ -439,7 +439,7 @@ import { rootReducer } from './store'; declarations: [AppComponent], imports: [NgReduxModule, BrowserModule], providers: [], - bootstrap: [AppComponent] + bootstrap: [AppComponent], }) export class AppModule { constructor(ngRedux: NgRedux) { @@ -566,7 +566,7 @@ import { Store, combineReducers, compose, - createStore + createStore, } from 'redux'; import thunk from 'redux-thunk'; import reduxLogger from 'redux-logger'; @@ -574,12 +574,12 @@ import reduxLogger from 'redux-logger'; import { myReducer } from './reducers/my-reducer'; const rootReducer = combineReducers({ - myReducer + myReducer, }); export const store = createStore( rootReducer, - compose(applyMiddleware(thunk, reduxLogger)) + compose(applyMiddleware(thunk, reduxLogger)), ) as Store; ``` @@ -681,7 +681,7 @@ const middleware = [createLogger()]; const enhancers = [persistState('counter', { key: 'example-app' })]; const store = compose( applyMiddleware(middleware), - ...enhancers + ...enhancers, )(createStore)(rootReducer); bootstrap(App, [provide(store)]); diff --git a/packages/store/articles/action-creator-service.md b/packages/store/articles/action-creator-service.md index a58371ab..c31cd170 100644 --- a/packages/store/articles/action-creator-service.md +++ b/packages/store/articles/action-creator-service.md @@ -24,7 +24,7 @@ import { RandomNumberService } from '../services/random-number'; export class CounterActions { constructor( private ngRedux: NgRedux, - private randomNumberService: RandomNumberService + private randomNumberService: RandomNumberService, ) {} static INCREMENT_COUNTER: string = 'INCREMENT_COUNTER'; @@ -58,7 +58,7 @@ export class CounterActions { randomize(): void { this.ngRedux.dispatch({ type: CounterActions.RANDOMIZE_COUNTER, - payload: this.randomNumberService.pick() + payload: this.randomNumberService.pick(), }); } } @@ -85,7 +85,7 @@ import { RandomNumberService } from '../services/random-number';

- ` + `, }) export class Counter { @select('counter') counter$: any; diff --git a/packages/store/articles/di-middleware.md b/packages/store/articles/di-middleware.md index 42bfad19..5553bb41 100644 --- a/packages/store/articles/di-middleware.md +++ b/packages/store/articles/di-middleware.md @@ -46,14 +46,14 @@ import { LogRemoteName } from './middleware/log-remote-name'; /* ... */ imports: [, /* ... */ NgReduxModule], providers: [ - LogRemoteName + LogRemoteName, /* ... */ - ] + ], }) export class AppModule { constructor( private ngRedux: NgRedux, - logRemoteName: LogRemoteName + logRemoteName: LogRemoteName, ) { const middleware = [reduxLogger, logRemoteName.middleware]; this.ngRedux.configureStore(rootReducer, {}, middleware); diff --git a/packages/store/articles/epics.md b/packages/store/articles/epics.md index 75b026f6..45742771 100644 --- a/packages/store/articles/epics.md +++ b/packages/store/articles/epics.md @@ -28,7 +28,7 @@ export class SessionActions { loginUser(credentials) { this.ngRedux.dispatch({ type: SessionActions.LOGIN_USER, - payload: credentials + payload: credentials, }); } @@ -65,12 +65,12 @@ export class SessionEpics { .post(`${BASE_URL}/auth/login`, payload) .map(result => ({ type: SessionActions.LOGIN_USER_SUCCESS, - payload: result.json().meta + payload: result.json().meta, })) .catch(error => Observable.of({ - type: SessionActions.LOGIN_USER_ERROR - }) + type: SessionActions.LOGIN_USER_ERROR, + }), ); }); }; @@ -96,14 +96,14 @@ import { SessionEpics } from './epics'; /* ... */ imports: [, /* ... */ NgReduxModule], providers: [ - SessionEpics + SessionEpics, /* ... */ - ] + ], }) export class AppModule { constructor( private ngRedux: NgRedux, - private epics: SessionEpics + private epics: SessionEpics, ) { const middleware = [createEpicMiddleware(this.epics.login)]; ngRedux.configureStore(rootReducer, {}, middleware); diff --git a/packages/store/articles/fractal-store.md b/packages/store/articles/fractal-store.md index 7c3a7da8..215d824a 100644 --- a/packages/store/articles/fractal-store.md +++ b/packages/store/articles/fractal-store.md @@ -50,7 +50,7 @@ export const userComponentReducer = (state, action) =>

occupation: {{ occupation$ | async }}

lines of code: {{ loc$ | async }}

    - ` + `, }) export class UserComponent implements NgOnInit { @Input() userId: String; @@ -68,7 +68,7 @@ export class UserComponent implements NgOnInit { // in the top-level store. this.subStore = this.ngRedux.configureSubStore( ['users', userId], - userComponentReducer + userComponentReducer, ); // Substore selectons are scoped to the base path used to configure @@ -129,11 +129,11 @@ export const defaultToZero = (obs$: Observable) =>

occupation: {{ occupation$ | async }}

lines of code: {{ loc$ | async }}

    - ` + `, }) @WithSubStore({ basePathMethodName: 'getBasePath', - localReducer: userComponentReducer + localReducer: userComponentReducer, }) export class UserComponent implements NgOnInit { @Input() userId: String; diff --git a/packages/store/articles/immutable-js.md b/packages/store/articles/immutable-js.md index bb76562b..2326b25a 100644 --- a/packages/store/articles/immutable-js.md +++ b/packages/store/articles/immutable-js.md @@ -25,7 +25,7 @@ can no longer easily dereference properties: ```typescript const mutableFoo = { - foo: 1 + foo: 1, }; const foo: number = mutableFoo.foo; @@ -89,8 +89,8 @@ Immutable.Map({ totalCount: 0, counts: Immutable.map({ firstCount: 0, - secondCount: 0 - }) + secondCount: 0, + }), }); ``` diff --git a/packages/store/articles/intro-tutorial.md b/packages/store/articles/intro-tutorial.md index 9bddb462..37d5cf4b 100644 --- a/packages/store/articles/intro-tutorial.md +++ b/packages/store/articles/intro-tutorial.md @@ -55,10 +55,10 @@ import { AppComponent } from './app.component'; BrowserModule, FormsModule, HttpModule, - NgReduxModule // <- New + NgReduxModule, // <- New ], providers: [], - bootstrap: [AppComponent] + bootstrap: [AppComponent], }) export class AppModule {} ``` @@ -89,7 +89,7 @@ import { Component } from '@angular/core'; @Component({ selector: 'app-root', templateUrl: './app.component.html', - styleUrls: ['./app.component.css'] + styleUrls: ['./app.component.css'], }) export class AppComponent { title = 'app works!'; @@ -151,7 +151,7 @@ const nextValueOfCount = streamOfActions.reduce( return state; }, - { count: 0 } + { count: 0 }, ); ``` @@ -192,7 +192,7 @@ export interface IAppState { } export const INITIAL_STATE: IAppState = { - count: 0 + count: 0, }; export function rootReducer(lastState: IAppState, action: Action): IAppState { @@ -230,7 +230,7 @@ import { CounterActions } from './app.actions'; // <- New declarations: [AppComponent], imports: [BrowserModule, FormsModule, HttpModule, NgReduxModule], providers: [CounterActions], // <- New - bootstrap: [AppComponent] + bootstrap: [AppComponent], }) export class AppModule { constructor(ngRedux: NgRedux) { @@ -273,7 +273,7 @@ ends up looking conceptually a bit like this: // Pseudocode const finalAppState: IAppState = actionsOverTime.reduce( rootReducer, - INITIAL_STATE + INITIAL_STATE, ); ``` @@ -306,7 +306,7 @@ import { IAppState } from '../store'; // <- New @Component({ selector: 'app-root', templateUrl: './app.component.html', - styleUrls: ['./app.component.css'] + styleUrls: ['./app.component.css'], }) export class AppComponent { title = 'app works!'; @@ -315,7 +315,7 @@ export class AppComponent { constructor( // <- New private ngRedux: NgRedux, // <- New - private actions: CounterActions + private actions: CounterActions, ) {} // <- New increment() { @@ -350,7 +350,7 @@ export class AppComponent implements OnDestroy { constructor( private ngRedux: NgRedux, - private actions: CounterActions + private actions: CounterActions, ) { this.subscription = ngRedux .select('count') // <- New @@ -447,7 +447,7 @@ import { Observable } from 'rxjs/Observable'; @Component({ selector: 'app-root', templateUrl: './app.component.html', - styleUrls: ['./app.component.css'] + styleUrls: ['./app.component.css'], }) export class AppComponent { title = 'app works!'; @@ -455,7 +455,7 @@ export class AppComponent { constructor( private actions: CounterActions, - private ngRedux: NgRedux + private ngRedux: NgRedux, ) {} // <- Changed increment() { @@ -590,7 +590,7 @@ Then, make a quick adjustment to enable them in your app: import { NgReduxModule, NgRedux, - DevToolsExtension + DevToolsExtension, } from '@angular-redux/store'; // <- Changed @NgModule({ @@ -608,7 +608,7 @@ export class AppModule { rootReducer, INITIAL_STATE, [], // <- New - storeEnhancers + storeEnhancers, ); // <- New } } diff --git a/packages/store/articles/quickstart.md b/packages/store/articles/quickstart.md index 00a3aa93..700dd5c4 100644 --- a/packages/store/articles/quickstart.md +++ b/packages/store/articles/quickstart.md @@ -32,7 +32,7 @@ interface IAppState { @NgModule({ /* ... */ - imports: [, /* ... */ NgReduxModule] + imports: [, /* ... */ NgReduxModule], }) export class AppModule { constructor(ngRedux: NgRedux) { @@ -50,7 +50,7 @@ import { Store, combineReducers, compose, - createStore + createStore, } from 'redux'; import { NgReduxModule, NgRedux } from '@angular-redux/store'; import { createLogger } from 'redux-logger'; @@ -62,12 +62,12 @@ interface IAppState { export const store: Store = createStore( rootReducer, - applyMiddleware(createLogger()) + applyMiddleware(createLogger()), ); @NgModule({ /* ... */ - imports: [, /* ... */ NgReduxModule] + imports: [, /* ... */ NgReduxModule], }) class AppModule { constructor(ngRedux: NgRedux) { @@ -92,7 +92,7 @@ import { select } from '@angular-redux/store'; @Component({ template: - '' + '', }) class App { @select() count$: Observable; diff --git a/packages/store/articles/redux-dev-tools.md b/packages/store/articles/redux-dev-tools.md index 24421c99..a9d0cc94 100644 --- a/packages/store/articles/redux-dev-tools.md +++ b/packages/store/articles/redux-dev-tools.md @@ -18,14 +18,14 @@ Here's how to hook the extension up to your app: import { NgReduxModule, NgRedux, - DevToolsExtension + DevToolsExtension, } from '@angular-redux/store'; // Add the dev tools enhancer your ngRedux.configureStore called // when you initialize your root component: @NgModule({ /* ... */ - imports: [, /* ... */ NgReduxModule] + imports: [, /* ... */ NgReduxModule], }) export class AppModule { constructor(private ngRedux: NgRedux, private devTools: DevToolsExtension) { diff --git a/packages/store/articles/select-pattern.md b/packages/store/articles/select-pattern.md index ecf60e23..35c37129 100644 --- a/packages/store/articles/select-pattern.md +++ b/packages/store/articles/select-pattern.md @@ -35,7 +35,7 @@ import { select } from '@angular-redux/store';

{{counterSelectedWithString | async}}

{{counterSelectedWithFunction | async}}

{{counterSelectedWithFunctionAndMultipliedByTwo | async}}

- ` + `, }) export class CounterValue { // this selects `counter` from the store and attaches it to this property @@ -86,7 +86,7 @@ interface IAppState { [increment]="increment" [decrement]="decrement"> - ` + `, }) export class Counter { private count$: Observable; diff --git a/packages/store/articles/strongly-typed-reducers.md b/packages/store/articles/strongly-typed-reducers.md index 0ef5bb4b..3104a266 100644 --- a/packages/store/articles/strongly-typed-reducers.md +++ b/packages/store/articles/strongly-typed-reducers.md @@ -43,7 +43,7 @@ export interface IAppState { export const rootReducer = combineReducers({ foo: fooReducer, - bar: barReducer + bar: barReducer, }); ``` @@ -71,7 +71,7 @@ import { Action, Reducer } from 'redux'; export const fooReducer: Reducer = ( state: TFoo, - action: Action + action: Action, ): TFoo => { // ... }; @@ -99,7 +99,7 @@ import { Action } from 'flux-standard-action'; export const fooReducer: Reducer = ( state: TFoo, - action: Action + action: Action, ): TFoo => { // ... }; @@ -112,16 +112,16 @@ If you need more flexibility in payload types, you can use a union and ```typescript export const barReducer: Reducer = ( state: IBar, - action: Action + action: Action, ): IBar => { switch (action.type) { case A_HAS_CHANGED: return Object.assign({}, state, { - a: action.payload + a: action.payload, }); case B_HAS_CHANGED: return Object.assign({}, state, { - b: action.payload + b: action.payload, }); // ... } @@ -138,13 +138,13 @@ maintain immutability. This works in Typescript too, but it's not typesafe: ```typescript export const barReducer: Reducer = ( state: IBar, - action: Action + action: Action, ): IBar => { switch (action.type) { case A_HAS_CHANGED: return Object.assign({}, state, { a: action.payload, - zzz: 'test' // We'd like this to generate a compile error, but it doesn't + zzz: 'test', // We'd like this to generate a compile error, but it doesn't }); // ... } @@ -164,13 +164,13 @@ import { tassign } from 'tassign'; export const barReducer: Reducer = ( state: IBar, - action: Action + action: Action, ): IBar => { switch (action.type) { case A_HAS_CHANGED: return tassign(state, { a: action.payload, - zzz: 'test' // Error: zzz is not a property of IBar + zzz: 'test', // Error: zzz is not a property of IBar }); // ... } diff --git a/packages/store/docs/assets/js/main.js b/packages/store/docs/assets/js/main.js index 6850a095..db2cfc39 100644 --- a/packages/store/docs/assets/js/main.js +++ b/packages/store/docs/assets/js/main.js @@ -60,7 +60,7 @@ Object.defineProperty((this.cache = {}), 0, { get: function() { return {}; - } + }, }), (this.expando = n.expando + Math.random()); } @@ -203,7 +203,7 @@ return a() ? void delete this.get : (this.get = b).apply(this, arguments); - } + }, }; } function Fb(a, b) { @@ -429,7 +429,7 @@ j.opts, b, c, - j.opts.specialEasing[b] || j.opts.easing + j.opts.specialEasing[b] || j.opts.easing, ); return j.tweens.push(d), d; }, @@ -439,7 +439,7 @@ if (e) return this; for (e = !0; d > c; c++) j.tweens[c].run(1); return b ? h.resolveWith(a, [j, b]) : h.rejectWith(a, [j, b]), this; - } + }, }), k = j.props; for (Wb(k, j.opts.specialEasing); g > f; f++) @@ -555,7 +555,7 @@ } catch (l) { return { state: 'parsererror', - error: g ? l : 'No conversion from ' + i + ' to ' + f + error: g ? l : 'No conversion from ' + i + ' to ' + f, }; } } @@ -618,7 +618,7 @@ return this.pushStack( n.map(this, function(b, c) { return a.call(b, c, b); - }) + }), ); }, slice: function() { @@ -640,7 +640,7 @@ }, push: f, sort: c.sort, - splice: c.splice + splice: c.splice, }), (n.extend = n.fn.extend = function() { var a, @@ -790,15 +790,15 @@ ); }, now: Date.now, - support: k + support: k, }), n.each( 'Boolean Number String Function Array Date RegExp Object Error'.split( - ' ' + ' ', ), function(a, b) { h['[object ' + b + ']'] = b.toLowerCase(); - } + }, ); var t = (function(a) { function fb(a, b, d, e) { @@ -1011,14 +1011,14 @@ return a === b; }, h, - !0 + !0, ), l = rb( function(a) { return K.call(b, a) > -1; }, h, - !0 + !0, ), m = [ function(a, c, d) { @@ -1026,7 +1026,7 @@ (!g && (d || c !== j)) || ((b = c).nodeType ? k(a, c, d) : l(a, c, d)) ); - } + }, ]; f > i; i++ @@ -1041,12 +1041,12 @@ qb( a .slice(0, i - 1) - .concat({ value: ' ' === a[i - 2].type ? '*' : '' }) + .concat({ value: ' ' === a[i - 2].type ? '*' : '' }), ).replace(R, '$1'), c, e > i && wb(a.slice(i, e)), f > e && wb((a = a.slice(e))), - f > e && qb(a) + f > e && qb(a), ); } m.push(c); @@ -1183,7 +1183,7 @@ '*(\\d+)|))' + M + '*\\)|)', - 'i' + 'i', ), bool: new RegExp('^(?:' + L + ')$', 'i'), needsContext: new RegExp( @@ -1194,8 +1194,8 @@ '*((?:-\\d)?\\d*)' + M + '*\\)|)(?=[^-]|$)', - 'i' - ) + 'i', + ), }, Y = /^(?:input|select|textarea|button)$/i, Z = /^h\d$/i, @@ -1224,7 +1224,7 @@ : function(a, b) { for (var c = a.length, d = 0; (a[c++] = b[d++]); ); a.length = c - 1; - } + }, }; } (c = fb.support = {}), @@ -1248,7 +1248,7 @@ function() { m(); }, - !1 + !1, ) : g.attachEvent && g.attachEvent('onunload', function() { @@ -1355,7 +1355,7 @@ o.webkitMatchesSelector || o.mozMatchesSelector || o.oMatchesSelector || - o.msMatchesSelector) + o.msMatchesSelector), )) && ib(function(a) { (c.disconnectedMatch = s.call(a, 'div')), @@ -1523,7 +1523,7 @@ '>': { dir: 'parentNode', first: !0 }, ' ': { dir: 'parentNode' }, '+': { dir: 'previousSibling', first: !0 }, - '~': { dir: 'previousSibling' } + '~': { dir: 'previousSibling' }, }, preFilter: { ATTR: function(a) { @@ -1560,7 +1560,7 @@ (b = c.indexOf(')', c.length - b) - c.length) && ((a[0] = a[0].slice(0, b)), (a[2] = c.slice(0, b))), a.slice(0, 3)); - } + }, }, filter: { TAG: function(a) { @@ -1583,7 +1583,7 @@ ('string' == typeof a.className && a.className) || (typeof a.getAttribute !== C && a.getAttribute('class')) || - '' + '', ); })) ); @@ -1699,7 +1699,7 @@ return e(a, 0, c); }) : e; - } + }, }, pseudos: { not: hb(function(a) { @@ -1827,8 +1827,8 @@ gt: nb(function(a, b, c) { for (var d = 0 > c ? c + b : c; ++d < b; ) a.push(d); return a; - }) - } + }), + }, }), (d.pseudos.nth = d.pseudos.eq); for (b in { radio: !0, checkbox: !0, file: !0, password: !0, image: !0 }) @@ -1918,7 +1918,7 @@ (m = d.find[l]) && (f = m( k.matches[0].replace(cb, db), - (ab.test(j[0].type) && ob(b.parentNode)) || b + (ab.test(j[0].type) && ob(b.parentNode)) || b, )) ) { if ((j.splice(i, 1), !(a = f.length && qb(j)))) @@ -2002,7 +2002,7 @@ a, n.grep(b, function(a) { return 1 === a.nodeType; - }) + }), ) ); }), @@ -2016,7 +2016,7 @@ return this.pushStack( n(a).filter(function() { for (b = 0; c > b; b++) if (n.contains(e[b], this)) return !0; - }) + }), ); for (b = 0; c > b; b++) n.find(a, e[b], d); return ( @@ -2034,7 +2034,7 @@ is: function(a) { return !!x(this, 'string' == typeof a && u.test(a) ? n(a) : a || [], !1) .length; - } + }, }); var y, z = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/; @@ -2055,7 +2055,7 @@ ((b = b instanceof n ? b[0] : b), n.merge( this, - n.parseHTML(c[1], b && b.nodeType ? b.ownerDocument || b : l, !0) + n.parseHTML(c[1], b && b.nodeType ? b.ownerDocument || b : l, !0), ), v.test(c[1]) && n.isPlainObject(b)) ) @@ -2098,7 +2098,7 @@ for (var c = []; a; a = a.nextSibling) 1 === a.nodeType && a !== b && c.push(a); return c; - } + }, }), n.fn.extend({ has: function(a) { @@ -2144,9 +2144,9 @@ }, addBack: function(a) { return this.add( - null == a ? this.prevObject : this.prevObject.filter(a) + null == a ? this.prevObject : this.prevObject.filter(a), ); - } + }, }), n.each( { @@ -2186,7 +2186,7 @@ }, contents: function(a) { return a.contentDocument || n.merge([], a.childNodes); - } + }, }, function(a, b) { n.fn[a] = function(c, d) { @@ -2198,7 +2198,7 @@ this.pushStack(e) ); }; - } + }, ); var E = /\S+/g, F = {}; @@ -2284,7 +2284,7 @@ }, fired: function() { return !!c; - } + }, }; return k; }), @@ -2293,7 +2293,7 @@ var b = [ ['resolve', 'done', n.Callbacks('once memory'), 'resolved'], ['reject', 'fail', n.Callbacks('once memory'), 'rejected'], - ['notify', 'progress', n.Callbacks('memory')] + ['notify', 'progress', n.Callbacks('memory')], ], c = 'pending', d = { @@ -2319,7 +2319,7 @@ .progress(c.notify) : c[f[0] + 'With']( this === d ? c.promise() : this, - g ? [a] : arguments + g ? [a] : arguments, ); }); }), @@ -2329,7 +2329,7 @@ }, promise: function(a) { return null != a ? n.extend(a, d) : d; - } + }, }, e = {}; return ( @@ -2344,7 +2344,7 @@ c = h; }, b[1 ^ a][2].disable, - b[2][2].lock + b[2][2].lock, ), (e[f[0]] = function() { return e[f[0] + 'With'](this === e ? d : this, arguments), this; @@ -2382,7 +2382,7 @@ .progress(h(b, j, i)) : --f; return f || g.resolveWith(k, c), g.promise(); - } + }, }); var H; (n.fn.ready = function(a) { @@ -2401,7 +2401,7 @@ (H.resolveWith(l, [n]), n.fn.triggerHandler && (n(l).triggerHandler('ready'), n(l).off('ready')))); - } + }, }), (n.ready.promise = function(b) { return ( @@ -2501,7 +2501,7 @@ }, discard: function(a) { a[this.expando] && delete this.cache[a[this.expando]]; - } + }, }); var L = new K(), M = new K(), @@ -2522,7 +2522,7 @@ }, _removeData: function(a, b) { L.remove(a, b); - } + }, }), n.fn.extend({ data: function(a, b) { @@ -2571,14 +2571,14 @@ b, arguments.length > 1, null, - !0 + !0, ); }, removeData: function(a) { return this.each(function() { M.remove(this, a); }); - } + }, }), n.extend({ queue: function(a, b, c) { @@ -2616,10 +2616,10 @@ L.access(a, c, { empty: n.Callbacks('once memory').add(function() { L.remove(a, [b + 'queue', c]); - }) + }), }) ); - } + }, }), n.fn.extend({ queue: function(a, b) { @@ -2663,7 +2663,7 @@ c.empty && (d++, c.empty.add(h)); return h(), e.promise(b); - } + }, }); var Q = /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source, R = ['Top', 'Right', 'Bottom', 'Left'], @@ -2739,9 +2739,9 @@ guid: c.guid, selector: e, needsContext: e && n.expr.match.needsContext.test(e), - namespace: p.join('.') + namespace: p.join('.'), }, - f + f, )), (m = i[o]) || ((m = i[o] = []), @@ -2933,7 +2933,7 @@ return h < b.length && g.push({ elem: this, handlers: b.slice(h) }), g; }, props: 'altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which'.split( - ' ' + ' ', ), fixHooks: {}, keyHooks: { @@ -2944,11 +2944,11 @@ (a.which = null != b.charCode ? b.charCode : b.keyCode), a ); - } + }, }, mouseHooks: { props: 'button buttons clientX clientY offsetX offsetY pageX pageY screenX screenY toElement'.split( - ' ' + ' ', ), filter: function(a, b) { var c, @@ -2974,7 +2974,7 @@ (a.which = 1 & f ? 1 : 2 & f ? 3 : 4 & f ? 2 : 0), a ); - } + }, }, fix: function(a) { if (a[n.expando]) return a; @@ -3010,13 +3010,13 @@ trigger: function() { return this !== _() && this.focus ? (this.focus(), !1) : void 0; }, - delegateType: 'focusin' + delegateType: 'focusin', }, blur: { trigger: function() { return this === _() && this.blur ? (this.blur(), !1) : void 0; }, - delegateType: 'focusout' + delegateType: 'focusout', }, click: { trigger: function() { @@ -3028,25 +3028,25 @@ }, _default: function(a) { return n.nodeName(a.target, 'a'); - } + }, }, beforeunload: { postDispatch: function(a) { void 0 !== a.result && a.originalEvent && (a.originalEvent.returnValue = a.result); - } - } + }, + }, }, simulate: function(a, b, c, d) { var e = n.extend(new n.Event(), c, { type: a, isSimulated: !0, - originalEvent: {} + originalEvent: {}, }); d ? n.event.trigger(e, null, b) : n.event.dispatch.call(b, e), e.isDefaultPrevented() && c.preventDefault(); - } + }, }), (n.removeEvent = function(a, b, c) { a.removeEventListener && a.removeEventListener(b, c, !1); @@ -3086,14 +3086,14 @@ (this.isImmediatePropagationStopped = Z), a && a.stopImmediatePropagation && a.stopImmediatePropagation(), this.stopPropagation(); - } + }, }), n.each( { mouseenter: 'mouseover', mouseleave: 'mouseout', pointerenter: 'pointerover', - pointerleave: 'pointerout' + pointerleave: 'pointerout', }, function(a, b) { n.event.special[a] = { @@ -3111,9 +3111,9 @@ (a.type = b)), c ); - } + }, }; - } + }, ), k.focusinBubbles || n.each({ focus: 'focusin', blur: 'focusout' }, function(a, b) { @@ -3132,7 +3132,7 @@ e ? L.access(d, b, e) : (d.removeEventListener(a, c, !0), L.remove(d, b)); - } + }, }; }), n.fn.extend({ @@ -3177,7 +3177,7 @@ n(a.delegateTarget).off( d.namespace ? d.origType + '.' + d.namespace : d.origType, d.selector, - d.handler + d.handler, ), this ); @@ -3201,7 +3201,7 @@ triggerHandler: function(a, b) { var c = this[0]; return c ? n.event.trigger(a, b, c, !0) : void 0; - } + }, }); var ab = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi, bb = /<([\w:]+)/, @@ -3216,7 +3216,7 @@ col: [2, '', '
'], tr: [2, '', '
'], td: [3, '', '
'], - _default: [0, '', ''] + _default: [0, '', ''], }; (ib.optgroup = ib.option), (ib.tbody = ib.tfoot = ib.colgroup = ib.caption = ib.thead), @@ -3308,7 +3308,7 @@ } delete M.cache[c[M.expando]]; } - } + }, }), n.fn.extend({ text: function(a) { @@ -3326,7 +3326,7 @@ }, null, a, - arguments.length + arguments.length, ); }, append: function() { @@ -3414,7 +3414,7 @@ }, null, a, - arguments.length + arguments.length, ); }, replaceWith: function() { @@ -3477,12 +3477,12 @@ : n.globalEval( h.textContent.replace( /^\s*\s*$/g, - '' - ) + '', + ), )); } return this; - } + }, }), n.each( { @@ -3490,7 +3490,7 @@ prependTo: 'prepend', insertBefore: 'before', insertAfter: 'after', - replaceAll: 'replaceWith' + replaceAll: 'replaceWith', }, function(a, b) { n.fn[a] = function(a) { @@ -3500,7 +3500,7 @@ f.apply(d, c.get()); return this.pushStack(d); }; - } + }, ); var qb, rb = {}, @@ -3551,7 +3551,7 @@ d.removeChild(e), b ); - } + }, })); })(), (n.swap = function(a, b, c, d) { @@ -3577,8 +3577,8 @@ var c = xb(a, 'opacity'); return '' === c ? '1' : c; } - } - } + }, + }, }, cssNumber: { columnCount: !0, @@ -3592,7 +3592,7 @@ orphans: !0, widows: !0, zIndex: !0, - zoom: !0 + zoom: !0, }, cssProps: { float: 'cssFloat' }, style: function(a, b, c, d) { @@ -3643,7 +3643,7 @@ ? ((f = parseFloat(e)), !0 === c || n.isNumeric(f) ? f || 0 : e) : e ); - } + }, }), n.each(['height', 'width'], function(a, b) { n.cssHooks[b] = { @@ -3663,9 +3663,9 @@ c, d ? Hb(a, b, d, 'border-box' === n.css(a, 'boxSizing', !1, e), e) - : 0 + : 0, ); - } + }, }; }), (n.cssHooks.marginRight = yb(k.reliableMarginRight, function(a, b) { @@ -3683,7 +3683,7 @@ ) e[a + R[d] + b] = f[d] || f[d - 2] || f[0]; return e; - } + }, }), ub.test(a) || (n.cssHooks[a + b].set = Gb); }), @@ -3705,7 +3705,7 @@ }, a, b, - arguments.length > 1 + arguments.length > 1, ); }, show: function() { @@ -3722,7 +3722,7 @@ : this.each(function() { S(this) ? n(this).show() : n(this).hide(); }); - } + }, }), (n.Tween = Kb), (Kb.prototype = { @@ -3750,7 +3750,7 @@ this.options.duration * a, 0, 1, - this.options.duration + this.options.duration, ) : a), (this.now = (this.end - this.start) * b + this.start), @@ -3759,7 +3759,7 @@ c && c.set ? c.set(this) : Kb.propHooks._default.set(this), this ); - } + }, }), (Kb.prototype.init.prototype = Kb.prototype), (Kb.propHooks = { @@ -3778,13 +3778,13 @@ (null != a.elem.style[n.cssProps[a.prop]] || n.cssHooks[a.prop]) ? n.style(a.elem, a.prop, a.now + a.unit) : (a.elem[a.prop] = a.now); - } - } + }, + }, }), (Kb.propHooks.scrollTop = Kb.propHooks.scrollLeft = { set: function(a) { a.elem.nodeType && a.elem.parentNode && (a.elem[a.prop] = a.now); - } + }, }), (n.easing = { linear: function(a) { @@ -3792,7 +3792,7 @@ }, swing: function(a) { return 0.5 - Math.cos(a * Math.PI) / 2; - } + }, }), (n.fx = Kb.prototype.init), (n.fx.step = {}); @@ -3827,8 +3827,8 @@ (c.end = e[1] ? g + (e[1] + 1) * e[2] : +e[2])), c ); - } - ] + }, + ], }; (n.Animation = n.extend(Xb, { tweener: function(a, b) { @@ -3838,7 +3838,7 @@ }, prefilter: function(a, b) { b ? Qb.unshift(a) : Qb.push(a); - } + }, })), (n.speed = function(a, b, c) { var d = @@ -3847,7 +3847,7 @@ : { complete: c || (!c && b) || (n.isFunction(a) && a), duration: a, - easing: (c && b) || (b && !n.isFunction(b) && b) + easing: (c && b) || (b && !n.isFunction(b) && b), }; return ( (d.duration = n.fx.off @@ -3935,7 +3935,7 @@ delete c.finish; }) ); - } + }, }), n.each(['toggle', 'show', 'hide'], function(a, b) { var c = n.fn[b]; @@ -3952,13 +3952,13 @@ slideToggle: Tb('toggle'), fadeIn: { opacity: 'show' }, fadeOut: { opacity: 'hide' }, - fadeToggle: { opacity: 'toggle' } + fadeToggle: { opacity: 'toggle' }, }, function(a, b) { n.fn[a] = function(a, c, d) { return this.animate(b, a, c, d); }; - } + }, ), (n.timers = []), (n.fx.tick = function() { @@ -4016,7 +4016,7 @@ return this.each(function() { n.removeAttr(this, a); }); - } + }, }), n.extend({ attr: function(a, b, c) { @@ -4058,14 +4058,14 @@ var c = a.value; return a.setAttribute('type', b), c && (a.value = c), b; } - } - } - } + }, + }, + }, }), (Zb = { set: function(a, b, c) { return !1 === b ? n.removeAttr(a, c) : a.setAttribute(c, c), c; - } + }, }), n.each(n.expr.match.bool.source.match(/\w+/g), function(a, b) { var c = $b[b] || n.find.attr; @@ -4090,7 +4090,7 @@ return this.each(function() { delete this[n.propFix[a] || a]; }); - } + }, }), n.extend({ propFix: { for: 'htmlFor', class: 'className' }, @@ -4118,16 +4118,16 @@ return a.hasAttribute('tabindex') || _b.test(a.nodeName) || a.href ? a.tabIndex : -1; - } - } - } + }, + }, + }, }), k.optSelected || (n.propHooks.selected = { get: function(a) { var b = a.parentNode; return b && b.parentNode && b.parentNode.selectedIndex, null; - } + }, }), n.each( [ @@ -4140,11 +4140,11 @@ 'colSpan', 'useMap', 'frameBorder', - 'contentEditable' + 'contentEditable', ], function() { n.propFix[this.toLowerCase()] = this; - } + }, ); var ac = /[\t\r\n\f]/g; n.fn.extend({ @@ -4232,7 +4232,7 @@ this.className || !1 === a ? '' : L.get(this, '__className__') || '')); - } + }, ); }, hasClass: function(a) { @@ -4243,7 +4243,7 @@ ) return !0; return !1; - } + }, }); n.fn.extend({ val: function(a) { @@ -4283,7 +4283,7 @@ ? '' : c)) : void 0; - } + }, }), n.extend({ valHooks: { @@ -4291,7 +4291,7 @@ get: function(a) { var b = n.find.attr(a, 'value'); return null != b ? b : n.trim(n.text(a)); - } + }, }, select: { get: function(a) { @@ -4331,9 +4331,9 @@ ) (d = e[g]), (d.selected = n.inArray(d.value, f) >= 0) && (c = !0); return c || (a.selectedIndex = -1), f; - } - } - } + }, + }, + }, }), n.each(['radio', 'checkbox'], function() { (n.valHooks[this] = { @@ -4341,7 +4341,7 @@ return n.isArray(b) ? (a.checked = n.inArray(n(a).val(), b) >= 0) : void 0; - } + }, }), k.checkOn || (n.valHooks[this].get = function(a) { @@ -4350,7 +4350,7 @@ }), n.each( 'blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu'.split( - ' ' + ' ', ), function(a, b) { n.fn[b] = function(a, c) { @@ -4358,7 +4358,7 @@ ? this.on(b, null, a, c) : this.trigger(b); }; - } + }, ), n.fn.extend({ hover: function(a, b) { @@ -4377,7 +4377,7 @@ return 1 === arguments.length ? this.off(a, '**') : this.off(b, a || '**', c); - } + }, }); var cc = n.now(), dc = /\?/; @@ -4431,21 +4431,21 @@ text: 'text/plain', html: 'text/html', xml: 'application/xml, text/xml', - json: 'application/json, text/javascript' + json: 'application/json, text/javascript', }, contents: { xml: /xml/, html: /html/, json: /json/ }, responseFields: { xml: 'responseXML', text: 'responseText', - json: 'responseJSON' + json: 'responseJSON', }, converters: { '* text': String, 'text html': !0, 'text json': n.parseJSON, - 'text xml': n.parseXML + 'text xml': n.parseXML, }, - flatOptions: { url: !0, context: !0 } + flatOptions: { url: !0, context: !0 }, }, ajaxSetup: function(a, b) { return b ? tc(tc(a, n.ajaxSettings), b) : tc(n.ajaxSettings, a); @@ -4544,7 +4544,7 @@ abort: function(a) { var b = a || u; return c && c.abort(b), x(0, b), this; - } + }, }; if ( ((o.promise(v).complete = p.add), @@ -4598,7 +4598,7 @@ k.dataTypes[0] && k.accepts[k.dataTypes[0]] ? k.accepts[k.dataTypes[0]] + ('*' !== k.dataTypes[0] ? ', ' + pc + '; q=0.01' : '') - : k.accepts['*'] + : k.accepts['*'], ); for (j in k.headers) v.setRequestHeader(j, k.headers[j]); if (k.beforeSend && (!1 === k.beforeSend.call(l, v, k) || 2 === t)) @@ -4627,7 +4627,7 @@ }, getScript: function(a, b) { return n.get(a, void 0, b, 'script'); - } + }, }), n.each(['get', 'post'], function(a, b) { n[b] = function(a, c, d, e) { @@ -4644,13 +4644,13 @@ 'ajaxComplete', 'ajaxError', 'ajaxSuccess', - 'ajaxSend' + 'ajaxSend', ], function(a, b) { n.fn[b] = function(a) { return this.on(b, a); }; - } + }, ), (n._evalUrl = function(a) { return n.ajax({ @@ -4659,7 +4659,7 @@ dataType: 'script', async: !1, global: !1, - throws: !0 + throws: !0, }); }), n.fn.extend({ @@ -4693,7 +4693,7 @@ var b = n(this), c = b.contents(); c.length ? c.wrapAll(a) : b.append(a); - } + }, ); }, wrap: function(a) { @@ -4708,7 +4708,7 @@ n.nodeName(this, 'body') || n(this).replaceWith(this.childNodes); }) .end(); - } + }, }), (n.expr.filters.hidden = function(a) { return a.offsetWidth <= 0 && a.offsetHeight <= 0; @@ -4766,7 +4766,7 @@ : { name: b.name, value: c.replace(/\r?\n/g, '\r\n') }; }) .get(); - } + }, }), (n.ajaxSettings.xhr = function() { try { @@ -4818,7 +4818,7 @@ 'string' == typeof f.responseText ? { text: f.responseText } : void 0, - f.getAllResponseHeaders() + f.getAllResponseHeaders(), )); }; }), @@ -4833,21 +4833,21 @@ }, abort: function() { b && b(); - } + }, } : void 0; }), n.ajaxSetup({ accepts: { script: - 'text/javascript, application/javascript, application/ecmascript, application/x-ecmascript' + 'text/javascript, application/javascript, application/ecmascript, application/x-ecmascript', }, contents: { script: /(?:java|ecma)script/ }, converters: { 'text script': function(a) { return n.globalEval(a), a; - } - } + }, + }, }), n.ajaxPrefilter('script', function(a) { void 0 === a.cache && (a.cache = !1), a.crossDomain && (a.type = 'GET'); @@ -4865,13 +4865,13 @@ b.remove(), (c = null), a && e('error' === a.type ? 404 : 200, a.type); - }) + }), )), l.head.appendChild(b[0]); }, abort: function() { c && c(); - } + }, }; } }); @@ -4882,7 +4882,7 @@ jsonpCallback: function() { var a = Gc.pop() || n.expando + '_' + cc++; return (this[a] = !0), a; - } + }, }), n.ajaxPrefilter('json jsonp', function(b, c, d) { var e, @@ -4894,7 +4894,7 @@ ? 'url' : 'string' == typeof b.data && !(b.contentType || '').indexOf( - 'application/x-www-form-urlencoded' + 'application/x-www-form-urlencoded', ) && Hc.test(b.data) && 'data'); @@ -4957,14 +4957,14 @@ ? n('
') .append(n.parseHTML(a)) .find(d) - : a + : a, ); }) .complete( c && function(a, b) { g.each(c, f || [a.responseText, b, a]); - } + }, ), this ); @@ -5000,7 +5000,7 @@ null != b.top && (m.top = b.top - h.top + g), null != b.left && (m.left = b.left - h.left + e), 'using' in b ? b.using.call(a, m) : l.css(m); - } + }, }), n.fn.extend({ offset: function(a) { @@ -5023,7 +5023,7 @@ (c = Kc(f)), { top: e.top + c.pageYOffset - b.clientTop, - left: e.left + c.pageXOffset - b.clientLeft + left: e.left + c.pageXOffset - b.clientLeft, }) : e) : void 0; @@ -5044,7 +5044,7 @@ (d.left += n.css(a[0], 'borderLeftWidth', !0))), { top: b.top - d.top - n.css(c, 'marginTop', !0), - left: b.left - d.left - n.css(c, 'marginLeft', !0) + left: b.left - d.left - n.css(c, 'marginLeft', !0), } ); } @@ -5059,11 +5059,11 @@ a = a.offsetParent; return a || Jc; }); - } + }, }), n.each({ scrollLeft: 'pageXOffset', scrollTop: 'pageYOffset' }, function( b, - c + c, ) { var d = 'pageYOffset' === c; n.fn[b] = function(e) { @@ -5082,7 +5082,7 @@ b, e, arguments.length, - null + null, ); }; }), @@ -5096,7 +5096,7 @@ n.each({ Height: 'height', Width: 'width' }, function(a, b) { n.each({ padding: 'inner' + a, content: b, '': 'outer' + a }, function( c, - d + d, ) { n.fn[d] = function(d, e) { var f = arguments.length && (c || 'boolean' != typeof d), @@ -5114,7 +5114,7 @@ e['scroll' + a], b.body['offset' + a], e['offset' + a], - e['client' + a] + e['client' + a], )) : void 0 === d ? n.css(b, c, g) @@ -5123,7 +5123,7 @@ b, f ? d : void 0, f, - null + null, ); }; }); @@ -5268,7 +5268,7 @@ function(n, e, u) { return !t.call(r, n, e, u); }, - r + r, ); }), (j.every = j.all = function(n, t, e) { @@ -5384,7 +5384,7 @@ } return n.index - t.index; }), - 'value' + 'value', ) ); }; @@ -5855,7 +5855,7 @@ j['is' + n] = function(t) { return l.call(t) == '[object ' + n + ']'; }; - } + }, ), j.isArguments(arguments) || (j.isArguments = function(n) { @@ -5928,13 +5928,13 @@ '<': '<', '>': '>', '"': '"', - "'": ''' - } + "'": ''', + }, }; T.unescape = j.invert(T.escape); var I = { escape: new RegExp('[' + j.keys(T.escape).join('') + ']', 'g'), - unescape: new RegExp('(' + j.keys(T.unescape).join('|') + ')', 'g') + unescape: new RegExp('(' + j.keys(T.unescape).join('|') + ')', 'g'), }; j.each(['escape', 'unescape'], function(n) { j[n] = function(t) { @@ -5968,7 +5968,7 @@ (j.templateSettings = { evaluate: /<%([\s\S]+?)%>/g, interpolate: /<%=([\s\S]+?)%>/g, - escape: /<%-([\s\S]+?)%>/g + escape: /<%-([\s\S]+?)%>/g, }); var q = /(.)^/, B = { @@ -5978,7 +5978,7 @@ '\n': 'n', '\t': 't', '\u2028': 'u2028', - '\u2029': 'u2029' + '\u2029': 'u2029', }; (j.template = function(n, t, r) { var e; @@ -5987,9 +5987,9 @@ [ (r.escape || q).source, (r.interpolate || q).source, - (r.evaluate || q).source + (r.evaluate || q).source, ].join('|') + '|$', - 'g' + 'g', ), i = 0, a = "__p+='"; @@ -6045,7 +6045,7 @@ z.call(this, r) ); }; - } + }, ), A(['concat', 'join', 'slice'], function(n) { var t = e[n]; @@ -6059,7 +6059,7 @@ }, value: function() { return this._wrapped; - } + }, }), 'function' == typeof define && define.amd && @@ -6094,7 +6094,7 @@ (this._events[t] || (this._events[t] = [])).push({ callback: e, context: i, - ctx: i || this + ctx: i || this, }), this) : this; @@ -6146,7 +6146,7 @@ t.off(e, r, this), (n || i.isEmpty(t._events)) && delete this._listeningTo[a]; return this; - } + }, }), l = /\s+/, c = function(t, e, i, r) { @@ -6400,11 +6400,11 @@ 'invalid', this, r, - i.extend(e, { validationError: r }) + i.extend(e, { validationError: r }), ), !1) ); - } + }, }); var v = ['keys', 'values', 'pairs', 'invert', 'pick', 'omit']; i.each(v, function(t) { @@ -6642,7 +6642,7 @@ (delete this._byId[e.previous(e.idAttribute)], null != e.id && (this._byId[e.id] = e)), this.trigger.apply(this, arguments)); - } + }, }); var _ = [ 'forEach', @@ -6685,7 +6685,7 @@ 'lastIndexOf', 'isEmpty', 'chain', - 'sample' + 'sample', ]; i.each(_, function(t) { g.prototype[t] = function() { @@ -6720,7 +6720,7 @@ 'attributes', 'className', 'tagName', - 'events' + 'events', ]; i.extend(w.prototype, u, { tagName: 'div', @@ -6771,13 +6771,13 @@ var r = e.$('<' + i.result(this, 'tagName') + '>').attr(t); this.setElement(r, !1); } - } + }, }), (e.sync = function(t, r, s) { var n = T[t]; i.defaults(s || (s = {}), { emulateHTTP: e.emulateHTTP, - emulateJSON: e.emulateJSON + emulateJSON: e.emulateJSON, }); var a = { type: n, dataType: 'json' }; if ( @@ -6818,7 +6818,7 @@ update: 'PUT', patch: 'PATCH', delete: 'DELETE', - read: 'GET' + read: 'GET', }; e.ajax = function() { return e.$.ajax.apply(e.$, arguments); @@ -6881,7 +6881,7 @@ ? decodeURIComponent(t) : null; }); - } + }, }); var N = (e.History = function() { (this.handlers = []), @@ -6942,7 +6942,7 @@ : this._wantsHashChange && (this._checkUrlInterval = setInterval( this.checkUrl, - this.interval + this.interval, )), (this.fragment = r); var o = this.location; @@ -6960,7 +6960,7 @@ this.history.replaceState( {}, document.title, - this.root + this.fragment + this.root + this.fragment, )); } if (!this.options.silent) return this.loadUrl(); @@ -7008,7 +7008,7 @@ this.history[e.replace ? 'replaceState' : 'pushState']( {}, document.title, - i + i, ); else { if (!this._wantsHashChange) return this.location.assign(i); @@ -7026,7 +7026,7 @@ var r = t.href.replace(/(javascript:|#).*$/, ''); t.replace(r + '#' + e); } else t.hash = '#' + e; - } + }, }), (e.history = new N()); var U = function(t, e) { @@ -7142,7 +7142,7 @@ (e.label && e.label in this.registeredFunctions) || t.utils.warn( 'Function is not registered with pipeline. This may cause problems when serialising the index.\n', - e + e, ); }), (t.Pipeline.load = function(e) { @@ -7340,7 +7340,7 @@ 'update', function() { this._idfCache = {}; - }.bind(this) + }.bind(this), ); }), (t.Index.prototype.on = function() { @@ -7353,7 +7353,10 @@ (t.Index.load = function(e) { e.version !== t.version && t.utils.warn( - 'version mismatch: current ' + t.version + ' importing ' + e.version + 'version mismatch: current ' + + t.version + + ' importing ' + + e.version, ); var n = new this(); return ( @@ -7499,7 +7502,7 @@ documentStore: this.documentStore.toJSON(), tokenStore: this.tokenStore.toJSON(), corpusTokens: this.corpusTokens.toJSON(), - pipeline: this.pipeline.toJSON() + pipeline: this.pipeline.toJSON(), }; }), (t.Index.prototype.use = function(t) { @@ -7556,7 +7559,7 @@ aliti: 'al', iviti: 'ive', biliti: 'ble', - logi: 'log' + logi: 'log', }, e = { icate: 'ic', @@ -7565,7 +7568,7 @@ iciti: 'ic', ical: 'ic', ful: '', - ness: '' + ness: '', }, i = '[aeiouy]', o = '[^aeiou][^aeiouy]*', @@ -7644,7 +7647,7 @@ (r = m[1]), (p = new RegExp(h)), (f = new RegExp( - '^([^aeiou][^aeiouy]*)?[aeiouy][aeiou]*[^aeiou][^aeiouy]*([aeiouy][aeiou]*)?$' + '^([^aeiou][^aeiouy]*)?[aeiouy][aeiou]*[^aeiou][^aeiouy]*([aeiouy][aeiou]*)?$', )), (d = new RegExp('^' + o + i + '[^aeiouwxy]$')), (p.test(r) || (f.test(r) && !d.test(r))) && (n = r); @@ -7784,7 +7787,7 @@ 'would', 'yet', 'you', - 'your' + 'your', ]), t.Pipeline.registerFunction(t.stopWordFilter, 'stopWordFilter'), (t.trimmer = function(t) { @@ -7896,7 +7899,7 @@ var __extends = constructor: constructor, name: name, priority: priority, - instance: null + instance: null, }), services.sort(function(a, b) { return a.priority - b.priority; @@ -7909,7 +7912,7 @@ var __extends = selector: selector, constructor: constructor, priority: priority, - namespace: namespace + namespace: namespace, }), components.sort(function(a, b) { return a.priority - b.priority; @@ -7981,7 +7984,7 @@ var typedoc; (FilterItem.prototype.initialize = function() {}), (FilterItem.prototype.handleValueChange = function( oldValue, - newValue + newValue, ) {}), (FilterItem.prototype.fromLocalStorage = function(value) { return value; @@ -8015,12 +8018,12 @@ var typedoc; }), (FilterItemCheckbox.prototype.handleValueChange = function( oldValue, - newValue + newValue, ) { this.$checkbox.prop('checked', this.value), typedoc.$html.toggleClass( 'toggle-' + this.key, - this.value != this.defaultValue + this.value != this.defaultValue, ); }), (FilterItemCheckbox.prototype.fromLocalStorage = function(value) { @@ -8062,14 +8065,14 @@ var typedoc; }), (FilterItemSelect.prototype.handleValueChange = function( oldValue, - newValue + newValue, ) { this.$select.find('li.selected').removeClass('selected'), this.$select.find('.tsd-select-label').text( this.$select .find('li[data-value="' + newValue + '"]') .addClass('selected') - .text() + .text(), ), typedoc.$html.removeClass('toggle-' + oldValue), typedoc.$html.addClass('toggle-' + newValue); @@ -8083,13 +8086,13 @@ var typedoc; return ( (_this.optionVisibility = new FilterItemSelect( 'visibility', - 'private' + 'private', )), (_this.optionInherited = new FilterItemCheckbox('inherited', !0)), (_this.optionExternals = new FilterItemCheckbox('externals', !0)), (_this.optionOnlyExported = new FilterItemCheckbox( 'only-exported', - !1 + !1, )), _this ); @@ -8142,7 +8145,7 @@ var typedoc; _this.anchors.push({ $link: $(el.parentNode), $anchor: $anchor, - position: 0 + position: 0, }); } }), @@ -8252,7 +8255,7 @@ var typedoc; ? scrollTop > this.stickyBottom ? this.setState('sticky-bottom') : this.setState( - scrollTop + 20 > this.stickyTop ? 'sticky-current' : '' + scrollTop + 20 > this.stickyTop ? 'sticky-current' : '', ) : this.stickyMode == StickyMode.Secondary && (scrollTop > this.stickyBottom @@ -8322,7 +8325,7 @@ var typedoc; row.url + '" class="tsd-kind-icon">' + name + - '' + '', ); } } @@ -8490,7 +8493,7 @@ var typedoc; (this.groups = []), $signatures.each(function(index, el) { _this.groups.push( - new SignatureGroup($(el), $descriptions.eq(index)) + new SignatureGroup($(el), $descriptions.eq(index)), ); }); } @@ -8595,13 +8598,13 @@ var typedoc; 'scroll', _(function() { return _this.onScroll(); - }).throttle(10) + }).throttle(10), ), typedoc.$window.on( 'resize', _(function() { return _this.onResize(); - }).throttle(10) + }).throttle(10), ), _this.onResize(), _this.onScroll(), @@ -8638,7 +8641,7 @@ var typedoc; (typedoc.isPointerTouch = !1), (typedoc.hasPointerMoved = !1), (typedoc.isMobile = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test( - navigator.userAgent + navigator.userAgent, )), typedoc.$html.addClass(typedoc.isMobile ? 'is-mobile' : 'not-mobile'), typedoc.isMobile && @@ -8715,7 +8718,7 @@ var typedoc; OTransition: 'oTransitionEnd', msTransition: 'msTransitionEnd', MozTransition: 'transitionend', - WebkitTransition: 'webkitTransitionEnd' + WebkitTransition: 'webkitTransitionEnd', })), (typedoc.noTransition = noTransition), (typedoc.animateHeight = animateHeight); diff --git a/packages/store/docs/assets/js/search.js b/packages/store/docs/assets/js/search.js index 3aeb2888..0ff83113 100644 --- a/packages/store/docs/assets/js/search.js +++ b/packages/store/docs/assets/js/search.js @@ -8,7 +8,7 @@ typedoc.search.data = { '1024': 'Property', '2048': 'Method', '65536': 'Type literal', - '4194304': 'Type alias' + '4194304': 'Type alias', }, rows: [ { @@ -16,7 +16,7 @@ typedoc.search.data = { kind: 4194304, name: 'Comparator', url: 'globals.html#comparator', - classes: 'tsd-kind-type-alias' + classes: 'tsd-kind-type-alias', }, { id: 1, @@ -25,14 +25,14 @@ typedoc.search.data = { url: 'globals.html#comparator.__type', classes: 'tsd-kind-type-literal tsd-parent-kind-type-alias tsd-is-not-exported', - parent: 'Comparator' + parent: 'Comparator', }, { id: 2, kind: 4194304, name: 'Transformer', url: 'globals.html#transformer', - classes: 'tsd-kind-type-alias tsd-has-type-parameter' + classes: 'tsd-kind-type-alias tsd-has-type-parameter', }, { id: 3, @@ -41,28 +41,28 @@ typedoc.search.data = { url: 'globals.html#transformer.__type', classes: 'tsd-kind-type-literal tsd-parent-kind-type-alias tsd-is-not-exported', - parent: 'Transformer' + parent: 'Transformer', }, { id: 4, kind: 4194304, name: 'PropertySelector', url: 'globals.html#propertyselector', - classes: 'tsd-kind-type-alias' + classes: 'tsd-kind-type-alias', }, { id: 5, kind: 4194304, name: 'PathSelector', url: 'globals.html#pathselector', - classes: 'tsd-kind-type-alias' + classes: 'tsd-kind-type-alias', }, { id: 6, kind: 4194304, name: 'FunctionSelector', url: 'globals.html#functionselector', - classes: 'tsd-kind-type-alias tsd-has-type-parameter' + classes: 'tsd-kind-type-alias tsd-has-type-parameter', }, { id: 7, @@ -71,21 +71,21 @@ typedoc.search.data = { url: 'globals.html#functionselector.__type', classes: 'tsd-kind-type-literal tsd-parent-kind-type-alias tsd-is-not-exported', - parent: 'FunctionSelector' + parent: 'FunctionSelector', }, { id: 8, kind: 4194304, name: 'Selector', url: 'globals.html#selector', - classes: 'tsd-kind-type-alias tsd-has-type-parameter' + classes: 'tsd-kind-type-alias tsd-has-type-parameter', }, { id: 9, kind: 256, name: 'ObservableStore', url: 'interfaces/observablestore.html', - classes: 'tsd-kind-interface tsd-has-type-parameter' + classes: 'tsd-kind-interface tsd-has-type-parameter', }, { id: 10, @@ -93,7 +93,7 @@ typedoc.search.data = { name: 'select', url: 'interfaces/observablestore.html#select', classes: 'tsd-kind-property tsd-parent-kind-interface', - parent: 'ObservableStore' + parent: 'ObservableStore', }, { id: 11, @@ -102,7 +102,7 @@ typedoc.search.data = { url: 'interfaces/observablestore.html#select.__type-1', classes: 'tsd-kind-type-literal tsd-parent-kind-property tsd-has-type-parameter tsd-is-not-exported', - parent: 'ObservableStore.select' + parent: 'ObservableStore.select', }, { id: 12, @@ -110,7 +110,7 @@ typedoc.search.data = { name: 'configureSubStore', url: 'interfaces/observablestore.html#configuresubstore', classes: 'tsd-kind-property tsd-parent-kind-interface', - parent: 'ObservableStore' + parent: 'ObservableStore', }, { id: 13, @@ -119,7 +119,7 @@ typedoc.search.data = { url: 'interfaces/observablestore.html#configuresubstore.__type', classes: 'tsd-kind-type-literal tsd-parent-kind-property tsd-has-type-parameter tsd-is-not-exported', - parent: 'ObservableStore.configureSubStore' + parent: 'ObservableStore.configureSubStore', }, { id: 14, @@ -127,7 +127,7 @@ typedoc.search.data = { name: 'dispatch', url: 'interfaces/observablestore.html#dispatch', classes: 'tsd-kind-property tsd-parent-kind-interface tsd-is-inherited', - parent: 'ObservableStore' + parent: 'ObservableStore', }, { id: 15, @@ -135,7 +135,7 @@ typedoc.search.data = { name: 'getState', url: 'interfaces/observablestore.html#getstate', classes: 'tsd-kind-method tsd-parent-kind-interface tsd-is-inherited', - parent: 'ObservableStore' + parent: 'ObservableStore', }, { id: 16, @@ -143,7 +143,7 @@ typedoc.search.data = { name: 'subscribe', url: 'interfaces/observablestore.html#subscribe', classes: 'tsd-kind-method tsd-parent-kind-interface tsd-is-inherited', - parent: 'ObservableStore' + parent: 'ObservableStore', }, { id: 17, @@ -151,14 +151,14 @@ typedoc.search.data = { name: 'replaceReducer', url: 'interfaces/observablestore.html#replacereducer', classes: 'tsd-kind-method tsd-parent-kind-interface tsd-is-inherited', - parent: 'ObservableStore' + parent: 'ObservableStore', }, { id: 18, kind: 128, name: 'NgRedux', url: 'classes/ngredux.html', - classes: 'tsd-kind-class tsd-has-type-parameter' + classes: 'tsd-kind-class tsd-has-type-parameter', }, { id: 19, @@ -166,7 +166,7 @@ typedoc.search.data = { name: 'instance', url: 'classes/ngredux.html#instance', classes: 'tsd-kind-property tsd-parent-kind-class tsd-is-static', - parent: 'NgRedux' + parent: 'NgRedux', }, { id: 20, @@ -174,7 +174,7 @@ typedoc.search.data = { name: 'configureStore', url: 'classes/ngredux.html#configurestore', classes: 'tsd-kind-property tsd-parent-kind-class', - parent: 'NgRedux' + parent: 'NgRedux', }, { id: 21, @@ -183,7 +183,7 @@ typedoc.search.data = { url: 'classes/ngredux.html#configurestore.__type', classes: 'tsd-kind-type-literal tsd-parent-kind-property tsd-is-not-exported', - parent: 'NgRedux.configureStore' + parent: 'NgRedux.configureStore', }, { id: 22, @@ -191,7 +191,7 @@ typedoc.search.data = { name: 'provideStore', url: 'classes/ngredux.html#providestore', classes: 'tsd-kind-property tsd-parent-kind-class', - parent: 'NgRedux' + parent: 'NgRedux', }, { id: 23, @@ -200,7 +200,7 @@ typedoc.search.data = { url: 'classes/ngredux.html#providestore.__type-3', classes: 'tsd-kind-type-literal tsd-parent-kind-property tsd-is-not-exported', - parent: 'NgRedux.provideStore' + parent: 'NgRedux.provideStore', }, { id: 24, @@ -208,7 +208,7 @@ typedoc.search.data = { name: 'dispatch', url: 'classes/ngredux.html#dispatch', classes: 'tsd-kind-property tsd-parent-kind-class', - parent: 'NgRedux' + parent: 'NgRedux', }, { id: 25, @@ -216,7 +216,7 @@ typedoc.search.data = { name: 'getState', url: 'classes/ngredux.html#getstate', classes: 'tsd-kind-property tsd-parent-kind-class', - parent: 'NgRedux' + parent: 'NgRedux', }, { id: 26, @@ -225,7 +225,7 @@ typedoc.search.data = { url: 'classes/ngredux.html#getstate.__type-2', classes: 'tsd-kind-type-literal tsd-parent-kind-property tsd-is-not-exported', - parent: 'NgRedux.getState' + parent: 'NgRedux.getState', }, { id: 27, @@ -233,7 +233,7 @@ typedoc.search.data = { name: 'subscribe', url: 'classes/ngredux.html#subscribe', classes: 'tsd-kind-property tsd-parent-kind-class', - parent: 'NgRedux' + parent: 'NgRedux', }, { id: 28, @@ -242,7 +242,7 @@ typedoc.search.data = { url: 'classes/ngredux.html#subscribe.__type-6', classes: 'tsd-kind-type-literal tsd-parent-kind-property tsd-is-not-exported', - parent: 'NgRedux.subscribe' + parent: 'NgRedux.subscribe', }, { id: 29, @@ -250,7 +250,7 @@ typedoc.search.data = { name: 'replaceReducer', url: 'classes/ngredux.html#replacereducer', classes: 'tsd-kind-property tsd-parent-kind-class', - parent: 'NgRedux' + parent: 'NgRedux', }, { id: 30, @@ -259,7 +259,7 @@ typedoc.search.data = { url: 'classes/ngredux.html#replacereducer.__type-4', classes: 'tsd-kind-type-literal tsd-parent-kind-property tsd-is-not-exported', - parent: 'NgRedux.replaceReducer' + parent: 'NgRedux.replaceReducer', }, { id: 31, @@ -267,7 +267,7 @@ typedoc.search.data = { name: 'select', url: 'classes/ngredux.html#select', classes: 'tsd-kind-property tsd-parent-kind-class', - parent: 'NgRedux' + parent: 'NgRedux', }, { id: 32, @@ -276,7 +276,7 @@ typedoc.search.data = { url: 'classes/ngredux.html#select.__type-5', classes: 'tsd-kind-type-literal tsd-parent-kind-property tsd-has-type-parameter tsd-is-not-exported', - parent: 'NgRedux.select' + parent: 'NgRedux.select', }, { id: 33, @@ -284,7 +284,7 @@ typedoc.search.data = { name: 'configureSubStore', url: 'classes/ngredux.html#configuresubstore', classes: 'tsd-kind-property tsd-parent-kind-class', - parent: 'NgRedux' + parent: 'NgRedux', }, { id: 34, @@ -293,14 +293,14 @@ typedoc.search.data = { url: 'classes/ngredux.html#configuresubstore.__type-1', classes: 'tsd-kind-type-literal tsd-parent-kind-property tsd-has-type-parameter tsd-is-not-exported', - parent: 'NgRedux.configureSubStore' + parent: 'NgRedux.configureSubStore', }, { id: 35, kind: 128, name: 'DevToolsExtension', url: 'classes/devtoolsextension.html', - classes: 'tsd-kind-class' + classes: 'tsd-kind-class', }, { id: 36, @@ -308,7 +308,7 @@ typedoc.search.data = { name: 'enhancer', url: 'classes/devtoolsextension.html#enhancer', classes: 'tsd-kind-method tsd-parent-kind-class', - parent: 'DevToolsExtension' + parent: 'DevToolsExtension', }, { id: 37, @@ -316,21 +316,21 @@ typedoc.search.data = { name: 'isEnabled', url: 'classes/devtoolsextension.html#isenabled', classes: 'tsd-kind-method tsd-parent-kind-class', - parent: 'DevToolsExtension' + parent: 'DevToolsExtension', }, { id: 38, kind: 64, name: 'enableFractalReducers', url: 'globals.html#enablefractalreducers', - classes: 'tsd-kind-function' + classes: 'tsd-kind-function', }, { id: 39, kind: 256, name: 'IFractalStoreOptions', url: 'interfaces/ifractalstoreoptions.html', - classes: 'tsd-kind-interface' + classes: 'tsd-kind-interface', }, { id: 40, @@ -338,7 +338,7 @@ typedoc.search.data = { name: 'basePathMethodName', url: 'interfaces/ifractalstoreoptions.html#basepathmethodname', classes: 'tsd-kind-property tsd-parent-kind-interface', - parent: 'IFractalStoreOptions' + parent: 'IFractalStoreOptions', }, { id: 41, @@ -346,42 +346,42 @@ typedoc.search.data = { name: 'localReducer', url: 'interfaces/ifractalstoreoptions.html#localreducer', classes: 'tsd-kind-property tsd-parent-kind-interface', - parent: 'IFractalStoreOptions' + parent: 'IFractalStoreOptions', }, { id: 42, kind: 64, name: 'select', url: 'globals.html#select', - classes: 'tsd-kind-function tsd-has-type-parameter' + classes: 'tsd-kind-function tsd-has-type-parameter', }, { id: 43, kind: 64, name: 'select$', url: 'globals.html#select_', - classes: 'tsd-kind-function tsd-has-type-parameter' + classes: 'tsd-kind-function tsd-has-type-parameter', }, { id: 44, kind: 64, name: 'dispatch', url: 'globals.html#dispatch', - classes: 'tsd-kind-function' + classes: 'tsd-kind-function', }, { id: 45, kind: 64, name: 'WithSubStore', url: 'globals.html#withsubstore', - classes: 'tsd-kind-function' + classes: 'tsd-kind-function', }, { id: 46, kind: 128, name: 'NgReduxModule', url: 'classes/ngreduxmodule.html', - classes: 'tsd-kind-class' - } - ] + classes: 'tsd-kind-class', + }, + ], }; diff --git a/packages/store/package.json b/packages/store/package.json index e156b067..85f6cfba 100644 --- a/packages/store/package.json +++ b/packages/store/package.json @@ -53,7 +53,6 @@ "build:src": "ngc -p tsconfig.build.json", "build:testing": "ngc -p tsconfig.testing.json", "lint": "tslint 'src/**/*.ts'", - "prettier": "prettier --parser typescript --single-quote --trailing-comma es5 --write \"**/*.ts\"", "prepublish": "npm run lint && npm run build && npm test", "ci": "npm run lint && npm run build && npm test", "predoc": "rimraf docs", diff --git a/packages/store/src/components/fractal-reducer-map.ts b/packages/store/src/components/fractal-reducer-map.ts index 5c7184d2..16a2e386 100644 --- a/packages/store/src/components/fractal-reducer-map.ts +++ b/packages/store/src/components/fractal-reducer-map.ts @@ -24,12 +24,12 @@ export function enableFractalReducers(rootReducer: Reducer) { /** @hidden */ export function registerFractalReducer( basePath: PathSelector, - localReducer: Reducer + localReducer: Reducer, ): void { const existingFractalReducer = reducerMap[JSON.stringify(basePath)]; if (existingFractalReducer && existingFractalReducer !== localReducer) { throw new Error( - `attempt to overwrite fractal reducer for basePath ${basePath}` + `attempt to overwrite fractal reducer for basePath ${basePath}`, ); } @@ -39,14 +39,14 @@ export function registerFractalReducer( /** @hidden */ export function replaceLocalReducer( basePath: PathSelector, - nextLocalReducer: Reducer + nextLocalReducer: Reducer, ): void { reducerMap[JSON.stringify(basePath)] = nextLocalReducer; } function rootFractalReducer( state: {} = {}, - action: AnyAction & { '@angular-redux::fractalkey'?: string } + action: AnyAction & { '@angular-redux::fractalkey'?: string }, ) { const fractalKey = action['@angular-redux::fractalkey']; const fractalPath = fractalKey ? JSON.parse(fractalKey) : []; diff --git a/packages/store/src/components/ng-redux.ts b/packages/store/src/components/ng-redux.ts index 6369f464..0f6f99da 100644 --- a/packages/store/src/components/ng-redux.ts +++ b/packages/store/src/components/ng-redux.ts @@ -5,7 +5,7 @@ import { Unsubscribe, Middleware, Store, - StoreEnhancer + StoreEnhancer, } from 'redux'; import { Observable } from 'rxjs'; import { ObservableStore } from './observable-store'; @@ -36,7 +36,7 @@ export abstract class NgRedux implements ObservableStore { rootReducer: Reducer, initState: RootState, middleware?: Middleware[], - enhancers?: StoreEnhancer[] + enhancers?: StoreEnhancer[], ) => void; /** @@ -60,10 +60,10 @@ export abstract class NgRedux implements ObservableStore { // ObservableStore methods. abstract select: ( selector?: Selector, - comparator?: Comparator + comparator?: Comparator, ) => Observable; abstract configureSubStore: ( basePath: PathSelector, - localReducer: Reducer + localReducer: Reducer, ) => ObservableStore; } diff --git a/packages/store/src/components/observable-store.ts b/packages/store/src/components/observable-store.ts index ceacbdc4..25f98503 100644 --- a/packages/store/src/components/observable-store.ts +++ b/packages/store/src/components/observable-store.ts @@ -25,7 +25,7 @@ export interface ObservableStore extends Store { */ select: ( selector: Selector, - comparator?: Comparator + comparator?: Comparator, ) => Observable; /** @@ -41,6 +41,6 @@ export interface ObservableStore extends Store { */ configureSubStore: ( basePath: PathSelector, - localReducer: Reducer + localReducer: Reducer, ) => ObservableStore; } diff --git a/packages/store/src/components/root-store.spec.ts b/packages/store/src/components/root-store.spec.ts index 817b9806..6f83b27e 100644 --- a/packages/store/src/components/root-store.spec.ts +++ b/packages/store/src/components/root-store.spec.ts @@ -33,7 +33,7 @@ describe('NgRedux Observable Store', () => { defaultState = { foo: 'bar', bar: 'foo', - baz: -1 + baz: -1, }; rootReducer = (state = defaultState, action: PayloadAction) => { @@ -58,7 +58,7 @@ describe('NgRedux Observable Store', () => { // Configured once in beforeEach, now we try to configure // it a second time. expect( - ngRedux.configureStore.bind(ngRedux, rootReducer, defaultState) + ngRedux.configureStore.bind(ngRedux, rootReducer, defaultState), ).toThrowError(Error); }); @@ -255,7 +255,7 @@ describe('Chained actions in subscriptions', () => { beforeEach(() => { defaultState = { keyword: '', - keywordLength: -1 + keywordLength: -1, }; rootReducer = (state = defaultState, action: PayloadAction) => { diff --git a/packages/store/src/components/root-store.ts b/packages/store/src/components/root-store.ts index e7d3209e..f364be35 100644 --- a/packages/store/src/components/root-store.ts +++ b/packages/store/src/components/root-store.ts @@ -8,7 +8,7 @@ import { createStore, applyMiddleware, compose, - Dispatch + Dispatch, } from 'redux'; import { NgZone } from '@angular/core'; @@ -19,7 +19,7 @@ import { Selector, PathSelector, Comparator, - resolveToFunctionSelector + resolveToFunctionSelector, } from './selectors'; import { assert } from '../utils/assert'; import { SubStore } from './sub-store'; @@ -37,7 +37,7 @@ export class RootStore extends NgRedux { NgRedux.instance = this; this._store$ = new BehaviorSubject(undefined).pipe( filter(n => n !== undefined), - switchMap(observableStore => observableStore as any) + switchMap(observableStore => observableStore as any), // TODO: fix this? needing to explicitly cast this is wrong ) as BehaviorSubject; } @@ -46,15 +46,15 @@ export class RootStore extends NgRedux { rootReducer: Reducer, initState: RootState, middleware: Middleware[] = [], - enhancers: StoreEnhancer[] = [] + enhancers: StoreEnhancer[] = [], ): void => { assert(!this._store, 'Store already configured!'); // Variable-arity compose in typescript FTW. this.setStore( compose.apply(null, [applyMiddleware(...middleware), ...enhancers])( - createStore - )(enableFractalReducers(rootReducer), initState) + createStore, + )(enableFractalReducers(rootReducer), initState), ); }; @@ -77,7 +77,7 @@ export class RootStore extends NgRedux { !!this._store, 'Dispatch failed: did you forget to configure your store? ' + 'https://github.com/angular-redux/@angular-redux/core/blob/master/' + - 'README.md#quick-start' + 'README.md#quick-start', ); if (!NgZone.isInAngularZone()) { @@ -89,17 +89,17 @@ export class RootStore extends NgRedux { select = ( selector?: Selector, - comparator?: Comparator + comparator?: Comparator, ): Observable => this._store$.pipe( distinctUntilChanged(), map(resolveToFunctionSelector(selector)), - distinctUntilChanged(comparator) + distinctUntilChanged(comparator), ); configureSubStore = ( basePath: PathSelector, - localReducer: Reducer + localReducer: Reducer, ): ObservableStore => new SubStore(this, basePath, localReducer); @@ -110,12 +110,12 @@ export class RootStore extends NgRedux { } private storeToObservable = ( - store: Store + store: Store, ): Observable => new Observable((observer: Observer) => { observer.next(store.getState()); const unsubscribeFromRedux = store.subscribe(() => - observer.next(store.getState()) + observer.next(store.getState()), ); return () => { unsubscribeFromRedux(); diff --git a/packages/store/src/components/selectors.ts b/packages/store/src/components/selectors.ts index b41cbb02..bbada81e 100644 --- a/packages/store/src/components/selectors.ts +++ b/packages/store/src/components/selectors.ts @@ -14,7 +14,7 @@ import { Observable } from 'rxjs'; export type Comparator = (x: any, y: any) => boolean; export type Transformer = ( store$: Observable, - scope: any + scope: any, ) => Observable; export type PropertySelector = string | number | symbol; export type PathSelector = (string | number)[]; @@ -26,7 +26,7 @@ export type Selector = /** @hidden */ export const sniffSelectorType = ( - selector?: Selector + selector?: Selector, ) => !selector ? 'nil' @@ -42,10 +42,10 @@ export const resolver = (selector?: Selector) => ({ state ? state[selector as PropertySelector] : undefined, path: (state: RootState) => getIn(state, selector as PathSelector), function: selector as FunctionSelector, - nil: (state: RootState) => state + nil: (state: RootState) => state, }); /** @hidden */ export const resolveToFunctionSelector = ( - selector?: Selector + selector?: Selector, ) => resolver(selector)[sniffSelectorType(selector)]; diff --git a/packages/store/src/components/sub-store.spec.ts b/packages/store/src/components/sub-store.spec.ts index e8886c81..74f112b4 100644 --- a/packages/store/src/components/sub-store.spec.ts +++ b/packages/store/src/components/sub-store.spec.ts @@ -32,12 +32,12 @@ describe('Substore', () => { beforeEach(() => { ngRedux = new RootStore(new MockNgZone({ - enableLongStackTrace: false + enableLongStackTrace: false, }) as NgZone); ngRedux.configureStore(defaultReducer, { foo: { - bar: { wat: { quux: 3 } } - } + bar: { wat: { quux: 3 } }, + }, }); subStore = ngRedux.configureSubStore(basePath, defaultReducer); @@ -46,7 +46,7 @@ describe('Substore', () => { it('adds a key to actions it dispatches', () => expect(subStore.dispatch({ type: 'MY_ACTION' })).toEqual({ type: 'MY_ACTION', - '@angular-redux::fractalkey': '["foo","bar"]' + '@angular-redux::fractalkey': '["foo","bar"]', })); it('gets state rooted at the base path', () => @@ -59,54 +59,54 @@ describe('Substore', () => { it(`handles property selection on a base path that doesn't exist yet`, () => { const nonExistentSubStore = ngRedux.configureSubStore( ['sure', 'whatever'], - (state: any, action: any) => ({ ...state, value: action.newValue }) + (state: any, action: any) => ({ ...state, value: action.newValue }), ); nonExistentSubStore .select('value') .pipe( take(2), - toArray() + toArray(), ) .subscribe(v => expect(v).toEqual([undefined, 'now I exist'])); nonExistentSubStore.dispatch({ type: 'nvm', - newValue: 'now I exist' + newValue: 'now I exist', }); }); it(`handles path selection on a base path that doesn't exist yet`, () => { const nonExistentSubStore = ngRedux.configureSubStore( ['sure', 'whatever'], - (state: any, action: any) => ({ ...state, value: action.newValue }) + (state: any, action: any) => ({ ...state, value: action.newValue }), ); nonExistentSubStore .select(['value']) .pipe( take(2), - toArray() + toArray(), ) .subscribe(v => expect(v).toEqual([undefined, 'now I exist'])); nonExistentSubStore.dispatch({ type: 'nvm', - newValue: 'now I exist' + newValue: 'now I exist', }); }); it(`handles function selection on a base path that doesn't exist yet`, () => { const nonExistentSubStore = ngRedux.configureSubStore( ['sure', 'whatever'], - (state: any, action: any) => ({ ...state, value: action.newValue }) + (state: any, action: any) => ({ ...state, value: action.newValue }), ); nonExistentSubStore .select(s => (s ? s.value : s)) .pipe( take(2), - toArray() + toArray(), ) .subscribe(v => expect(v).toEqual([undefined, 'now I exist'])); nonExistentSubStore.dispatch({ type: 'nvm', - newValue: 'now I exist' + newValue: 'now I exist', }); }); @@ -117,7 +117,7 @@ describe('Substore', () => { expect(subSubStore.dispatch({ type: 'MY_ACTION' })).toEqual({ type: 'MY_ACTION', - '@angular-redux::fractalkey': '["foo","bar","wat"]' + '@angular-redux::fractalkey': '["foo","bar","wat"]', }); }); }); diff --git a/packages/store/src/components/sub-store.ts b/packages/store/src/components/sub-store.ts index 2b6f2bd0..0b29db49 100644 --- a/packages/store/src/components/sub-store.ts +++ b/packages/store/src/components/sub-store.ts @@ -7,13 +7,13 @@ import { PathSelector, Selector, Comparator, - resolveToFunctionSelector + resolveToFunctionSelector, } from './selectors'; import { NgRedux } from './ng-redux'; import { ObservableStore } from './observable-store'; import { registerFractalReducer, - replaceLocalReducer + replaceLocalReducer, } from './fractal-reducer-map'; /** @hidden */ @@ -21,7 +21,7 @@ export class SubStore implements ObservableStore { constructor( private rootStore: NgRedux, private basePath: PathSelector, - localReducer: Reducer + localReducer: Reducer, ) { registerFractalReducer(basePath, localReducer); } @@ -29,29 +29,29 @@ export class SubStore implements ObservableStore { dispatch: Dispatch = action => this.rootStore.dispatch( Object.assign({}, action, { - '@angular-redux::fractalkey': JSON.stringify(this.basePath) - }) + '@angular-redux::fractalkey': JSON.stringify(this.basePath), + }), ); getState = (): State => getIn(this.rootStore.getState(), this.basePath); configureSubStore = ( basePath: PathSelector, - localReducer: Reducer + localReducer: Reducer, ): ObservableStore => new SubStore( this.rootStore, [...this.basePath, ...basePath], - localReducer + localReducer, ); select = ( selector?: Selector, - comparator?: Comparator + comparator?: Comparator, ): Observable => this.rootStore.select(this.basePath).pipe( map(resolveToFunctionSelector(selector)), - distinctUntilChanged(comparator) + distinctUntilChanged(comparator), ); subscribe = (listener: () => void): (() => void) => { diff --git a/packages/store/src/decorators/dispatch.spec.ts b/packages/store/src/decorators/dispatch.spec.ts index fc112d10..6f59ca0b 100644 --- a/packages/store/src/decorators/dispatch.spec.ts +++ b/packages/store/src/decorators/dispatch.spec.ts @@ -28,7 +28,7 @@ describe('@dispatch', () => { beforeEach(() => { defaultState = { value: 'init-value', - instanceProperty: 'init-instanceProperty' + instanceProperty: 'init-instanceProperty', }; rootReducer = (state = defaultState, action: PayloadAction) => { @@ -59,21 +59,21 @@ describe('@dispatch', () => { classMethod(value: string): PayloadAction { return { type: 'TEST', - payload: { value, instanceProperty: this.instanceProperty } + payload: { value, instanceProperty: this.instanceProperty }, }; } @dispatch() conditionalDispatchMethod( - shouldDispatch: boolean + shouldDispatch: boolean, ): PayloadAction | false { if (shouldDispatch) { return { type: 'CONDITIONAL_DISPATCH_TEST', payload: { value: 'Conditional Dispatch Action', - instanceProperty: this.instanceProperty - } + instanceProperty: this.instanceProperty, + }, }; } else { return false; @@ -83,7 +83,7 @@ describe('@dispatch', () => { @dispatch() boundProperty = (value: string): PayloadAction => ({ type: 'TEST', - payload: { value, instanceProperty: this.instanceProperty } + payload: { value, instanceProperty: this.instanceProperty }, }); } @@ -99,15 +99,15 @@ describe('@dispatch', () => { type: 'TEST', payload: { value: 'class method', - instanceProperty: 'test' - } + instanceProperty: 'test', + }, }; expect(result.type).toBe('TEST'); expect(result.payload && result.payload.value).toBe('class method'); expect(result.payload && result.payload.instanceProperty).toBe('test'); expect(NgRedux.instance).toBeTruthy(); expect( - NgRedux.instance && NgRedux.instance.dispatch + NgRedux.instance && NgRedux.instance.dispatch, ).toHaveBeenCalledWith(expectedArgs); }); @@ -117,7 +117,7 @@ describe('@dispatch', () => { expect(result).toBe(false); expect(NgRedux.instance).toBeTruthy(); expect(NgRedux.instance && NgRedux.instance.getState()).toEqual( - stateBeforeAction + stateBeforeAction, ); }); @@ -125,18 +125,18 @@ describe('@dispatch', () => { const result = instance.conditionalDispatchMethod(true); expect(result.type).toBe('CONDITIONAL_DISPATCH_TEST'); expect(result.payload && result.payload.value).toBe( - 'Conditional Dispatch Action' + 'Conditional Dispatch Action', ); expect(result.payload && result.payload.instanceProperty).toBe('test'); expect(NgRedux.instance).toBeTruthy(); expect( - NgRedux.instance && NgRedux.instance.dispatch + NgRedux.instance && NgRedux.instance.dispatch, ).toHaveBeenCalledWith({ type: 'CONDITIONAL_DISPATCH_TEST', payload: { value: 'Conditional Dispatch Action', - instanceProperty: 'test' - } + instanceProperty: 'test', + }, }); }); @@ -146,15 +146,15 @@ describe('@dispatch', () => { type: 'TEST', payload: { value: 'bound property', - instanceProperty: 'test' - } + instanceProperty: 'test', + }, }; expect(result.type).toBe('TEST'); expect(result.payload && result.payload.value).toBe('bound property'); expect(result.payload && result.payload.instanceProperty).toBe('test'); expect(NgRedux.instance).toBeTruthy(); expect( - NgRedux.instance && NgRedux.instance.dispatch + NgRedux.instance && NgRedux.instance.dispatch, ).toHaveBeenCalledWith(expectedArgs); }); @@ -165,8 +165,8 @@ describe('@dispatch', () => { type: 'TEST', payload: { value, - instanceProperty - } + instanceProperty, + }, }; } instance.externalFunction = externalFunction; @@ -175,15 +175,15 @@ describe('@dispatch', () => { type: 'TEST', payload: { value: 'external function', - instanceProperty: 'test' - } + instanceProperty: 'test', + }, }; expect(result.type).toBe('TEST'); expect(result.payload && result.payload.value).toBe('external function'); expect(result.payload && result.payload.instanceProperty).toBe('test'); expect(NgRedux.instance).toBeTruthy(); expect( - NgRedux.instance && NgRedux.instance.dispatch + NgRedux.instance && NgRedux.instance.dispatch, ).toHaveBeenCalledWith(expectedArgs); }); }); @@ -192,7 +192,7 @@ describe('@dispatch', () => { const localReducer = (state: any, _: Action) => state; @WithSubStore({ basePathMethodName: 'getBasePath', - localReducer + localReducer, }) class TestClass { getBasePath = () => ['bar', 'foo']; @@ -201,7 +201,7 @@ describe('@dispatch', () => { decoratedActionCreator(value: string): PayloadAction { return { type: 'TEST', - payload: { value } + payload: { value }, }; } } @@ -216,11 +216,11 @@ describe('@dispatch', () => { instance.decoratedActionCreator('hello'); expect( - NgRedux.instance && NgRedux.instance.dispatch + NgRedux.instance && NgRedux.instance.dispatch, ).toHaveBeenCalledWith({ type: 'TEST', payload: { value: 'hello' }, - '@angular-redux::fractalkey': '["bar","foo"]' + '@angular-redux::fractalkey': '["bar","foo"]', }); }); }); diff --git a/packages/store/src/decorators/dispatch.ts b/packages/store/src/decorators/dispatch.ts index dd5082de..5d5ef757 100644 --- a/packages/store/src/decorators/dispatch.ts +++ b/packages/store/src/decorators/dispatch.ts @@ -11,7 +11,7 @@ export function dispatch(): PropertyDecorator { return function decorate( target: Object, key: string | symbol | number, - descriptor?: PropertyDescriptor + descriptor?: PropertyDescriptor, ): PropertyDescriptor { let originalMethod: Function; @@ -30,7 +30,7 @@ export function dispatch(): PropertyDecorator { if (descriptor === undefined) { const dispatchDescriptor: PropertyDescriptor = { get: () => wrapped, - set: setMethod => (originalMethod = setMethod) + set: setMethod => (originalMethod = setMethod), }; Object.defineProperty(target, key, dispatchDescriptor); return dispatchDescriptor; diff --git a/packages/store/src/decorators/helpers.ts b/packages/store/src/decorators/helpers.ts index 295c927d..d8cc1c41 100644 --- a/packages/store/src/decorators/helpers.ts +++ b/packages/store/src/decorators/helpers.ts @@ -5,7 +5,7 @@ import { Selector, PathSelector, Comparator, - Transformer + Transformer, } from '../components/selectors'; import { distinctUntilChanged } from 'rxjs/operators'; @@ -65,7 +65,7 @@ const getClassOptions = (decoratedInstance: any): IFractalStoreOptions => /** @hidden */ export const setClassOptions = ( decoratedClassConstructor: any, - options: IFractalStoreOptions + options: IFractalStoreOptions, ): void => { decoratedClassConstructor[OPTIONS_KEY] = options; }; @@ -76,7 +76,7 @@ export const setClassOptions = ( // instance is destroyed. const setInstanceStore = ( decoratedInstance: any, - store?: ObservableStore + store?: ObservableStore, ) => (decoratedInstance[INSTANCE_SUBSTORE_KEY] = store); const getInstanceStore = (decoratedInstance: any): ObservableStore => @@ -90,13 +90,13 @@ const getInstanceSelectionMap = (decoratedInstance: any) => { const hasBasePathChanged = ( decoratedInstance: any, - basePath?: PathSelector + basePath?: PathSelector, ): boolean => decoratedInstance[INSTANCE_BASE_PATH_KEY] !== (basePath || []).toString(); const setInstanceBasePath = ( decoratedInstance: any, - basePath?: PathSelector + basePath?: PathSelector, ): void => { decoratedInstance[INSTANCE_BASE_PATH_KEY] = (basePath || []).toString(); }; @@ -113,7 +113,7 @@ const clearInstanceState = (decoratedInstance: any) => { * @hidden */ export const getBaseStore = ( - decoratedInstance: any + decoratedInstance: any, ): ObservableStore | undefined => { // The root store hasn't been set up yet. if (!NgRedux.instance) { @@ -142,7 +142,7 @@ export const getBaseStore = ( if (!store) { setInstanceStore( decoratedInstance, - NgRedux.instance.configureSubStore(basePath, options.localReducer) + NgRedux.instance.configureSubStore(basePath, options.localReducer), ); } @@ -160,7 +160,7 @@ export const getInstanceSelection = ( key: string | symbol, selector: Selector, transformer?: Transformer, - comparator?: Comparator + comparator?: Comparator, ) => { const store = getBaseStore(decoratedInstance); @@ -173,7 +173,7 @@ export const getInstanceSelection = ( ? store.select(selector, comparator) : store.select(selector).pipe( obs$ => transformer(obs$, decoratedInstance), - distinctUntilChanged(comparator) + distinctUntilChanged(comparator), )); return selections[key]; diff --git a/packages/store/src/decorators/select.spec.ts b/packages/store/src/decorators/select.spec.ts index 6fc1fa6e..e94dbe4f 100644 --- a/packages/store/src/decorators/select.spec.ts +++ b/packages/store/src/decorators/select.spec.ts @@ -46,12 +46,12 @@ describe('Select decorators', () => { mockInstance.baz .pipe( take(2), - toArray() + toArray(), ) .subscribe( values => expect(values).toEqual([-1, 1]), undefined, - done + done, ); ngRedux.dispatch({ type: 'nvm', payload: 1 }); }); @@ -66,12 +66,12 @@ describe('Select decorators', () => { mockInstance.baz$ .pipe( take(2), - toArray() + toArray(), ) .subscribe( values => expect(values).toEqual([-1, 4]), undefined, - done + done, ); ngRedux.dispatch({ type: 'nvm', payload: 4 }); }); @@ -88,12 +88,12 @@ describe('Select decorators', () => { mockInstance.obs$ .pipe( take(2), - toArray() + toArray(), ) .subscribe( values => expect(values).toEqual([-1, 3]), undefined, - done + done, ); ngRedux.dispatch({ type: 'nvm', payload: 3 }); }); @@ -110,12 +110,12 @@ describe('Select decorators', () => { mockInstance.obs$ .pipe( take(2), - toArray() + toArray(), ) .subscribe( values => expect(values).toEqual([-2, 10]), undefined, - done + done, ); ngRedux.dispatch({ type: 'nvm', payload: 5 }); }); @@ -133,12 +133,12 @@ describe('Select decorators', () => { mockInstance.baz$ .pipe( take(2), - toArray() + toArray(), ) .subscribe( values => expect(values).toEqual([-1, 2]), undefined, - done + done, ); ngRedux.dispatch({ type: 'nvm', payload: 1 }); ngRedux.dispatch({ type: 'nvm', payload: 2 }); @@ -177,7 +177,7 @@ describe('Select decorators', () => { mockInstance.baz$ .pipe( take(2), - toArray() + toArray(), ) .subscribe(values => expect(values).toEqual([-2, 10]), undefined, done); ngRedux.dispatch({ type: 'nvm', payload: 5 }); @@ -195,12 +195,12 @@ describe('Select decorators', () => { mockInstance.baz$ .pipe( take(2), - toArray() + toArray(), ) .subscribe( values => expect(values).toEqual([-2, 2]), undefined, - done + done, ); ngRedux.dispatch({ type: 'nvm', payload: 1 }); ngRedux.dispatch({ type: 'nvm', payload: 2 }); diff --git a/packages/store/src/decorators/select.ts b/packages/store/src/decorators/select.ts index 8f5b8923..485b1405 100644 --- a/packages/store/src/decorators/select.ts +++ b/packages/store/src/decorators/select.ts @@ -22,7 +22,7 @@ import { getInstanceSelection } from './helpers'; */ export function select( selector?: Selector, - comparator?: Comparator + comparator?: Comparator, ): PropertyDecorator { return (target: any, key: string | symbol): void => { const adjustedSelector = selector @@ -60,7 +60,7 @@ export function select( export function select$( selector: Selector, transformer: Transformer, - comparator?: Comparator + comparator?: Comparator, ): PropertyDecorator { return decorate(selector, transformer, comparator); } @@ -68,7 +68,7 @@ export function select$( function decorate( selector: Selector, transformer?: Transformer, - comparator?: Comparator + comparator?: Comparator, ): PropertyDecorator { return function decorator(target: any, key): void { function getter(this: any) { @@ -80,7 +80,7 @@ function decorate( Object.defineProperty(target, key, { get: getter, enumerable: true, - configurable: true + configurable: true, }); } }; diff --git a/packages/store/src/decorators/with-sub-store.spec.ts b/packages/store/src/decorators/with-sub-store.spec.ts index e025b91a..2b480b14 100644 --- a/packages/store/src/decorators/with-sub-store.spec.ts +++ b/packages/store/src/decorators/with-sub-store.spec.ts @@ -27,12 +27,12 @@ describe('@WithSubStore', () => { const defaultState = { foo: 'Root Foo!', a: { - b: { foo: 'Foo!' } - } + b: { foo: 'Foo!' }, + }, }; ngRedux = new RootStore(new MockNgZone({ - enableLongStackTrace: false + enableLongStackTrace: false, }) as NgZone); NgRedux.instance = ngRedux; ngRedux.configureStore((state: any, _: Action) => state, defaultState); @@ -128,7 +128,7 @@ describe('@WithSubStore', () => { it('handle a base path with no extant store data', () => { const iDontExistYetReducer = ( state: any, - action: Action & { newValue?: string } + action: Action & { newValue?: string }, ) => ({ ...state, nonexistentkey: action.newValue }); @WithSubStore({ basePathMethodName, localReducer: iDontExistYetReducer }) @@ -143,10 +143,10 @@ describe('@WithSubStore', () => { testInstance.obs$ .pipe( take(2), - toArray() + toArray(), ) .subscribe((v: Array) => - expect(v).toEqual([undefined, 'now I exist']) + expect(v).toEqual([undefined, 'now I exist']), ); testInstance.makeItExist('now I exist'); }); @@ -215,7 +215,7 @@ describe('@WithSubStore', () => { new TestClass().createFooAction(); expect(ngRedux.dispatch).toHaveBeenCalledWith({ type: 'FOO', - '@angular-redux::fractalkey': JSON.stringify(['a', 'b']) + '@angular-redux::fractalkey': JSON.stringify(['a', 'b']), }); }); }); diff --git a/packages/store/src/decorators/with-sub-store.ts b/packages/store/src/decorators/with-sub-store.ts index 26651edf..a7b54588 100644 --- a/packages/store/src/decorators/with-sub-store.ts +++ b/packages/store/src/decorators/with-sub-store.ts @@ -10,12 +10,12 @@ import { IFractalStoreOptions, setClassOptions } from './helpers'; */ export function WithSubStore({ basePathMethodName, - localReducer + localReducer, }: IFractalStoreOptions): ClassDecorator { return function decorate(constructor: Function): void { setClassOptions(constructor, { basePathMethodName, - localReducer + localReducer, }); }; } diff --git a/packages/store/src/index.ts b/packages/store/src/index.ts index 19ff268f..84c25cc9 100644 --- a/packages/store/src/index.ts +++ b/packages/store/src/index.ts @@ -5,7 +5,7 @@ import { PropertySelector, FunctionSelector, Comparator, - Transformer + Transformer, } from './components/selectors'; import { ObservableStore } from './components/observable-store'; import { DevToolsExtension } from './components/dev-tools'; @@ -35,5 +35,5 @@ export { select$, dispatch, WithSubStore, - ObservableStore + ObservableStore, }; diff --git a/packages/store/src/ng-redux.module.ts b/packages/store/src/ng-redux.module.ts index d422d4fb..cdf07ef2 100644 --- a/packages/store/src/ng-redux.module.ts +++ b/packages/store/src/ng-redux.module.ts @@ -11,7 +11,7 @@ export function _ngReduxFactory(ngZone: NgZone) { @NgModule({ providers: [ DevToolsExtension, - { provide: NgRedux, useFactory: _ngReduxFactory, deps: [NgZone] } - ] + { provide: NgRedux, useFactory: _ngReduxFactory, deps: [NgZone] }, + ], }) export class NgReduxModule {} diff --git a/packages/store/src/utils/get-in.spec.ts b/packages/store/src/utils/get-in.spec.ts index 09fd6763..7b2f9a3c 100644 --- a/packages/store/src/utils/get-in.spec.ts +++ b/packages/store/src/utils/get-in.spec.ts @@ -21,7 +21,7 @@ describe('getIn', () => { a: false, b: 0, c: '', - d: undefined + d: undefined, }; expect(getIn(test, ['a'])).toEqual(false); expect(getIn(test, ['b'])).toEqual(0); @@ -35,8 +35,8 @@ describe('getIn', () => { a: false, b: 0, c: '', - d: undefined - } + d: undefined, + }, }; expect(getIn(test, ['foo', 'a'])).toEqual(false); expect(getIn(test, ['foo', 'b'])).toEqual(0); @@ -91,7 +91,8 @@ describe('getIn', () => { it('should defer to a native getIn function if it exists on the data', () => { const testPath = ['foo', 'bar']; const test = { - getIn: (path: (string | number)[]) => (path === testPath ? 42 : undefined) + getIn: (path: (string | number)[]) => + path === testPath ? 42 : undefined, }; expect(getIn(test, testPath)).toEqual(42); diff --git a/packages/store/src/utils/get-in.ts b/packages/store/src/utils/get-in.ts index 11b7e5ad..e7e4af05 100644 --- a/packages/store/src/utils/get-in.ts +++ b/packages/store/src/utils/get-in.ts @@ -6,7 +6,7 @@ */ export function getIn( v: any | undefined, - pathElems: (string | number)[] + pathElems: (string | number)[], ): any | undefined { if (!v) { return v; diff --git a/packages/store/src/utils/set-in.spec.ts b/packages/store/src/utils/set-in.spec.ts index bea6482c..9e5d1231 100644 --- a/packages/store/src/utils/set-in.spec.ts +++ b/packages/store/src/utils/set-in.spec.ts @@ -13,9 +13,9 @@ describe('setIn', () => { a: 1, b: { c: { - d: 2 - } - } + d: 2, + }, + }, }; expect(setIn(original, ['b', 'c', 'd'], 2)).toEqual(expected); @@ -26,17 +26,17 @@ describe('setIn', () => { const original = { a: 1, b: { - wat: 3 - } + wat: 3, + }, }; const expected = { a: 1, b: { wat: 3, c: { - d: 2 - } - } + d: 2, + }, + }, }; expect(setIn(original, ['b', 'c', 'd'], 2)).toEqual(expected); @@ -53,7 +53,7 @@ describe('setIn', () => { } const original = { - root: new TestClass() + root: new TestClass(), }; setIn(original, ['root', 'a', 'b', 'c'], 123); expect(setInCalled).toEqual(true); diff --git a/packages/store/src/utils/set-in.ts b/packages/store/src/utils/set-in.ts index bec334d8..dfcc3e18 100644 --- a/packages/store/src/utils/set-in.ts +++ b/packages/store/src/utils/set-in.ts @@ -8,17 +8,17 @@ export const setIn = ( obj: any, [firstElem, ...restElems]: (string | number)[], - value: any + value: any, ): Object => 'function' === typeof (obj[firstElem] || {}).setIn ? { ...obj, - [firstElem]: obj[firstElem].setIn(restElems, value) + [firstElem]: obj[firstElem].setIn(restElems, value), } : { ...obj, [firstElem]: restElems.length === 0 ? value - : setIn(obj[firstElem] || {}, restElems, value) + : setIn(obj[firstElem] || {}, restElems, value), }; diff --git a/packages/store/testing/index.ts b/packages/store/testing/index.ts index d7b66a9e..4bf3cf84 100644 --- a/packages/store/testing/index.ts +++ b/packages/store/testing/index.ts @@ -11,5 +11,5 @@ export { NgReduxTestingModule, MockDevToolsExtension, MockNgRedux, - MockObservableStore + MockObservableStore, }; diff --git a/packages/store/testing/ng-redux-testing.module.ts b/packages/store/testing/ng-redux-testing.module.ts index f6253994..de359716 100644 --- a/packages/store/testing/ng-redux-testing.module.ts +++ b/packages/store/testing/ng-redux-testing.module.ts @@ -15,7 +15,7 @@ export function _mockNgReduxFactory() { imports: [], providers: [ { provide: NgRedux, useFactory: _mockNgReduxFactory }, - { provide: DevToolsExtension, useClass: MockDevToolsExtension } - ] + { provide: DevToolsExtension, useClass: MockDevToolsExtension }, + ], }) export class NgReduxTestingModule {} diff --git a/packages/store/testing/ng-redux.mock.spec.ts b/packages/store/testing/ng-redux.mock.spec.ts index 73cb7563..8df6634f 100644 --- a/packages/store/testing/ng-redux.mock.spec.ts +++ b/packages/store/testing/ng-redux.mock.spec.ts @@ -8,7 +8,7 @@ import { NgRedux, select, select$ } from '../src'; @Component({ template: 'whatever', - selector: 'test-component' + selector: 'test-component', }) class TestComponent { @select('foo') readonly obs$: Observable; @@ -27,7 +27,7 @@ xdescribe('NgReduxMock', () => { beforeEach(() => { TestBed.configureTestingModule({ declarations: [TestComponent], - providers: [{ provide: NgRedux, useFactory: MockNgRedux.getInstance }] + providers: [{ provide: NgRedux, useFactory: MockNgRedux.getInstance }], }).compileComponents(); MockNgRedux.reset(); diff --git a/packages/store/testing/ng-redux.mock.ts b/packages/store/testing/ng-redux.mock.ts index 319e9809..4e091df8 100644 --- a/packages/store/testing/ng-redux.mock.ts +++ b/packages/store/testing/ng-redux.mock.ts @@ -2,7 +2,7 @@ import { NgRedux, Selector, Comparator, - PathSelector + PathSelector, } from '@angular-redux/store'; import { AnyAction, @@ -10,7 +10,7 @@ import { Dispatch, Middleware, Store, - StoreEnhancer + StoreEnhancer, } from 'redux'; import { Observable, Subject } from 'rxjs'; import { MockObservableStore } from './observable-store.mock'; @@ -34,11 +34,11 @@ export class MockNgRedux extends NgRedux { */ static getSelectorStub( selector?: Selector, - comparator?: Comparator + comparator?: Comparator, ): Subject { return MockNgRedux.getInstance().mockRootStore.getSelectorStub( selector, - comparator + comparator, ); } @@ -81,14 +81,14 @@ export class MockNgRedux extends NgRedux { _: Reducer, __: any, ___?: Middleware[], - ____?: StoreEnhancer[] + ____?: StoreEnhancer[], ): void => {}; configureSubStore = this.mockRootStore.configureSubStore; select: ( selector?: Selector, - comparator?: Comparator + comparator?: Comparator, ) => Observable = this.mockRootStore.select; dispatch = this.mockRootStore.dispatch as Dispatch; diff --git a/packages/store/testing/observable-store.mock.ts b/packages/store/testing/observable-store.mock.ts index eb243805..cc2fbfdb 100644 --- a/packages/store/testing/observable-store.mock.ts +++ b/packages/store/testing/observable-store.mock.ts @@ -2,7 +2,7 @@ import { Selector, Comparator, ObservableStore, - PathSelector + PathSelector, } from '@angular-redux/store'; import { AnyAction, Reducer, Dispatch } from 'redux'; import { Observable, Subject, ReplaySubject } from 'rxjs'; @@ -31,7 +31,7 @@ export class MockObservableStore implements ObservableStore { getSelectorStub = ( selector?: Selector, - comparator?: Comparator + comparator?: Comparator, ): Subject => this.initSelectorStub(selector, comparator).subject; @@ -48,7 +48,7 @@ export class MockObservableStore implements ObservableStore { select = ( selector?: Selector, - comparator?: Comparator + comparator?: Comparator, ): Observable => { const stub = this.initSelectorStub(selector, comparator); return stub.comparator @@ -58,7 +58,7 @@ export class MockObservableStore implements ObservableStore { configureSubStore = ( basePath: PathSelector, - _: Reducer + _: Reducer, ): MockObservableStore => this.initSubStore(basePath); getSubStore = ( @@ -80,12 +80,12 @@ export class MockObservableStore implements ObservableStore { private initSelectorStub( selector?: Selector, - comparator?: Comparator + comparator?: Comparator, ): SelectorStubRecord { const key = selector ? selector.toString() : ''; const record = this.selections[key] || { subject: new ReplaySubject(), - comparator + comparator, }; this.selections[key] = record; diff --git a/packages/store/tests.js b/packages/store/tests.js index c15b6085..0b7f4000 100644 --- a/packages/store/tests.js +++ b/packages/store/tests.js @@ -21,20 +21,20 @@ require('zone.js/dist/jasmine-patch.js'); const tsconfigPaths = require('tsconfig-paths'); tsconfigPaths.register({ baseUrl: '.', - paths: { '@angular-redux/store': [''] } + paths: { '@angular-redux/store': [''] }, }); const { getTestBed } = require('@angular/core/testing'); const { ServerTestingModule, - platformServerTesting + platformServerTesting, } = require('@angular/platform-server/testing'); getTestBed().initTestEnvironment(ServerTestingModule, platformServerTesting()); runner.loadConfig({ spec_dir: '.', - spec_files: ['**/*.spec.ts'] + spec_files: ['**/*.spec.ts'], }); runner.execute();