Property Keys Reordering

Potency Low
Resilience High
Cost None
Tags: object, reorder, property, key

Description

Property Keys Reordering randomly reorders object literal's properties. The transformation doesn't reorder non-free side-effect expressions like IIFE, function calls, getter/setter, etc.

Code Annotation Example

// @jscrambler enable propertyKeysReordering

Example

The following example is an object literal with some properties:

var color = {
  red: "FF0000",
  blue: "0000FF",
  green: hexCode("green"),
  white: "FFFFFF"
}

red and blue properties are reordered but green, which value is a function call, is not:

var color = {
  blue: "0000FF",
  red: "FF0000",
  green: hexCode("green"),
  white: "FFFFFF"
}

API Parameters

Example:

{
  "keys": {
    "accessKey": "XXXXXX",
    "secretKey": "YYYYYY"
  },
  "applicationId": "ZZZZZZ",
  "params": [
    {
      "name": "propertyKeysReordering"
    }
  ]
}