.. | ||
src | ||
tests | ||
.babelrc | ||
.editorconfig | ||
.gitignore | ||
.npmignore | ||
.travis.yml | ||
LICENSE | ||
package-lock.json | ||
package.json | ||
README.md | ||
rollup.js |
freesewing
a library for made-to-measure sewing patterns
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.