Skip to content

.rename

W. "Mac" McMeans edited this page Jul 12, 2022 · 19 revisions

localDataStorage.rename( existingKey, newKey )

This method assigns the value of existingKey to newKey, where the key prefix is prepended to newKey. The existingKey is deleted from the store. Data types are preserved, so if a Float was set then a Float will be returned.

If newKey already exists, an error will be thrown because existing keys cannot be overwritten.

EXAMPLES:

● localData.rename( 'key1', 'key1-1000' )

🌐 This method may fire an event allowing you to monitor the name change.

🏿 The corresponding Memory Key method is _rename.

📝 NOTE: There is nothing to prevent you, inadvertently or otherwise, from renaming an obfuscated key (created using safeset). Once renamed, it is not possible to retrieve the original protected value as the name of the key itself is part of the logic that creates the protection.

localStorage Keys

The usual suspects:

set / get      clear      key      remove

The esoteric ones:

Array Keys:
push / pull, pullall      poke      contains      where

Broadcasting:
broadcast

Bypass:
forceset / forceget

Data Transfer:
import / export

Duplicates:
countdupes, showdupes, listdupes

Internals:
cancrunch      crunch / uncrunch

shufflestring / unshufflestring

xorstring

Management:
keys

Memory Consumption:

Memory Quota:
showquota

Query:
haskey, hasval, hastype

Security:
safeset / safeget

setscramblekey / getscramblekey

Type Check:
isarray      isbigint      isboolean      iscrunch

isdate      isfloat      isinteger      isnull

isnumber      isobject      isstring

showtype

Utility:
chopget      copy      softset      rename

Properties:

channel      length      quota      version

Settings:

verbosity

Memory Keys

Standard:

_set / _get      _clear      _key      _remove

Unconventional:

Data Sync:
_backup / _restore

Management:
_keys

Security:
_safeset / _safeget

Type Check:
_isarray      _isbigint      _isboolean      _iscrunch

_isdate      _isfloat      _isinteger      _isnull

_isnumber      _isobject      _isstring

_showtype

Utility:
_chopget      _copy      _softset      _rename

Clone this wiki locally