sunping0612 / test

test for git and eslint
0 stars 0 forks source link

123 #1

Open sunping0612 opened 1 year ago

sunping0612 commented 1 year ago

123.md

sunping0612 commented 7 months ago
function sortFn(obj) {
    return _.reduce(_.keys(obj).sort(), (result, key) => {
        result[key] = obj[key];
        return result;
    }, {})
}

function sortJsonDeep(obj, orderKeys) {
    const omitRoot = [];
    const fullOrderKeys = _.reduce(orderKeys, (list, key) => {
        const paths = key.split('.');

        if (paths.length === 1) {
            omitRoot.push(key);
        }

        if (_.findLast(paths) === '*') {
            const basePath = _.slice(paths, 0, paths.length - 1);
            const childKeys = _.map(
                _.keys(_.get(obj, basePath)),
                key => [...basePath, key].join('.'),
            );

            list.push(...childKeys);
        } else {
            list.push(key);
        }

        return list;
    }, []);

    const sortedObj = _.omit(obj, omitRoot);

    _.forEach(fullOrderKeys, (key) => {
        _.set(sortedObj, key, sortFn(_.get(obj, key)))
    });

    return sortedObj;
}
sunping0612 commented 5 months ago

action.pptx

https://github.com/sunping0612/test/assets/29818588/a0a9fbbf-1685-4235-b8be-7a00b50e80de

https://github.com/sunping0612/test/assets/29818588/a8666659-1a3c-4c96-b191-94cab15f6449

sunping0612 commented 4 months ago

news

athibaul-all-i-want-for-christmas.zip

https://github.com/sunping0612/test/assets/29818588/1cb3ceba-3d55-46fc-8651-83b631140038

https://github.com/sunping0612/test/assets/29818588/6a47f611-901f-43c6-9bc2-1c0afba6b231

https://dittytoy.net/

sunping0612 commented 4 months ago

归档.zip

sunping0612 commented 4 months ago

https://github.com/sunping0612/test/assets/29818588/2e67f618-4dd2-4385-afa4-83374d2740b0

sunping0612 commented 2 months ago

https://cip.crestv.com/CustomWebMobile/#/?pdfUrl=https%253A%2F%2Fwebapp.crestv.com%2Fapi%2FInvoice%2FInvoiceFile%253FCode%253DoTqOPFTOC3ypL0trFSKXfdYA5hXZgDSoVyICyBziyP4%2526FileCode%253Df6-L1iSTC_HrfYSPt-6dvaLOOsbtak5OUi5hO_lTe5M