@prismicio/simulator 0.2.0 → 0.2.1-pr.24.39c33eb
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/SimulatorAPI.cjs +7 -9
- package/dist/SimulatorAPI.cjs.map +1 -1
- package/dist/SimulatorAPI.d.cts.map +1 -0
- package/dist/SimulatorAPI.d.ts.map +1 -0
- package/dist/SimulatorAPI.js +6 -8
- package/dist/SimulatorAPI.js.map +1 -1
- package/dist/SimulatorClient.cjs +7 -9
- package/dist/SimulatorClient.cjs.map +1 -1
- package/dist/SimulatorClient.d.cts.map +1 -0
- package/dist/SimulatorClient.d.ts.map +1 -0
- package/dist/SimulatorClient.js +6 -8
- package/dist/SimulatorClient.js.map +1 -1
- package/dist/channel/ChannelEmitter.cjs +10 -13
- package/dist/channel/ChannelEmitter.cjs.map +1 -1
- package/dist/channel/ChannelEmitter.d.cts +1 -3
- package/dist/channel/ChannelEmitter.d.cts.map +1 -0
- package/dist/channel/ChannelEmitter.d.ts +1 -3
- package/dist/channel/ChannelEmitter.d.ts.map +1 -0
- package/dist/channel/ChannelEmitter.js +6 -9
- package/dist/channel/ChannelEmitter.js.map +1 -1
- package/dist/channel/ChannelNetwork.cjs +5 -6
- package/dist/channel/ChannelNetwork.cjs.map +1 -1
- package/dist/channel/ChannelNetwork.d.cts.map +1 -0
- package/dist/channel/ChannelNetwork.d.ts.map +1 -0
- package/dist/channel/ChannelNetwork.js +3 -4
- package/dist/channel/ChannelNetwork.js.map +1 -1
- package/dist/channel/ChannelReceiver.cjs +12 -10
- package/dist/channel/ChannelReceiver.cjs.map +1 -1
- package/dist/channel/ChannelReceiver.d.cts.map +1 -0
- package/dist/channel/ChannelReceiver.d.ts.map +1 -0
- package/dist/channel/ChannelReceiver.js +8 -6
- package/dist/channel/ChannelReceiver.js.map +1 -1
- package/dist/channel/errors.cjs +1 -2
- package/dist/channel/errors.cjs.map +1 -1
- package/dist/channel/errors.d.cts.map +1 -0
- package/dist/channel/errors.d.ts.map +1 -0
- package/dist/channel/errors.js +1 -1
- package/dist/channel/errors.js.map +1 -1
- package/dist/channel/messages.cjs +5 -6
- package/dist/channel/messages.cjs.map +1 -1
- package/dist/channel/messages.d.cts +0 -1
- package/dist/channel/messages.d.cts.map +1 -0
- package/dist/channel/messages.d.ts +0 -1
- package/dist/channel/messages.d.ts.map +1 -0
- package/dist/channel/messages.js +5 -5
- package/dist/channel/messages.js.map +1 -1
- package/dist/channel/types.cjs +7 -8
- package/dist/channel/types.cjs.map +1 -1
- package/dist/channel/types.d.cts +1 -1
- package/dist/channel/types.d.cts.map +1 -0
- package/dist/channel/types.d.ts +1 -1
- package/dist/channel/types.d.ts.map +1 -0
- package/dist/channel/types.js +7 -7
- package/dist/channel/types.js.map +1 -1
- package/dist/globalExtensions.d.cts +1 -1
- package/dist/globalExtensions.d.cts.map +1 -0
- package/dist/globalExtensions.d.ts +1 -1
- package/dist/globalExtensions.d.ts.map +1 -0
- package/dist/index.cjs +7 -7
- package/dist/index.d.cts +0 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.js +2 -3
- package/dist/kit/SimulatorManager.cjs +12 -15
- package/dist/kit/SimulatorManager.cjs.map +1 -1
- package/dist/kit/SimulatorManager.d.cts.map +1 -0
- package/dist/kit/SimulatorManager.d.ts.map +1 -0
- package/dist/kit/SimulatorManager.js +7 -10
- package/dist/kit/SimulatorManager.js.map +1 -1
- package/dist/kit/State.cjs +7 -8
- package/dist/kit/State.cjs.map +1 -1
- package/dist/kit/State.d.cts.map +1 -0
- package/dist/kit/State.d.ts.map +1 -0
- package/dist/kit/State.js +4 -5
- package/dist/kit/State.js.map +1 -1
- package/dist/kit/domHelpers.cjs +1 -2
- package/dist/kit/domHelpers.cjs.map +1 -1
- package/dist/kit/domHelpers.d.cts.map +1 -0
- package/dist/kit/domHelpers.d.ts.map +1 -0
- package/dist/kit/domHelpers.js +1 -1
- package/dist/kit/domHelpers.js.map +1 -1
- package/dist/kit/eventHandlers.cjs +1 -2
- package/dist/kit/eventHandlers.cjs.map +1 -1
- package/dist/kit/eventHandlers.d.cts.map +1 -0
- package/dist/kit/eventHandlers.d.ts.map +1 -0
- package/dist/kit/eventHandlers.js +1 -1
- package/dist/kit/eventHandlers.js.map +1 -1
- package/dist/kit/getDefault.cjs +1 -2
- package/dist/kit/getDefault.cjs.map +1 -1
- package/dist/kit/getDefault.d.cts.map +1 -0
- package/dist/kit/getDefault.d.ts.map +1 -0
- package/dist/kit/getDefault.js +1 -1
- package/dist/kit/messages.cjs +3 -6
- package/dist/kit/messages.cjs.map +1 -1
- package/dist/kit/messages.d.cts.map +1 -0
- package/dist/kit/messages.d.ts.map +1 -0
- package/dist/kit/messages.js +3 -5
- package/dist/kit/messages.js.map +1 -1
- package/dist/kit/types.cjs +6 -7
- package/dist/kit/types.cjs.map +1 -1
- package/dist/kit/types.d.cts +1 -1
- package/dist/kit/types.d.cts.map +1 -0
- package/dist/kit/types.d.ts +1 -1
- package/dist/kit/types.d.ts.map +1 -0
- package/dist/kit/types.js +6 -6
- package/dist/kit/types.js.map +1 -1
- package/dist/kit.cjs +9 -9
- package/dist/kit.js +3 -4
- package/dist/lib/EventEmitter.cjs +1 -2
- package/dist/lib/EventEmitter.cjs.map +1 -1
- package/dist/lib/EventEmitter.d.cts.map +1 -0
- package/dist/lib/EventEmitter.d.ts.map +1 -0
- package/dist/lib/EventEmitter.js +1 -1
- package/dist/lib/EventEmitter.js.map +1 -1
- package/dist/lib/throttle.cjs +1 -2
- package/dist/lib/throttle.cjs.map +1 -1
- package/dist/lib/throttle.js +1 -1
- package/dist/types.cjs +10 -11
- package/dist/types.cjs.map +1 -1
- package/dist/types.d.cts +2 -2
- package/dist/types.d.cts.map +1 -0
- package/dist/types.d.ts +2 -2
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +10 -10
- package/dist/types.js.map +1 -1
- package/package.json +33 -35
- package/src/SimulatorAPI.ts +14 -30
- package/src/SimulatorClient.ts +15 -32
- package/src/channel/ChannelEmitter.ts +25 -57
- package/src/channel/ChannelNetwork.ts +36 -61
- package/src/channel/ChannelReceiver.ts +36 -51
- package/src/channel/errors.ts +2 -7
- package/src/channel/index.ts +5 -20
- package/src/channel/messages.ts +4 -13
- package/src/channel/types.ts +15 -31
- package/src/index.ts +2 -10
- package/src/kit/SimulatorManager.ts +7 -20
- package/src/kit/State.ts +4 -9
- package/src/kit/domHelpers.ts +1 -3
- package/src/kit/eventHandlers.ts +2 -7
- package/src/kit/index.ts +1 -5
- package/src/kit/messages.ts +1 -2
- package/src/kit/types.ts +0 -1
- package/src/lib/EventEmitter.ts +3 -9
- package/src/lib/__PRODUCTION__.ts +1 -2
package/src/channel/types.ts
CHANGED
|
@@ -27,13 +27,15 @@ export type ResponseMessage<TData = void, TError = unknown> =
|
|
|
27
27
|
| SuccessResponseMessage<TData>
|
|
28
28
|
| ErrorResponseMessage<TError>
|
|
29
29
|
|
|
30
|
-
export type ExtractSuccessResponseMessage<
|
|
31
|
-
TResponse
|
|
32
|
-
|
|
30
|
+
export type ExtractSuccessResponseMessage<TResponse extends UnknownResponseMessage> = Extract<
|
|
31
|
+
TResponse,
|
|
32
|
+
{ error?: never }
|
|
33
|
+
>
|
|
33
34
|
|
|
34
|
-
export type ExtractErrorResponseMessage<
|
|
35
|
-
TResponse
|
|
36
|
-
|
|
35
|
+
export type ExtractErrorResponseMessage<TResponse extends UnknownResponseMessage> = Extract<
|
|
36
|
+
TResponse,
|
|
37
|
+
{ data?: never }
|
|
38
|
+
>
|
|
37
39
|
|
|
38
40
|
// Unknown messages
|
|
39
41
|
export type UnknownRequestMessage = RequestMessage<string, unknown>
|
|
@@ -42,9 +44,7 @@ export type UnknownSuccessResponseMessage = SuccessResponseMessage<unknown>
|
|
|
42
44
|
|
|
43
45
|
export type UnknownErrorResponseMessage = ErrorResponseMessage<unknown>
|
|
44
46
|
|
|
45
|
-
export type UnknownResponseMessage =
|
|
46
|
-
| UnknownSuccessResponseMessage
|
|
47
|
-
| UnknownErrorResponseMessage
|
|
47
|
+
export type UnknownResponseMessage = UnknownSuccessResponseMessage | UnknownErrorResponseMessage
|
|
48
48
|
|
|
49
49
|
export type UnknownMessage = UnknownRequestMessage | UnknownResponseMessage
|
|
50
50
|
|
|
@@ -58,19 +58,13 @@ export type Transaction<
|
|
|
58
58
|
}
|
|
59
59
|
|
|
60
60
|
export type TransactionMethod<
|
|
61
|
-
TTransaction extends Transaction<
|
|
62
|
-
UnknownRequestMessage,
|
|
63
|
-
UnknownResponseMessage
|
|
64
|
-
>,
|
|
61
|
+
TTransaction extends Transaction<UnknownRequestMessage, UnknownResponseMessage>,
|
|
65
62
|
> = (
|
|
66
63
|
data: TTransaction["request"]["data"],
|
|
67
64
|
) => Promise<ExtractSuccessResponseMessage<TTransaction["response"]>>
|
|
68
65
|
|
|
69
66
|
export type TransactionHandler<
|
|
70
|
-
TTransaction extends Transaction<
|
|
71
|
-
UnknownRequestMessage,
|
|
72
|
-
UnknownResponseMessage
|
|
73
|
-
>,
|
|
67
|
+
TTransaction extends Transaction<UnknownRequestMessage, UnknownResponseMessage>,
|
|
74
68
|
> = (
|
|
75
69
|
request: TTransaction["request"],
|
|
76
70
|
response: {
|
|
@@ -85,23 +79,16 @@ export type TransactionHandler<
|
|
|
85
79
|
},
|
|
86
80
|
) => Promise<TTransaction["response"]> | TTransaction["response"]
|
|
87
81
|
|
|
88
|
-
export type TransactionsMethods<
|
|
89
|
-
TTransactions extends Record<string, UnknownTransaction>,
|
|
90
|
-
> = {
|
|
82
|
+
export type TransactionsMethods<TTransactions extends Record<string, UnknownTransaction>> = {
|
|
91
83
|
[Key in keyof TTransactions]: TransactionMethod<TTransactions[Key]>
|
|
92
84
|
}
|
|
93
85
|
|
|
94
|
-
export type TransactionsHandlers<
|
|
95
|
-
TTransactions extends Record<string, UnknownTransaction>,
|
|
96
|
-
> = {
|
|
86
|
+
export type TransactionsHandlers<TTransactions extends Record<string, UnknownTransaction>> = {
|
|
97
87
|
[Key in keyof TTransactions]: TransactionHandler<TTransactions[Key]>
|
|
98
88
|
}
|
|
99
89
|
|
|
100
90
|
// Unknown transactions
|
|
101
|
-
export type UnknownTransaction = Transaction<
|
|
102
|
-
UnknownRequestMessage,
|
|
103
|
-
UnknownResponseMessage
|
|
104
|
-
>
|
|
91
|
+
export type UnknownTransaction = Transaction<UnknownRequestMessage, UnknownResponseMessage>
|
|
105
92
|
|
|
106
93
|
export type UnknownTransactionMethod = TransactionMethod<UnknownTransaction>
|
|
107
94
|
|
|
@@ -118,10 +105,7 @@ export type InternalEmitterTransactions<
|
|
|
118
105
|
[InternalEmitterRequestType.Connect]: Transaction<
|
|
119
106
|
RequestMessage<
|
|
120
107
|
InternalEmitterRequestType.Connect,
|
|
121
|
-
|
|
|
122
|
-
Omit<TReceiverOptions, "debug" | "requestIDPrefix" | "readyTimeout">
|
|
123
|
-
>
|
|
124
|
-
| undefined
|
|
108
|
+
Partial<Omit<TReceiverOptions, "debug" | "requestIDPrefix" | "readyTimeout">> | undefined
|
|
125
109
|
>
|
|
126
110
|
>
|
|
127
111
|
}
|
package/src/index.ts
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
export {
|
|
2
|
-
SimulatorClient,
|
|
3
|
-
simulatorClientDefaultOptions,
|
|
4
|
-
} from "./SimulatorClient"
|
|
1
|
+
export { SimulatorClient, simulatorClientDefaultOptions } from "./SimulatorClient"
|
|
5
2
|
|
|
6
3
|
export { SimulatorAPI, simulatorAPIDefaultOptions } from "./SimulatorAPI"
|
|
7
4
|
export type { SimulatorAPIOptions } from "./SimulatorAPI"
|
|
@@ -32,11 +29,6 @@ export type {
|
|
|
32
29
|
} from "./channel"
|
|
33
30
|
|
|
34
31
|
export { APIRequestType, ClientRequestType } from "./types"
|
|
35
|
-
export type {
|
|
36
|
-
ActiveSlice,
|
|
37
|
-
SliceZoneSize,
|
|
38
|
-
APITransactions,
|
|
39
|
-
ClientTransactions,
|
|
40
|
-
} from "./types"
|
|
32
|
+
export type { ActiveSlice, SliceZoneSize, APITransactions, ClientTransactions } from "./types"
|
|
41
33
|
|
|
42
34
|
export * from "./globalExtensions"
|
|
@@ -1,20 +1,13 @@
|
|
|
1
1
|
import type { SliceZone } from "@prismicio/client"
|
|
2
2
|
|
|
3
|
+
import { ResponseError } from "../channel"
|
|
3
4
|
import { throttle } from "../lib/throttle"
|
|
4
|
-
|
|
5
|
-
import { ClientRequestType } from "../types"
|
|
6
|
-
import { StateEventType } from "./types"
|
|
7
|
-
|
|
8
5
|
import { SimulatorAPI } from "../SimulatorAPI"
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
import { State } from "./State"
|
|
12
|
-
import {
|
|
13
|
-
getSimulatorDOM,
|
|
14
|
-
getSimulatorRootDOM,
|
|
15
|
-
getSliceZoneDOM,
|
|
16
|
-
} from "./domHelpers"
|
|
6
|
+
import { ClientRequestType } from "../types"
|
|
7
|
+
import { getSimulatorDOM, getSimulatorRootDOM, getSliceZoneDOM } from "./domHelpers"
|
|
17
8
|
import { sliceSimulatorAccessedDirectly } from "./messages"
|
|
9
|
+
import { State } from "./State"
|
|
10
|
+
import { StateEventType } from "./types"
|
|
18
11
|
|
|
19
12
|
type ManagerConstructorArgs = {
|
|
20
13
|
slices?: SliceZone
|
|
@@ -142,10 +135,7 @@ export class SimulatorManager {
|
|
|
142
135
|
await this._api.setActiveSlice(activeSlice)
|
|
143
136
|
} catch (error) {
|
|
144
137
|
// Just log bad requests, throw everything else
|
|
145
|
-
if (
|
|
146
|
-
error instanceof ResponseError &&
|
|
147
|
-
error.response.status === 400
|
|
148
|
-
) {
|
|
138
|
+
if (error instanceof ResponseError && error.response.status === 400) {
|
|
149
139
|
console.error(error.response)
|
|
150
140
|
} else {
|
|
151
141
|
throw error
|
|
@@ -166,10 +156,7 @@ export class SimulatorManager {
|
|
|
166
156
|
await this._api.setSliceZoneSize({ rect: entry.contentRect })
|
|
167
157
|
} catch (error) {
|
|
168
158
|
// Just log bad requests, throw everything else
|
|
169
|
-
if (
|
|
170
|
-
error instanceof ResponseError &&
|
|
171
|
-
error.response.status === 400
|
|
172
|
-
) {
|
|
159
|
+
if (error instanceof ResponseError && error.response.status === 400) {
|
|
173
160
|
console.error(error.response)
|
|
174
161
|
} else {
|
|
175
162
|
throw error
|
package/src/kit/State.ts
CHANGED
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
import type { SharedSlice, SliceZone } from "@prismicio/client"
|
|
2
2
|
|
|
3
|
-
import { EventEmitter } from "../lib/EventEmitter"
|
|
4
3
|
import { __PRODUCTION__ } from "../lib/__PRODUCTION__"
|
|
4
|
+
import { EventEmitter } from "../lib/EventEmitter"
|
|
5
5
|
import { throttle } from "../lib/throttle"
|
|
6
|
-
|
|
7
6
|
import type { ActiveSlice } from "../types"
|
|
8
|
-
import type { StateEvents } from "./types";
|
|
9
|
-
import { StateEventType } from "./types"
|
|
10
|
-
|
|
11
7
|
import { getActiveSliceDOM, getSliceZoneDOM } from "./domHelpers"
|
|
12
8
|
import { getDefaultSlices } from "./getDefault"
|
|
9
|
+
import type { StateEvents } from "./types"
|
|
10
|
+
import { StateEventType } from "./types"
|
|
13
11
|
|
|
14
12
|
type StateConstructorArgs = {
|
|
15
13
|
slices?: SliceZone
|
|
@@ -92,10 +90,7 @@ export class State extends EventEmitter<StateEvents> {
|
|
|
92
90
|
return
|
|
93
91
|
}
|
|
94
92
|
|
|
95
|
-
const activeSliceIndex = Array.prototype.indexOf.call(
|
|
96
|
-
$sliceZone.children,
|
|
97
|
-
$activeSlice,
|
|
98
|
-
)
|
|
93
|
+
const activeSliceIndex = Array.prototype.indexOf.call($sliceZone.children, $activeSlice)
|
|
99
94
|
|
|
100
95
|
// Active slice has been found
|
|
101
96
|
this.activeSlice = {
|
package/src/kit/domHelpers.ts
CHANGED
|
@@ -9,9 +9,7 @@ export const getSimulatorRootDOM = (): Element | null => {
|
|
|
9
9
|
return document.querySelector(`.${simulatorRootClass}`)
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
export const getSliceZoneDOM = (
|
|
13
|
-
expectedNumberOfChildren: number,
|
|
14
|
-
): Element | null => {
|
|
12
|
+
export const getSliceZoneDOM = (expectedNumberOfChildren: number): Element | null => {
|
|
15
13
|
// If SliceZone has been tagged (#5)
|
|
16
14
|
let node = document.querySelector(`.${simulatorClass} [data-slice-zone]`)
|
|
17
15
|
if (node) {
|
package/src/kit/eventHandlers.ts
CHANGED
|
@@ -3,13 +3,8 @@ export const disableEventHandler = (event: Event): void => {
|
|
|
3
3
|
event.stopPropagation()
|
|
4
4
|
}
|
|
5
5
|
|
|
6
|
-
export const onClickHandler = (
|
|
7
|
-
event
|
|
8
|
-
): void => {
|
|
9
|
-
if (
|
|
10
|
-
event.path &&
|
|
11
|
-
event.path.slice(0, 5).some((el) => el instanceof HTMLAnchorElement)
|
|
12
|
-
) {
|
|
6
|
+
export const onClickHandler = (event: MouseEvent & { path?: HTMLElement[] }): void => {
|
|
7
|
+
if (event.path && event.path.slice(0, 5).some((el) => el instanceof HTMLAnchorElement)) {
|
|
13
8
|
event.preventDefault()
|
|
14
9
|
event.stopPropagation()
|
|
15
10
|
}
|
package/src/kit/index.ts
CHANGED
|
@@ -3,11 +3,7 @@ export { SimulatorManager } from "./SimulatorManager"
|
|
|
3
3
|
export { State } from "./State"
|
|
4
4
|
|
|
5
5
|
// Defaults
|
|
6
|
-
export {
|
|
7
|
-
getDefaultProps,
|
|
8
|
-
getDefaultSlices,
|
|
9
|
-
getDefaultMessage,
|
|
10
|
-
} from "./getDefault"
|
|
6
|
+
export { getDefaultProps, getDefaultSlices, getDefaultMessage } from "./getDefault"
|
|
11
7
|
|
|
12
8
|
// DOM helpers
|
|
13
9
|
export {
|
package/src/kit/messages.ts
CHANGED
|
@@ -7,8 +7,7 @@ const a = (href: string, label?: string) =>
|
|
|
7
7
|
const header =
|
|
8
8
|
" _____ ___ _____ _ __ __ \n / ___// (_)_______ / ___/(_)___ ___ __ __/ /___ _/ /_____ _____\n \\__ \\/ / / ___/ _ \\\\__ \\/ / __ `__ \\/ / / / / __ `/ __/ __ \\/ ___/\n ___/ / / / /__/ __/__/ / / / / / / / /_/ / / /_/ / /_/ /_/ / / \n/____/_/_/\\___/\\___/____/_/_/ /_/ /_/\\__,_/_/\\__,_/\\__/\\____/_/ \n / /_ __ __ / __ \\_____(_)________ ___ (_)____\n / __ \\/ / / / / /_/ / ___/ / ___/ __ `__ \\/ / ___/\n / /_/ / /_/ / / ____/ / / (__ ) / / / / / / /__ \n /_.___/\\__, / /_/ /_/ /_/____/_/ /_/ /_/_/\\___/ \n /____/\n\n"
|
|
9
9
|
|
|
10
|
-
const footer =
|
|
11
|
-
"\n\n\n\n\n\n - The Prismic team"
|
|
10
|
+
const footer = "\n\n\n\n\n\n - The Prismic team"
|
|
12
11
|
|
|
13
12
|
export const sliceSimulatorAccessedDirectly = div(
|
|
14
13
|
[
|
package/src/kit/types.ts
CHANGED
package/src/lib/EventEmitter.ts
CHANGED
|
@@ -14,21 +14,15 @@ export abstract class EventEmitter<TEventMap = EventMap> {
|
|
|
14
14
|
listener: Listener<TEventMap[TEventType]>,
|
|
15
15
|
key: string | null = null,
|
|
16
16
|
): void {
|
|
17
|
-
this._listeners[event] = [
|
|
18
|
-
...(this._listeners[event] ?? []),
|
|
19
|
-
[listener, key],
|
|
20
|
-
]
|
|
17
|
+
this._listeners[event] = [...(this._listeners[event] ?? []), [listener, key]]
|
|
21
18
|
}
|
|
22
19
|
|
|
23
20
|
off<TEventType extends keyof TEventMap>(
|
|
24
21
|
event: TEventType,
|
|
25
22
|
listenerOrKey: Listener<TEventMap[TEventType]> | string,
|
|
26
23
|
): void {
|
|
27
|
-
this._listeners[event] = (this._listeners[event] ?? []).filter(
|
|
28
|
-
|
|
29
|
-
typeof listenerOrKey === "function"
|
|
30
|
-
? listener !== listenerOrKey
|
|
31
|
-
: key !== listenerOrKey,
|
|
24
|
+
this._listeners[event] = (this._listeners[event] ?? []).filter(([listener, key]) =>
|
|
25
|
+
typeof listenerOrKey === "function" ? listener !== listenerOrKey : key !== listenerOrKey,
|
|
32
26
|
)
|
|
33
27
|
}
|
|
34
28
|
|
|
@@ -6,7 +6,6 @@ if (typeof process === "undefined") {
|
|
|
6
6
|
/**
|
|
7
7
|
* `true` if in the production environment, `false` otherwise.
|
|
8
8
|
*
|
|
9
|
-
* This boolean can be used to perform actions only in development environments,
|
|
10
|
-
* such as logging.
|
|
9
|
+
* This boolean can be used to perform actions only in development environments, such as logging.
|
|
11
10
|
*/
|
|
12
11
|
export const __PRODUCTION__ = process.env.NODE_ENV === "production"
|