Skip to content
This repository has been archived by the owner on Feb 1, 2019. It is now read-only.

Require all the things #28

Merged
merged 3 commits into from
Jan 16, 2015
Merged

Require all the things #28

merged 3 commits into from
Jan 16, 2015

Conversation

poorgeek
Copy link
Contributor

Require all of the JSON spec files rather than dynamically loading them as intended.

Due to browserify/browserify#377, we have to require all of the JSON spec files and then provide an interface for only returning the ones we want from getFileSpec and getEdits.

Justin Stockton added 2 commits January 16, 2015 08:31
…em as intended.

Due to browserify/browserify#377, we have to require all of the JSON spec files and then provide an interface for only returning the ones we want from getFileSpec and getEdits.

var // 2013 Edits
hmdaMacro2013 = require('./2013/hmda-macro.json'),
hmdasyntactical2013 = require('./2013/hmda-syntactical.json'),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to uppercase the 's' in syntactical (here and everywhere)

@poorgeek
Copy link
Contributor Author

@doelleri I fixed the casing of the hmdaSyntactical* vars everywhere in 8b023e4. Good catch.

doelleri added a commit that referenced this pull request Jan 16, 2015
@doelleri doelleri merged commit 6b6c1d9 into cfpb:milestone3 Jan 16, 2015
@poorgeek poorgeek deleted the require-all-the-things branch January 16, 2015 16:01
@LinuxBozo
Copy link
Contributor

@poorgeek For maintainability, I would recommend this be updated with:

  1. edits and specs merged into a single map called specs. Layout like:
var specs = {
        '2013': {
            'filespec': filespec2013,
            'hmda': {
                'macro': hmdaMacro2013,
                'syntactical': hmdaSyntactical2013
            },
            'lar': {
                'quality': larQuality2013,
                'syntactical': larSyntactical2013,
                'validity': larValidity2013
            },
            'ts': {
                'quality': tsQuality2013,
                'syntactical': tsSyntactical2013,
                'validity': tsValidity2013
            }
        },
        '2014': {
                   ...
        }
};
  1. the vars for the file specs use filespecYYYY as the var name, not specYYYY
  2. Update getFileSpec and getEdits to use the new combined specs map and variables
  3. Remove VALID_YEARS
  4. Update getValidYears() to iterate the top level properties of the specs map

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.

3 participants