Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rework @turf/random & @turf/turf export modules #995

Merged
merged 1 commit into from
Oct 3, 2017

Conversation

DenisCarriere
Copy link
Member

Rework @turf/random & @turf/turf export * modules

Ref: #994

@turf/random

now exposes multiple methods:

import { randomPoint } from '@turf/random';

const bbox = [-70, 40, -60, 60]
const points = randomPoint(100, {bbox})

@turf/turf

Reworked exporting modules with multiple methods.

Before

export {
    coordEach,
    coordReduce,
    propEach,
    propReduce,
    featureEach,
    featureReduce,
    coordAll,
    geomEach,
    geomReduce,
    flattenEach,
    flattenReduce,
    segmentReduce,
    segmentEach,
    lineEach,
    lineReduce
} from '@turf/meta';

Now

export * from '@turf/meta';

Allowing this to work you can't have duplicate exported members (@turf/helpers has been added to @turf/meta & @turf/invariant to share methods & Typescript definitions).

Exporting all methods using * eliminates any possibilities of forgetting an exported method.

@DenisCarriere DenisCarriere added this to the 5.0.0 milestone Oct 3, 2017
@DenisCarriere DenisCarriere self-assigned this Oct 3, 2017
@DenisCarriere DenisCarriere merged commit 128ecb6 into master Oct 3, 2017
@DenisCarriere DenisCarriere deleted the random-rework branch October 3, 2017 20:31
@stebogit stebogit mentioned this pull request Nov 8, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant