chore: remove OC.set and OC.get

Both are deprecated since Nextcloud 19.
- For `get`, if really needed, use https://lodash.com/docs#get
- And for `set` https://lodash.com/docs#set

Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
This commit is contained in:
Ferdinand Thiessen 2025-10-29 23:17:56 +01:00
parent 5060d64c9b
commit bea30fcb2b
2 changed files with 0 additions and 55 deletions

View file

@ -1,46 +0,0 @@
/**
* SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
/**
*
* @param context
*/
export function get(context) {
return (name) => {
const namespaces = name.split('.')
const tail = namespaces.pop()
for (let i = 0; i < namespaces.length; i++) {
context = context[namespaces[i]]
if (!context) {
return false
}
}
return context[tail]
}
}
/**
* Set a variable by name
*
* @param {string} context context
* @return {Function} setter
* @deprecated 19.0.0 use https://lodash.com/docs#set
*/
export function set(context) {
return (name, value) => {
const namespaces = name.split('.')
const tail = namespaces.pop()
for (let i = 0; i < namespaces.length; i++) {
if (!context[namespaces[i]]) {
context[namespaces[i]] = {}
}
context = context[namespaces[i]]
}
context[tail] = value
return value
}
}

View file

@ -49,7 +49,6 @@ import { currentUser, getCurrentUser } from './currentuser.js'
import { debug } from './debug.js'
import Dialogs from './dialogs.js'
import EventSource from './eventsource.js'
import { get, set } from './get_set.js'
import {
getHost,
getHostName,
@ -234,14 +233,6 @@ export default {
* @deprecated 19.0.0 use `generateUrl` from https://www.npmjs.com/package/@nextcloud/router
*/
generateUrl,
/**
* @deprecated 19.0.0 use https://lodash.com/docs#get
*/
get: get(window),
/**
* @deprecated 19.0.0 use https://lodash.com/docs#set
*/
set: set(window),
/**
* @deprecated 19.0.0 use `getRootUrl` from https://www.npmjs.com/package/@nextcloud/router
*/