Skip to content

Commit

Permalink
Add editorconfig file for consistent indentation
Browse files Browse the repository at this point in the history
  • Loading branch information
gilmoreorless committed Feb 4, 2024
1 parent 526030f commit 253bb00
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 8 deletions.
22 changes: 22 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
root = true

[*]
indent_style = tab
indent_size = 4
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.min.js]
insert_final_newline = false

# It's not ideal to have 2 different styles, but this is just codifying what
# already existed in the project.
[*.{md,ts}]
indent_style = space

# Standard style for GitHub workflow files
[*.yml]
indent_style = space
indent_size = 2
10 changes: 5 additions & 5 deletions moment-timezone-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
"use strict";

/*global define*/
if (typeof module === 'object' && module.exports) {
module.exports = factory(require('./')); // Node
} else if (typeof define === 'function' && define.amd) {
if (typeof module === 'object' && module.exports) {
module.exports = factory(require('./')); // Node
} else if (typeof define === 'function' && define.amd) {
define(['moment'], factory); // AMD
} else {
factory(root.moment); // Browser
Expand Down Expand Up @@ -201,8 +201,8 @@
if (a.population > b.population) {
group.unshift(a);
} else if (a.population === b.population && groupLeaders && groupLeaders[a.name]) {
group.unshift(a);
} else {
group.unshift(a);
} else {
group.push(a);
}
foundGroup = true;
Expand Down
6 changes: 3 additions & 3 deletions moment-timezone.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,10 +159,10 @@
} else if (num >= arr[len - 1]) {
return -1;
}

var mid;
var lo = 0;
var hi = len - 1;
var hi = len - 1;
while (hi - lo > 1) {
mid = Math.floor((lo + hi) / 2);
if (arr[mid] <= num) {
Expand All @@ -173,7 +173,7 @@
}
return hi;
}

Zone.prototype = {
_set : function (unpacked) {
this.name = unpacked.name;
Expand Down

0 comments on commit 253bb00

Please sign in to comment.