Skip to content
This repository was archived by the owner on Feb 26, 2024. It is now read-only.

feat(helpers): add helpers module #212

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

jvandemo
Copy link
Contributor

This PR contains a helpers module as proposed in #211.

Goal

Centralize all helpers in a helpers module so they can be unit tested and reused in multiple places (e.g. in unit tests).

Helpers module

A helpers module has been added as src/helpers.ats, exporting all helper functions so they can be individually imported:

import {dashCase} from 'helpers';

or as a whole:

import * as helpers from '../src/helpers';
helpers.dashCase('someString');

Unit tests

Unit tests have been included to test the current behavior of the helpers.

karma

Still left to do

@btford — I have not touched any of the existing router code so you will still have to import the helper functions in existing modules (e.g. router.ats) and refactor existing code yourself.

This is deliberate to:

  • avoid code conflicts in case you already updated existing code by the time this PR is handled
  • allow you to maybe rename helper functions before refactoring existing code (in case you want to name some functions differently now that they can be reused)

If this PR needs additional work, please don't hesitate to let me know.

Thanks!

Review on Reviewable

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant