North Pittsburgh Meatpackers

    @turf/clone
    TypeScript icon, indicating that this package has built-in type declarations

    6.5.0 • Public • Published

    @turf/clone

    clone

    Returns a cloned copy of the passed GeoJSON Object, including possible 'Foreign Members'. ~3-5x faster than the common JSON.parse + JSON.stringify combo method.

    Parameters

    Examples

    var line = turf.lineString([[-74, 40], [-78, 42], [-82, 35]], {color: 'red'});
    
    var lineCloned = turf.clone(line);

    Returns GeoJSON cloned GeoJSON Object


    This module is part of the Turfjs project, an open source module collection dedicated to geographic algorithms. It is maintained in the Turfjs/turf repository, where you can create PRs and issues.

    Installation

    Install this module individually:

    $ npm install @turf/clone

    Or install the Turf module that includes it as a function:

    $ npm install @turf/turf

    Keywords

    Install

    npm i @turf/clone

    DownloadsWeekly Downloads

    490,314

    Version

    6.5.0

    License

    MIT

    Unpacked Size

    13 kB

    Total Files

    7

    Last publish

    Collaborators

    • twelch
    • jamesmilneruk
    • rowanwins
    • tmcw
    • morganherlocker
    • tcql
    • mdfedderly