1
0
Fork 0

chore(core): Refactor v3 code

This commit is contained in:
Joost De Cock 2022-09-18 15:11:10 +02:00
parent f882a26408
commit 200cebf582
27 changed files with 3961 additions and 2633 deletions

View file

@ -1,13 +1,20 @@
import { Pattern } from './pattern.mjs'
import { loadDesignDefaults } from './config.mjs'
import { __loadDesignDefaults } from './config.mjs'
/*
* The Design constructor. Returns a Pattern constructor
* So it's sort of a super-constructor
//////////////////////////////////////////////
// CONSTRUCTOR //
//////////////////////////////////////////////
/**
* Return a Pattern constructor (it's a super-constructor)
*
* @constructor
* @param {object} config - The design configuration
* @return {function} pattern - The pattern constructor
*/
export function Design(config) {
// Initialize config with defaults
config = { ...loadDesignDefaults(), ...config }
config = { ...__loadDesignDefaults(), ...config }
// Create the pattern constructor
const pattern = function (...sets) {