Skip to content

Commit 9ae7d47

Browse files
Merge pull request #6 from jaystack/update-buffer
Update deprecated Buffer methods
2 parents f76550f + 906cd54 commit 9ae7d47

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
lines changed

src/cli/providers/azureARM/context/functions.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,11 +143,11 @@ export const persistFunction = (context) => {
143143
const basePath = join(context.projectFolder, functionResource.name)
144144

145145
for (const file in functionResource.properties.files) {
146-
writeFile(join(basePath, file), new Buffer(functionResource.properties.files[file], 'utf8'), deploymentFolder)
146+
writeFile(join(basePath, file), Buffer.from(functionResource.properties.files[file], 'utf8'), deploymentFolder)
147147
}
148148

149149
const bindings = JSON.stringify(functionResource.properties.config, null, 4)
150-
writeFile(join(basePath, 'function.json'), new Buffer(bindings, 'utf8'), deploymentFolder)
150+
writeFile(join(basePath, 'function.json'), Buffer.from(bindings, 'utf8'), deploymentFolder)
151151

152152
const idx = site.resources.indexOf(functionResource)
153153
site.resources.splice(idx, 1)

src/cli/providers/azureARM/context/init.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,5 +180,5 @@ export const addEnvironmentSetting = (name, value, site) => {
180180
export const persistHostJson = async (context) => {
181181
const { deploymentFolder } = context
182182
const host = JSON.stringify(context.ARMHost, null, 4)
183-
writeFile(join(`${context.projectName || 'functionly'}-${context.stage}`, 'host.json'), new Buffer(host, 'utf8'), deploymentFolder)
183+
writeFile(join(`${context.projectName || 'functionly'}-${context.stage}`, 'host.json'), Buffer.from(host, 'utf8'), deploymentFolder)
184184
}

src/cli/providers/azureARM/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,5 +56,5 @@ export const azure = {
5656
export const persistFile = async (context) => {
5757
const fileName = projectConfig.name ? `${projectConfig.name}.template.json` : 'azurearm.template.json'
5858
const templateData = JSON.stringify(context.ARMTemplate, null, 2);
59-
writeFile(fileName, new Buffer(templateData, 'binary'))
59+
writeFile(fileName, Buffer.from(templateData, 'binary'))
6060
}

src/cli/providers/cloudFormation/context/uploadTemplate.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { projectConfig } from '../../../project/config'
66
export const persistCreateTemplate = ExecuteStep.register('PersistCreateTemplate', async (context) => {
77
const templateData = JSON.stringify(context.CloudFormationTemplate, null, 2);
88
const fileName = projectConfig.name ? `${projectConfig.name}.create.template.json` : 'cloudformation.create.template.json'
9-
writeFile(fileName, new Buffer(templateData, 'binary'))
9+
writeFile(fileName, Buffer.from(templateData, 'binary'))
1010
})
1111

1212
export const uploadTemplate = ExecuteStep.register('UploadTemplate', async (context) => {

src/cli/utilities/aws/s3Upload.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export const uploadToAws = ExecuteStep.register('S3-Upload', async (context) =>
4343
return new Promise<any>((resolve, reject) => {
4444
const version = context.version ? `${context.version}/` : ''
4545
const folderPah = context.version ? `${context.version}/${context.date.toISOString()}` : `${context.date.toISOString()}`
46-
const binary = new Buffer(context.upload.data, 'binary')
46+
const binary = Buffer.from(context.upload.data, 'binary')
4747
let params = {
4848
...config.S3,
4949
Bucket: context.awsBucket,

0 commit comments

Comments
 (0)