• Clone value.

    Similar to foundry.utils.deepClone() but does not return references for DataModel instances.

    Parameters

    • original: object

      Original data

    • Optionaloptions: {
          source: undefined | boolean;
          strict: undefined | boolean;
      } = {}

      Additioanl options

      • source: undefined | boolean

        Return source data instead for supporting data.

      • strict: undefined | boolean

        Throw an error if a reference would be returned.

    Returns object

    • Cloned object
    • Documents are returned as references (unless source option is enabled)
    • PIXI graphics are returned as references
    • DataModels are extracted like objects with parent excluded
    • Unsupported objects call .toObject() when present, otherwise as references
    • With strict mode if reference would be returned.