Do not use `??` operator at the moment.

Fix #110
This commit is contained in:
yuanchuan 2023-01-05 22:45:47 +08:00
parent 792397c033
commit 902a8788cd
5 changed files with 25 additions and 5 deletions

View File

@ -1,3 +1,11 @@
## 0.32.2
* Do not use `??` operator at the moment.
<br /> <br />
## 0.32.1
* Build grid without DOM object.

View File

@ -1,4 +1,4 @@
/*! css-doodle@0.32.1 */
/*! css-doodle@0.32.2 */
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
typeof define === 'function' && define.amd ? define(factory) :
@ -6256,9 +6256,15 @@ void main() {
`;
}
function get_content(input) {
return is_nil(input) ? '' : input;
}
function create_cell(x, y, z, content, child = '') {
let id = cell_id(x, y, z);
return `<cell id="${id}">${content['#' + id]??''}${child??''}</cell>`;
let head = get_content(content['#' + id]);
let tail = get_content(child);
return `<cell id="${id}">${head}${tail}</cell>`;
}
function create_grid(grid_obj, content) {

2
css-doodle.min.js vendored

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,6 @@
{
"name": "css-doodle",
"version": "0.32.1",
"version": "0.32.2",
"description": "A web component for drawing patterns with CSS",
"main": "css-doodle.js",
"scripts": {

View File

@ -632,9 +632,15 @@ function get_grid_styles(grid_obj) {
`;
}
function get_content(input) {
return is_nil(input) ? '' : input;
}
function create_cell(x, y, z, content, child = '') {
let id = cell_id(x, y, z);
return `<cell id="${id}">${content['#' + id]??''}${child??''}</cell>`;
let head = get_content(content['#' + id]);
let tail = get_content(child);
return `<cell id="${id}">${head}${tail}</cell>`;
}
function create_grid(grid_obj, content) {