How to use the sharp.logError function in sharp

To help you get started, we’ve selected a few sharp examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github code16 / sharp / packages / form / src / components / Form.vue View on Github external
async init() {
                if(this.independant) {
                    this.mount(this.props);
                    this.ready = true;
                }
                else {
                    if(this.entityKey) {
                        await this.get();
                        this.ready = true;
                    }
                    else logError('no entity key provided');
                }
            },
            redirectToList() {
github code16 / sharp / packages / form / src / components / Form.vue View on Github external
async init() {
                if(this.independant) {
                    this.mount(this.props);
                    this.ready = true;
                }
                else {
                    if(this.entityKey) {
                        await this.get();
                        this.setupActionBar();
                        this.ready = true;
                    }
                    else logError('no entity key provided');
                }
            },
github code16 / sharp / packages / form / src / components / FieldDisplay.js View on Github external
render(h, { props, injections, data }) {
        let { fieldKey,
            contextFields,
            contextData,
            errorIdentifier,
            updateVisibility,
            ...sharedProps } = props;

        let { $form } = injections;

        let field = contextFields[fieldKey];
        let value = contextData[fieldKey];

        if(!(fieldKey in contextFields)) {
            logError(`Field display ('layout') : Can't find a field with key '${fieldKey}' in 'fields'`,contextFields);
            return h(UnknownField, { props: { name: fieldKey } });
        }

        let isVisible = acceptCondition(contextFields, contextData, field.conditionalDisplay);

        updateVisibility && updateVisibility(fieldKey, isVisible);

        return isVisible ? h(FieldContainer, {
            ...data,
            attrs: {
                fieldKey,
                fieldProps: field,
                fieldType: field.type,
                value: getValue($form, field, value, props.locale),
                originalValue: value,
                label: field.label,
github code16 / sharp / packages / form / src / components / ui / FieldContainer.vue View on Github external
updateError(errors) {
                let error = errors[this.mergedErrorIdentifier];
                if(error == null) {
                    this.clear();
                }
                else if(Array.isArray(error)) {
                    this.setError(error[0]);
                }
                else {
                    logError(`FieldContainer : Not processable error "${this.mergedErrorIdentifier}" : `, error);
                }
            },
            setError(error) {
github code16 / sharp / packages / form / src / components / Field.vue View on Github external
render(h) {
            if(!this.component) {
                let message = this.isCustom
                    ? `unknown custom field type '${this.fieldType}', make sure you register it correctly`
                    : `unknown type '${this.fieldType}'`;
                logError(`SharpField '${this.fieldKey}': ${message}`, this.fieldProps);
                return null;
            }

            let { key, ...fieldProps } = this.fieldProps;


            return h(this.component, {
                props : {
                    fieldKey: this.fieldKey,
                    fieldLayout: this.fieldLayout,
                    value: this.value,
                    locale: this.locale,
                    uniqueIdentifier: this.uniqueIdentifier,
                    fieldConfigIdentifier: this.fieldConfigIdentifier,
                    ...fieldProps
                },

sharp

High performance Node.js image processing, the fastest module to resize JPEG, PNG, WebP, GIF, AVIF and TIFF images

Apache-2.0
Latest version published 1 month ago

Package Health Score

94 / 100
Full package analysis