mirror of
https://github.com/serverless/serverless.git
synced 2026-02-01 16:07:28 +00:00
Remove whitespace-celaning that seems unnecessary.
This commit is contained in:
parent
dd4a49d7f5
commit
1a9cdf356b
@ -268,7 +268,7 @@ class Variables {
|
||||
return match.replace(
|
||||
this.variableSyntax,
|
||||
(context, contents) => contents.trim()
|
||||
).replace(/\s/g, '');
|
||||
);
|
||||
}
|
||||
/**
|
||||
* @typedef {Object} MatchResult
|
||||
|
||||
@ -634,6 +634,16 @@ describe('Variables', () => {
|
||||
return serverless.variables.populateObject(service.custom)
|
||||
.should.become(expected);
|
||||
});
|
||||
it('should preserve whitespace in literal fallback', () => {
|
||||
service.custom = {
|
||||
val0: '${self:custom.val, "rate(3 hours)"}',
|
||||
};
|
||||
const expected = {
|
||||
val0: 'rate(3 hours)',
|
||||
};
|
||||
return serverless.variables.populateObject(service.custom)
|
||||
.should.become(expected);
|
||||
});
|
||||
it('should handle deep variables regardless of custom variableSyntax', () => {
|
||||
service.provider.variableSyntax = '\\${{([ ~:a-zA-Z0-9._\\\'",\\-\\/\\(\\)]+?)}}';
|
||||
serverless.variables.loadVariableSyntax();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user