How to use the @sqs/jsonc-parser/lib/edit.setProperty function in @sqs/jsonc-parser

To help you get started, we’ve selected a few @sqs/jsonc-parser 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 sourcegraph / sourcegraph / web / src / site-admin / externalServices.tsx View on Github external
run: config => {
                    const value = '?membership=true'
                    const edits = setProperty(config, ['projectQuery', -1], value, defaultFormattingOptions)
                    return { edits, selectText: value }
                },
            },
github sourcegraph / sourcegraph / packages / webapp / src / site-admin / configHelpers.ts View on Github external
const addGitLab: ConfigInsertionFunction = config => {
    const tokenPlaceholder =
        ''
    const value: GitLabConnection = {
        url: 'https://gitlab.example.com',
        token: tokenPlaceholder,
    }
    const edits = setProperty(config, ['gitlab', -1], value, defaultFormattingOptions)
    return { edits, selectText: tokenPlaceholder }
}
github sourcegraph / sourcegraph / shared / src / e2e / driver.ts View on Github external
export function modifyJSONC(text: string, path: jsonc.JSONPath, f: (oldValue: jsonc.Node | undefined) => any): any {
    const old = jsonc.findNodeAtLocation(jsonc.parseTree(text), path)
    return jsonc.applyEdits(
        text,
        jsoncEdit.setProperty(text, path, f(old), {
            eol: '\n',
            insertSpaces: true,
            tabSize: 2,
        })
    )
}
github sourcegraph / sourcegraph / web / src / site-admin / externalServices.tsx View on Github external
run: config => {
                    const value = ''
                    const edits = setProperty(config, ['token'], value, defaultFormattingOptions)
                    return { edits, selectText: value }
                },
            },
github sourcegraph / sourcegraph / web / src / site-admin / externalServices.tsx View on Github external
run: config => {
                    const value = 'path/to/repository'
                    const edits = setProperty(config, ['repos', -1], value, defaultFormattingOptions)
                    return { edits, selectText: value }
                },
            },
github sourcegraph / sourcegraph / packages / webapp / src / site-admin / configHelpers.ts View on Github external
const addAWSCodeCommit: ConfigInsertionFunction = config => {
    const value: AWSCodeCommitConnection = {
        region: '' as any,
        accessKeyID: '',
        secretAccessKey: '',
    }
    const edits = setProperty(config, ['awsCodeCommit', -1], value, defaultFormattingOptions)
    return { edits, selectText: '""', cursorOffset: 1 }
}
github sourcegraph / sourcegraph / web / src / site-admin / externalServices.tsx View on Github external
run: config => {
                    const value = ''
                    const edits = setProperty(config, ['certificate'], value, defaultFormattingOptions)
                    return { edits, selectText: value }
                },
            },
github sourcegraph / sourcegraph / packages / webapp / src / site-admin / configHelpers.ts View on Github external
const addLicenseKey: ConfigInsertionFunction = config => {
    const value =
        '<input for="">'
    const edits = setProperty(config, ['licenseKey'], value, defaultFormattingOptions)
    return { edits, selectText: value }
}
github sourcegraph / sourcegraph / src / site-admin / configHelpers.ts View on Github external
const addBitbucketServer: ConfigInsertionFunction = config =&gt; {
    const tokenPlaceholder =
        ''
    const value: BitbucketServerConnection = {
        url: 'https://bitbucket.example.com',
        token: tokenPlaceholder,
    }
    const edits = setProperty(config, ['bitbucketServer', -1], value, defaultFormattingOptions)
    return { edits, selectText: tokenPlaceholder }
}
github sourcegraph / sourcegraph / web / src / site-admin / externalServices.tsx View on Github external
run: config => {
                    const value = '?visibility=private'
                    const edits = setProperty(config, ['projectQuery', -1], value, defaultFormattingOptions)
                    return { edits, selectText: value }
                },
            },

@sqs/jsonc-parser

Scanner and parser for JSON with comments.

MIT
Latest version published 6 years ago

Package Health Score

56 / 100
Full package analysis

Similar packages