Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
run: config => {
const value = '?membership=true'
const edits = setProperty(config, ['projectQuery', -1], value, defaultFormattingOptions)
return { edits, selectText: value }
},
},
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 }
}
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,
})
)
}
run: config => {
const value = ''
const edits = setProperty(config, ['token'], value, defaultFormattingOptions)
return { edits, selectText: value }
},
},
run: config => {
const value = 'path/to/repository'
const edits = setProperty(config, ['repos', -1], value, defaultFormattingOptions)
return { edits, selectText: value }
},
},
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 }
}
run: config => {
const value = ''
const edits = setProperty(config, ['certificate'], value, defaultFormattingOptions)
return { edits, selectText: value }
},
},
const addLicenseKey: ConfigInsertionFunction = config => {
const value =
'<input for="">'
const edits = setProperty(config, ['licenseKey'], value, defaultFormattingOptions)
return { edits, selectText: value }
}
const addBitbucketServer: ConfigInsertionFunction = config => {
const tokenPlaceholder =
''
const value: BitbucketServerConnection = {
url: 'https://bitbucket.example.com',
token: tokenPlaceholder,
}
const edits = setProperty(config, ['bitbucketServer', -1], value, defaultFormattingOptions)
return { edits, selectText: tokenPlaceholder }
}
run: config => {
const value = '?visibility=private'
const edits = setProperty(config, ['projectQuery', -1], value, defaultFormattingOptions)
return { edits, selectText: value }
},
},