MCPcopy
hub / github.com/deepstreamIO/deepstream.io / set

Method set

src/deepstream.io.ts:100–127  ·  view source on GitHub ↗

* Set a deepstream option. For a list of all available options * please see default-options.

(key: string, value: any)

Source from the content-addressed store, hash-verified

98 * please see default-options.
99 */
100 public set (key: string, value: any): any {
101 if (this.currentState === STATES.STOPPED) {
102 this.overrideSettings.push({ key, value })
103 return
104 }
105
106 if (key === 'storageExclusion') {
107 throw new Error('storageExclusion has been replace with record.storageExclusionPrefixes instead, which is an array of prefixes')
108 }
109
110 if (key === 'auth') {
111 throw new Error('auth has been replaced with authentication')
112 }
113
114 if (key === 'authentication') {
115 this.services.authentication = new CombineAuthentication(value instanceof Array ? value : [value])
116 return
117 }
118
119 if ((this.services as any)[key] !== undefined) {
120 (this.services as any)[key] = value
121 } else if (getValue(this.config, key) !== undefined) {
122 setValue(this.config, key, value)
123 } else {
124 throw new Error(`Unknown option or service "${key}"`)
125 }
126 return this
127 }
128
129/**
130 * Returns true if the deepstream server is running, otherwise false

Callers 12

configLoadedMethod · 0.95
isValidUserMethod · 0.45
updateStorageDirectlyMethod · 0.45
startServerMethod · 0.45
constructorMethod · 0.45
setFunction · 0.45
setWithPathFunction · 0.45
record-steps.tsFile · 0.45
setFunction · 0.45
setWithPathFunction · 0.45
eraseFunction · 0.45

Calls 2

getValueFunction · 0.90
setValueFunction · 0.90

Tested by

no test coverage detected