• Clone value.

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

    Parameters

    • original: object

      Original data

    • Optional options: {
          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

    Remarks

    • 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

    Throws

    • With strict mode if reference would be returned.

Generated using TypeDoc