1
0
Fork 0
freesewing/packages/plugin-validate
2019-04-19 08:23:04 +02:00
..
src bug: Removed reference to this 2019-04-19 08:23:04 +02:00
tests Merge branch 'master' of github.com:freesewing/plugin-validate 2019-04-19 08:23:04 +02:00
.babelrc Merge branch 'master' of github.com:freesewing/plugin-validate 2019-04-19 08:23:04 +02:00
.editorconfig tada: First commit 2019-04-19 08:23:04 +02:00
.gitignore tada: First commit 2019-04-19 08:23:04 +02:00
.npmignore tada: First commit 2019-04-19 08:23:04 +02:00
.travis.yml Merge branch 'master' of github.com:freesewing/plugin-validate 2019-04-19 08:23:04 +02:00
LICENSE tada: First commit 2019-04-19 08:23:04 +02:00
package-lock.json bookmark: v0.4.1 2019-04-19 08:23:04 +02:00
package.json bookmark: v0.4.1 2019-04-19 08:23:04 +02:00
README.md Merge branch 'master' of github.com:freesewing/plugin-validate 2019-04-19 08:23:04 +02:00
rollup.js tada: First commit 2019-04-19 08:23:04 +02:00

Freesewing logo

 freesewing
a library for made-to-measure sewing patterns

Travis build Version License Code coverage DeepScan grade Chat on Gitter Become a Patron

plugin-validate

A freesewing plugin that validates your pattern and input. It will check for:

  • Missing measurements that are required by the pattern
  • Missing X or Y coordinates in points
  • Points that aren't points or don't have proper attributes
  • Paths that don't do anything (no ops)
  • Paths that use points that aren't valid points
  • Text that will cause problems for translation

On any of these, this plugin will throw an error. As such, it's not meant to be used in production, but rather during pattern development, to spot issues in your code.

Usage

To load this plugin, add it to your instantiated pattern.

On node.js:

import pattern from '@freesewing/pattern-brian'
import validate from '@freesewing/plugin-validate'

pattern.with(validate);

In the browser, this plugin will register as freesewing.plugins.validate:

<script type="text/javascript" src="https://unpkg.com/freesewing"></script>
<script type="text/javascript" src="https://unpkg.com/@freesewing/plugin-validate"></script>
<script type="text/javascript" src="https://unpkg.com/@freesewing/pattern-brian"></script>

<script>
var pattern = freesewing.patterns.brian
  .with(freesewing.plugins.validate);
</script>

Install

To install, run:

npm install @freesewing/plugin-validate

License: MIT

See the license file for details.