Skip to content

Commit 179b6c6

Browse files
Merge pull request #39 from mfradcourt/master
#38 Alternate keys does not allow to use integer value (it is forcing to use a string)
2 parents 6b1544c + 76001e6 commit 179b6c6

File tree

6 files changed

+11
-5
lines changed

6 files changed

+11
-5
lines changed

dist/dynamics-web-api-callbacks.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ var ErrorHelper = {
295295
if (alternateKeys.length) {
296296
for (var i = 0; i < alternateKeys.length; i++){
297297
alternateKeys[i] = alternateKeys[i].trim().replace('"', "'");
298-
/^[\w\d\_]+\='[^\'\r\n]+'$/i.exec(alternateKeys[i])[0];
298+
/^[\w\d\_]+\=('[^\'\r\n]+'|\d+)$/i.exec(alternateKeys[i])[0];
299299
}
300300
}
301301

dist/dynamics-web-api-callbacks.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/dynamics-web-api.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ var ErrorHelper = {
295295
if (alternateKeys.length) {
296296
for (var i = 0; i < alternateKeys.length; i++){
297297
alternateKeys[i] = alternateKeys[i].trim().replace('"', "'");
298-
/^[\w\d\_]+\='[^\'\r\n]+'$/i.exec(alternateKeys[i])[0];
298+
/^[\w\d\_]+\=('[^\'\r\n]+'|\d+)$/i.exec(alternateKeys[i])[0];
299299
}
300300
}
301301

dist/dynamics-web-api.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/helpers/ErrorHelper.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ var ErrorHelper = {
143143
if (alternateKeys.length) {
144144
for (var i = 0; i < alternateKeys.length; i++){
145145
alternateKeys[i] = alternateKeys[i].trim().replace('"', "'");
146-
/^[\w\d\_]+\='[^\'\r\n]+'$/i.exec(alternateKeys[i])[0];
146+
/^[\w\d\_]+\=('[^\'\r\n]+'|\d+)$/i.exec(alternateKeys[i])[0];
147147
}
148148
}
149149

tests/common-tests.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1397,6 +1397,12 @@ describe("ErrorHelper.keyParameterCheck", function () {
13971397
expect(result).to.eq("altKey='value',anotherKey='value2'");
13981398
});
13991399

1400+
it("checks correct alternate keys string and integer", function () {
1401+
var alternateKey = "altKey=123456,anotherKey='value2'";
1402+
var result = ErrorHelper.keyParameterCheck(alternateKey);
1403+
expect(result).to.eq("altKey=123456,anotherKey='value2'");
1404+
});
1405+
14001406
it("throws an error when alternate key is incorrect", function () {
14011407
expect(function () {
14021408
var alternateKey = "altKey='value, anotherKey='value2'";

0 commit comments

Comments
 (0)