cnhis-design-vue 3.1.15-beta.4 → 3.1.15-beta.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/packages/bpmn-workflow/src/BpmnWorkflow.js +2 -2
- package/es/packages/bpmn-workflow/src/custom/customModeler/customBpmn/BpmnRenderer.js +8 -8
- package/es/packages/bpmn-workflow/src/custom/customModeler/customBpmn/CustomContextPadProvider.js +2 -2
- package/es/packages/bpmn-workflow/src/custom/customModeler/customBpmn/CustomPalette.js +1 -1
- package/es/packages/bpmn-workflow/src/custom/customModeler/customBpmn/CustomRenderer.js +4 -3
- package/es/packages/bpmn-workflow/src/custom/customModeler/customBpmn/CustomRules.js +2 -2
- package/es/packages/bpmn-workflow/src/custom/customModeler/index.js +1 -1
- package/es/packages/bpmn-workflow/src/custom/customOtherModule/CustomPopupMenu.js +2 -2
- package/es/packages/bpmn-workflow/src/custom/customOtherModule/zoomScroll.js +3 -3
- package/es/packages/field-set/index.d.ts +4365 -0
- package/es/packages/field-set/src/FieldSet.js +53 -54
- package/es/packages/field-set/src/FieldSet.vue.d.ts +4365 -0
- package/es/packages/field-set/style/index.css +0 -9
- package/es/packages/form-render/index.d.ts +24 -3
- package/es/packages/form-render/src/FormRender.js +10 -6
- package/es/packages/form-render/src/FormRender.vue.d.ts +24 -3
- package/es/packages/form-render/src/components/renderer/combination/hooks/useDeepValidate.d.ts +5 -0
- package/es/packages/form-render/src/components/renderer/combination/hooks/useDeepValidate.js +32 -0
- package/es/packages/form-render/src/components/renderer/{combination.d.ts → combination/index.d.ts} +7 -1
- package/es/packages/form-render/src/components/renderer/combination/index.js +157 -0
- package/es/packages/form-render/src/components/renderer/index.js +1 -1
- package/es/packages/form-render/src/components/renderer/radio.js +4 -1
- package/es/packages/form-render/src/components/renderer/select.d.ts +9 -0
- package/es/packages/form-render/src/components/renderer/select.js +6 -2
- package/es/packages/form-render/src/constants/index.d.ts +2 -1
- package/es/packages/form-render/src/hooks/useAnchor.d.ts +7 -6
- package/es/packages/form-render/src/hooks/useAnchor.js +1 -2
- package/es/packages/form-render/src/hooks/useAsyncQueue.d.ts +6 -1
- package/es/packages/form-render/src/hooks/useAsyncQueue.js +12 -3
- package/es/packages/form-render/src/hooks/useFieldListAdaptor.js +2 -4
- package/es/packages/form-render/src/hooks/useFormContext.d.ts +3 -3
- package/es/packages/form-render/src/hooks/useFormContext.js +15 -3
- package/es/packages/form-render/src/hooks/useFormRenderLifeCycle.d.ts +13 -0
- package/es/packages/form-render/src/hooks/useFormRenderLifeCycle.js +10 -0
- package/es/packages/form-render/src/types/fieldItem.d.ts +8 -0
- package/es/packages/form-render/src/types/index.d.ts +25 -1
- package/es/packages/form-render/src/utils/index.d.ts +3 -3
- package/es/packages/form-render/src/utils/index.js +1 -4
- package/es/packages/index.css +1 -10
- package/es/packages/info-header/index.d.ts +1 -3
- package/es/packages/info-header/src/HiddenContent.js +1 -1
- package/es/packages/info-header/src/HiddenContent.vue.d.ts +1 -3
- package/es/packages/info-header/src/InfoHeader.vue.d.ts +1 -3
- package/es/packages/info-header/style/index.css +1 -1
- package/es/packages/shortcut-setter/index.d.ts +25 -4
- package/es/packages/shortcut-setter/src/ShortcutSetter.vue.d.ts +25 -4
- package/es/packages/shortcut-setter/src/ShortcutSetterItem.js +2 -2
- package/es/packages/shortcut-setter/src/ShortcutSetterItem.vue.d.ts +1 -1
- package/global.d.ts +8 -8
- package/package.json +9 -1
- package/es/_virtual/_commonjsHelpers.js +0 -7
- package/es/_virtual/css.escape.js +0 -3
- package/es/_virtual/inherits.js +0 -3
- package/es/_virtual/inherits_browser.js +0 -3
- package/es/node_modules/@formily/path/esm/contexts.js +0 -22
- package/es/node_modules/@formily/path/esm/destructor.js +0 -124
- package/es/node_modules/@formily/path/esm/index.js +0 -579
- package/es/node_modules/@formily/path/esm/matcher.js +0 -199
- package/es/node_modules/@formily/path/esm/parser.js +0 -402
- package/es/node_modules/@formily/path/esm/shared.js +0 -73
- package/es/node_modules/@formily/path/esm/tokenizer.js +0 -287
- package/es/node_modules/@formily/path/esm/tokens.js +0 -240
- package/es/node_modules/@formily/path/esm/types.js +0 -17
- package/es/node_modules/css.escape/css.escape.js +0 -110
- package/es/node_modules/date-fns/esm/_lib/defaultOptions/index.js +0 -6
- package/es/node_modules/date-fns/esm/_lib/getTimezoneOffsetInMilliseconds/index.js +0 -18
- package/es/node_modules/date-fns/esm/_lib/getUTCISOWeek/index.js +0 -17
- package/es/node_modules/date-fns/esm/_lib/getUTCISOWeekYear/index.js +0 -27
- package/es/node_modules/date-fns/esm/_lib/getUTCWeek/index.js +0 -17
- package/es/node_modules/date-fns/esm/_lib/getUTCWeekYear/index.js +0 -38
- package/es/node_modules/date-fns/esm/_lib/requiredArgs/index.js +0 -7
- package/es/node_modules/date-fns/esm/_lib/setUTCDay/index.js +0 -27
- package/es/node_modules/date-fns/esm/_lib/setUTCISODay/index.js +0 -23
- package/es/node_modules/date-fns/esm/_lib/setUTCISOWeek/index.js +0 -15
- package/es/node_modules/date-fns/esm/_lib/setUTCWeek/index.js +0 -15
- package/es/node_modules/date-fns/esm/_lib/startOfUTCISOWeek/index.js +0 -15
- package/es/node_modules/date-fns/esm/_lib/startOfUTCISOWeekYear/index.js +0 -15
- package/es/node_modules/date-fns/esm/_lib/startOfUTCWeek/index.js +0 -25
- package/es/node_modules/date-fns/esm/_lib/startOfUTCWeekYear/index.js +0 -21
- package/es/node_modules/date-fns/esm/_lib/toInteger/index.js +0 -15
- package/es/node_modules/date-fns/esm/compareAsc/index.js +0 -52
- package/es/node_modules/date-fns/esm/constants/index.js +0 -40
- package/es/node_modules/date-fns/esm/differenceInCalendarDays/index.js +0 -49
- package/es/node_modules/date-fns/esm/differenceInCalendarMonths/index.js +0 -35
- package/es/node_modules/date-fns/esm/differenceInCalendarYears/index.js +0 -33
- package/es/node_modules/date-fns/esm/differenceInDays/index.js +0 -86
- package/es/node_modules/date-fns/esm/differenceInMonths/index.js +0 -59
- package/es/node_modules/date-fns/esm/differenceInYears/index.js +0 -43
- package/es/node_modules/date-fns/esm/endOfDay/index.js +0 -30
- package/es/node_modules/date-fns/esm/endOfMonth/index.js +0 -32
- package/es/node_modules/date-fns/esm/isLastDayOfMonth/index.js +0 -30
- package/es/node_modules/date-fns/esm/parse/_lib/Parser.js +0 -32
- package/es/node_modules/date-fns/esm/parse/_lib/Setter.js +0 -37
- package/es/node_modules/date-fns/esm/parse/_lib/constants.js +0 -48
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/AMPMMidnightParser.js +0 -55
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/AMPMParser.js +0 -55
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/DateParser.js +0 -55
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/DayOfYearParser.js +0 -52
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/DayParser.js +0 -80
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/DayPeriodParser.js +0 -56
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/EraParser.js +0 -53
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/ExtendedYearParser.js +0 -30
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/FractionOfSecondParser.js +0 -29
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/Hour0To11Parser.js +0 -48
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/Hour0to23Parser.js +0 -41
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/Hour1To24Parser.js +0 -42
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/Hour1to12Parser.js +0 -50
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/ISODayParser.js +0 -99
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/ISOTimezoneParser.js +0 -46
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/ISOTimezoneWithZParser.js +0 -46
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/ISOWeekParser.js +0 -43
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/ISOWeekYearParser.js +0 -33
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/LocalDayParser.js +0 -96
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/LocalWeekParser.js +0 -43
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/LocalWeekYearParser.js +0 -61
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/MinuteParser.js +0 -41
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/MonthParser.js +0 -80
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/QuarterParser.js +0 -73
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/SecondParser.js +0 -41
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/StandAloneLocalDayParser.js +0 -96
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/StandAloneMonthParser.js +0 -80
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/StandAloneQuarterParser.js +0 -73
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/TimestampMillisecondsParser.js +0 -26
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/TimestampSecondsParser.js +0 -26
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/YearParser.js +0 -66
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/index.js +0 -109
- package/es/node_modules/date-fns/esm/parse/_lib/utils.js +0 -133
- package/es/node_modules/date-fns/esm/startOfDay/index.js +0 -30
- package/es/node_modules/date-fns/esm/toDate/index.js +0 -55
- package/es/node_modules/diagram-js/lib/command/CommandInterceptor.js +0 -139
- package/es/node_modules/diagram-js/lib/draw/BaseRenderer.js +0 -88
- package/es/node_modules/diagram-js/lib/features/popup-menu/PopupMenu.js +0 -591
- package/es/node_modules/diagram-js/lib/features/rules/RuleProvider.js +0 -88
- package/es/node_modules/diagram-js/lib/navigation/movecanvas/MoveCanvas.js +0 -120
- package/es/node_modules/diagram-js/lib/navigation/movecanvas/index.js +0 -8
- package/es/node_modules/diagram-js/lib/navigation/zoomscroll/ZoomScroll.js +0 -227
- package/es/node_modules/diagram-js/lib/navigation/zoomscroll/ZoomUtil.js +0 -24
- package/es/node_modules/diagram-js/lib/util/ClickTrap.js +0 -23
- package/es/node_modules/diagram-js/lib/util/Cursor.js +0 -20
- package/es/node_modules/diagram-js/lib/util/Event.js +0 -22
- package/es/node_modules/diagram-js/lib/util/Math.js +0 -9
- package/es/node_modules/diagram-js/lib/util/Mouse.js +0 -30
- package/es/node_modules/diagram-js/lib/util/Platform.js +0 -5
- package/es/node_modules/diagram-js/lib/util/PositionUtil.js +0 -8
- package/es/node_modules/diagram-js/lib/util/RenderUtil.js +0 -25
- package/es/node_modules/diagram-js/lib/util/SvgTransformUtil.js +0 -48
- package/es/node_modules/ids/dist/index.esm.js +0 -164
- package/es/node_modules/inherits/inherits.js +0 -19
- package/es/node_modules/inherits/inherits_browser.js +0 -38
- package/es/node_modules/inherits-browser/dist/index.es.js +0 -3
- package/es/node_modules/min-dash/dist/index.esm.js +0 -169
- package/es/node_modules/min-dom/dist/index.esm.js +0 -588
- package/es/node_modules/tiny-svg/dist/index.esm.js +0 -525
- package/es/packages/form-render/src/components/renderer/combination.js +0 -171
|
@@ -1,287 +0,0 @@
|
|
|
1
|
-
import { eofTok, nameTok, ignoreTok, bracketDRTok, braceLTok, braceRTok, dbStarTok, starTok, bangTok, dotTok, bracketDLTok, bracketLTok, expandTok, bracketRTok, parenLTok, parenRTok, commaTok, colonTok } from './tokens.js';
|
|
2
|
-
import { bracketDContext } from './contexts.js';
|
|
3
|
-
|
|
4
|
-
var nonASCIIwhitespace = /[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/;
|
|
5
|
-
var fullCharCodeAtPos = function (input, pos) {
|
|
6
|
-
if (String.fromCharCode)
|
|
7
|
-
return input.codePointAt(pos);
|
|
8
|
-
var code = input.charCodeAt(pos);
|
|
9
|
-
if (code <= 0xd7ff || code >= 0xe000)
|
|
10
|
-
return code;
|
|
11
|
-
var next = input.charCodeAt(pos + 1);
|
|
12
|
-
return (code << 10) + next - 0x35fdc00;
|
|
13
|
-
};
|
|
14
|
-
var isRewordCode = function (code) {
|
|
15
|
-
return code === 42 ||
|
|
16
|
-
code === 46 ||
|
|
17
|
-
code === 33 ||
|
|
18
|
-
code === 91 ||
|
|
19
|
-
code === 93 ||
|
|
20
|
-
code === 40 ||
|
|
21
|
-
code === 41 ||
|
|
22
|
-
code === 44 ||
|
|
23
|
-
code === 58 ||
|
|
24
|
-
code === 126 ||
|
|
25
|
-
code === 123 ||
|
|
26
|
-
code === 125;
|
|
27
|
-
};
|
|
28
|
-
var getError = function (message, props) {
|
|
29
|
-
var err = new Error(message);
|
|
30
|
-
Object.assign(err, props);
|
|
31
|
-
return err;
|
|
32
|
-
};
|
|
33
|
-
var slice = function (string, start, end) {
|
|
34
|
-
var str = '';
|
|
35
|
-
for (var i = start; i < end; i++) {
|
|
36
|
-
var ch = string.charAt(i);
|
|
37
|
-
if (ch !== '\\') {
|
|
38
|
-
str += ch;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
return str;
|
|
42
|
-
};
|
|
43
|
-
var Tokenizer = /** @class */ (function () {
|
|
44
|
-
function Tokenizer(input) {
|
|
45
|
-
this.input = input;
|
|
46
|
-
this.state = {
|
|
47
|
-
context: [],
|
|
48
|
-
type: null,
|
|
49
|
-
pos: 0,
|
|
50
|
-
};
|
|
51
|
-
this.type_ = null;
|
|
52
|
-
}
|
|
53
|
-
Tokenizer.prototype.curContext = function () {
|
|
54
|
-
return this.state.context[this.state.context.length - 1];
|
|
55
|
-
};
|
|
56
|
-
Tokenizer.prototype.includesContext = function (context) {
|
|
57
|
-
for (var len = this.state.context.length - 1; len >= 0; len--) {
|
|
58
|
-
if (this.state.context[len] === context) {
|
|
59
|
-
return true;
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
return false;
|
|
63
|
-
};
|
|
64
|
-
Tokenizer.prototype.unexpect = function (type) {
|
|
65
|
-
type = type || this.state.type;
|
|
66
|
-
return getError("Unexpect token \"".concat(type.flag, "\" in ").concat(this.state.pos, " char."), {
|
|
67
|
-
pos: this.state.pos,
|
|
68
|
-
});
|
|
69
|
-
};
|
|
70
|
-
Tokenizer.prototype.expectNext = function (type, next) {
|
|
71
|
-
if (type && type.expectNext) {
|
|
72
|
-
if (next && !type.expectNext.call(this, next)) {
|
|
73
|
-
throw getError("Unexpect token \"".concat(next.flag, "\" token should not be behind \"").concat(type.flag, "\" token.(").concat(this.state.pos, "th char)"), {
|
|
74
|
-
pos: this.state.pos,
|
|
75
|
-
});
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
};
|
|
79
|
-
Tokenizer.prototype.expectPrev = function (type, prev) {
|
|
80
|
-
if (type && type.expectPrev) {
|
|
81
|
-
if (prev && !type.expectPrev.call(this, prev)) {
|
|
82
|
-
throw getError("Unexpect token \"".concat(type.flag, "\" should not be behind \"").concat(prev.flag, "\"(").concat(this.state.pos, "th char)."), {
|
|
83
|
-
pos: this.state.pos,
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
};
|
|
88
|
-
Tokenizer.prototype.match = function (type) {
|
|
89
|
-
return this.state.type === type;
|
|
90
|
-
};
|
|
91
|
-
Tokenizer.prototype.skipSpace = function () {
|
|
92
|
-
if (this.curContext() === bracketDContext)
|
|
93
|
-
return;
|
|
94
|
-
loop: while (this.state.pos < this.input.length) {
|
|
95
|
-
var ch = this.input.charCodeAt(this.state.pos);
|
|
96
|
-
switch (ch) {
|
|
97
|
-
case 32:
|
|
98
|
-
case 160:
|
|
99
|
-
++this.state.pos;
|
|
100
|
-
break;
|
|
101
|
-
case 13:
|
|
102
|
-
if (this.input.charCodeAt(this.state.pos + 1) === 10) {
|
|
103
|
-
++this.state.pos;
|
|
104
|
-
}
|
|
105
|
-
case 10:
|
|
106
|
-
case 8232:
|
|
107
|
-
case 8233:
|
|
108
|
-
++this.state.pos;
|
|
109
|
-
break;
|
|
110
|
-
default:
|
|
111
|
-
if ((ch > 8 && ch < 14) ||
|
|
112
|
-
(ch >= 5760 && nonASCIIwhitespace.test(String.fromCharCode(ch)))) {
|
|
113
|
-
++this.state.pos;
|
|
114
|
-
}
|
|
115
|
-
else {
|
|
116
|
-
break loop;
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
};
|
|
121
|
-
Tokenizer.prototype.next = function () {
|
|
122
|
-
this.type_ = this.state.type;
|
|
123
|
-
if (this.input.length <= this.state.pos) {
|
|
124
|
-
return this.finishToken(eofTok);
|
|
125
|
-
}
|
|
126
|
-
this.skipSpace();
|
|
127
|
-
this.readToken(this.getCode(), this.state.pos > 0 ? this.getCode(this.state.pos - 1) : -Infinity);
|
|
128
|
-
};
|
|
129
|
-
Tokenizer.prototype.getCode = function (pos) {
|
|
130
|
-
if (pos === void 0) { pos = this.state.pos; }
|
|
131
|
-
return fullCharCodeAtPos(this.input, pos);
|
|
132
|
-
};
|
|
133
|
-
Tokenizer.prototype.eat = function (type) {
|
|
134
|
-
if (this.match(type)) {
|
|
135
|
-
this.next();
|
|
136
|
-
return true;
|
|
137
|
-
}
|
|
138
|
-
else {
|
|
139
|
-
return false;
|
|
140
|
-
}
|
|
141
|
-
};
|
|
142
|
-
Tokenizer.prototype.readKeyWord = function () {
|
|
143
|
-
var startPos = this.state.pos, string = '';
|
|
144
|
-
while (true) {
|
|
145
|
-
var code = this.getCode();
|
|
146
|
-
var prevCode = this.getCode(this.state.pos - 1);
|
|
147
|
-
if (this.input.length === this.state.pos) {
|
|
148
|
-
string = slice(this.input, startPos, this.state.pos + 1);
|
|
149
|
-
break;
|
|
150
|
-
}
|
|
151
|
-
if (!isRewordCode(code) || prevCode === 92) {
|
|
152
|
-
if (code === 32 ||
|
|
153
|
-
code === 160 ||
|
|
154
|
-
code === 10 ||
|
|
155
|
-
code === 8232 ||
|
|
156
|
-
code === 8233) {
|
|
157
|
-
string = slice(this.input, startPos, this.state.pos);
|
|
158
|
-
break;
|
|
159
|
-
}
|
|
160
|
-
if (code === 13 && this.input.charCodeAt(this.state.pos + 1) === 10) {
|
|
161
|
-
string = slice(this.input, startPos, this.state.pos);
|
|
162
|
-
break;
|
|
163
|
-
}
|
|
164
|
-
if ((code > 8 && code < 14) ||
|
|
165
|
-
(code >= 5760 && nonASCIIwhitespace.test(String.fromCharCode(code)))) {
|
|
166
|
-
string = slice(this.input, startPos, this.state.pos);
|
|
167
|
-
break;
|
|
168
|
-
}
|
|
169
|
-
this.state.pos++;
|
|
170
|
-
}
|
|
171
|
-
else {
|
|
172
|
-
string = slice(this.input, startPos, this.state.pos);
|
|
173
|
-
break;
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
this.finishToken(nameTok, string);
|
|
177
|
-
};
|
|
178
|
-
Tokenizer.prototype.readIngoreString = function () {
|
|
179
|
-
var startPos = this.state.pos, prevCode, string = '';
|
|
180
|
-
while (true) {
|
|
181
|
-
var code = this.getCode();
|
|
182
|
-
if (this.state.pos >= this.input.length)
|
|
183
|
-
break;
|
|
184
|
-
if ((code === 91 || code === 93) && prevCode === 92) {
|
|
185
|
-
this.state.pos++;
|
|
186
|
-
prevCode = '';
|
|
187
|
-
}
|
|
188
|
-
else if (code == 93 && prevCode === 93) {
|
|
189
|
-
string = this.input
|
|
190
|
-
.slice(startPos, this.state.pos - 1)
|
|
191
|
-
.replace(/\\([\[\]])/g, '$1');
|
|
192
|
-
this.state.pos++;
|
|
193
|
-
break;
|
|
194
|
-
}
|
|
195
|
-
else {
|
|
196
|
-
this.state.pos++;
|
|
197
|
-
prevCode = code;
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
this.finishToken(ignoreTok, string);
|
|
201
|
-
this.finishToken(bracketDRTok);
|
|
202
|
-
};
|
|
203
|
-
Tokenizer.prototype.finishToken = function (type, value) {
|
|
204
|
-
var preType = this.state.type;
|
|
205
|
-
this.state.type = type;
|
|
206
|
-
if (value !== undefined)
|
|
207
|
-
this.state.value = value;
|
|
208
|
-
this.expectNext(preType, type);
|
|
209
|
-
this.expectPrev(type, preType);
|
|
210
|
-
if (type.updateContext) {
|
|
211
|
-
type.updateContext.call(this, preType);
|
|
212
|
-
}
|
|
213
|
-
};
|
|
214
|
-
Tokenizer.prototype.readToken = function (code, prevCode) {
|
|
215
|
-
if (prevCode === 92) {
|
|
216
|
-
return this.readKeyWord();
|
|
217
|
-
}
|
|
218
|
-
if (this.input.length <= this.state.pos) {
|
|
219
|
-
this.finishToken(eofTok);
|
|
220
|
-
}
|
|
221
|
-
else if (this.curContext() === bracketDContext) {
|
|
222
|
-
this.readIngoreString();
|
|
223
|
-
}
|
|
224
|
-
else if (code === 123) {
|
|
225
|
-
this.state.pos++;
|
|
226
|
-
this.finishToken(braceLTok);
|
|
227
|
-
}
|
|
228
|
-
else if (code === 125) {
|
|
229
|
-
this.state.pos++;
|
|
230
|
-
this.finishToken(braceRTok);
|
|
231
|
-
}
|
|
232
|
-
else if (code === 42) {
|
|
233
|
-
this.state.pos++;
|
|
234
|
-
if (this.getCode() === 42) {
|
|
235
|
-
this.state.pos++;
|
|
236
|
-
return this.finishToken(dbStarTok);
|
|
237
|
-
}
|
|
238
|
-
this.finishToken(starTok);
|
|
239
|
-
}
|
|
240
|
-
else if (code === 33) {
|
|
241
|
-
this.state.pos++;
|
|
242
|
-
this.finishToken(bangTok);
|
|
243
|
-
}
|
|
244
|
-
else if (code === 46) {
|
|
245
|
-
this.state.pos++;
|
|
246
|
-
this.finishToken(dotTok);
|
|
247
|
-
}
|
|
248
|
-
else if (code === 91) {
|
|
249
|
-
this.state.pos++;
|
|
250
|
-
if (this.getCode() === 91) {
|
|
251
|
-
this.state.pos++;
|
|
252
|
-
return this.finishToken(bracketDLTok);
|
|
253
|
-
}
|
|
254
|
-
this.finishToken(bracketLTok);
|
|
255
|
-
}
|
|
256
|
-
else if (code === 126) {
|
|
257
|
-
this.state.pos++;
|
|
258
|
-
this.finishToken(expandTok);
|
|
259
|
-
}
|
|
260
|
-
else if (code === 93) {
|
|
261
|
-
this.state.pos++;
|
|
262
|
-
this.finishToken(bracketRTok);
|
|
263
|
-
}
|
|
264
|
-
else if (code === 40) {
|
|
265
|
-
this.state.pos++;
|
|
266
|
-
this.finishToken(parenLTok);
|
|
267
|
-
}
|
|
268
|
-
else if (code === 41) {
|
|
269
|
-
this.state.pos++;
|
|
270
|
-
this.finishToken(parenRTok);
|
|
271
|
-
}
|
|
272
|
-
else if (code === 44) {
|
|
273
|
-
this.state.pos++;
|
|
274
|
-
this.finishToken(commaTok);
|
|
275
|
-
}
|
|
276
|
-
else if (code === 58) {
|
|
277
|
-
this.state.pos++;
|
|
278
|
-
this.finishToken(colonTok);
|
|
279
|
-
}
|
|
280
|
-
else {
|
|
281
|
-
this.readKeyWord();
|
|
282
|
-
}
|
|
283
|
-
};
|
|
284
|
-
return Tokenizer;
|
|
285
|
-
}());
|
|
286
|
-
|
|
287
|
-
export { Tokenizer };
|
|
@@ -1,240 +0,0 @@
|
|
|
1
|
-
import { destructorContext, braceContext, bracketContext, bracketArrayContext, bracketDContext, parenContext } from './contexts.js';
|
|
2
|
-
|
|
3
|
-
var __assign = (undefined && undefined.__assign) || function () {
|
|
4
|
-
__assign = Object.assign || function(t) {
|
|
5
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
6
|
-
s = arguments[i];
|
|
7
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
8
|
-
t[p] = s[p];
|
|
9
|
-
}
|
|
10
|
-
return t;
|
|
11
|
-
};
|
|
12
|
-
return __assign.apply(this, arguments);
|
|
13
|
-
};
|
|
14
|
-
var TokenType = function (flag, props) {
|
|
15
|
-
return __assign({ flag: flag }, props);
|
|
16
|
-
};
|
|
17
|
-
var nameTok = TokenType('name', {
|
|
18
|
-
expectNext: function (next) {
|
|
19
|
-
if (this.includesContext(destructorContext)) {
|
|
20
|
-
return (next === nameTok ||
|
|
21
|
-
next === commaTok ||
|
|
22
|
-
next === bracketRTok ||
|
|
23
|
-
next === braceRTok ||
|
|
24
|
-
next === colonTok);
|
|
25
|
-
}
|
|
26
|
-
return (next === dotTok ||
|
|
27
|
-
next === commaTok ||
|
|
28
|
-
next === eofTok ||
|
|
29
|
-
next === bracketRTok ||
|
|
30
|
-
next === parenRTok ||
|
|
31
|
-
next === colonTok ||
|
|
32
|
-
next === expandTok ||
|
|
33
|
-
next === bracketLTok);
|
|
34
|
-
},
|
|
35
|
-
});
|
|
36
|
-
var starTok = TokenType('*', {
|
|
37
|
-
expectNext: function (next) {
|
|
38
|
-
return (next === dotTok ||
|
|
39
|
-
next === parenLTok ||
|
|
40
|
-
next === bracketLTok ||
|
|
41
|
-
next === eofTok ||
|
|
42
|
-
next === commaTok ||
|
|
43
|
-
next === parenRTok);
|
|
44
|
-
},
|
|
45
|
-
});
|
|
46
|
-
var dbStarTok = TokenType('**', {
|
|
47
|
-
expectNext: function (next) {
|
|
48
|
-
return (next === dotTok ||
|
|
49
|
-
next === parenLTok ||
|
|
50
|
-
next === bracketLTok ||
|
|
51
|
-
next === eofTok ||
|
|
52
|
-
next === commaTok ||
|
|
53
|
-
next === parenRTok);
|
|
54
|
-
},
|
|
55
|
-
});
|
|
56
|
-
var dotTok = TokenType('.', {
|
|
57
|
-
expectNext: function (next) {
|
|
58
|
-
return (next === dotTok ||
|
|
59
|
-
next === nameTok ||
|
|
60
|
-
next === bracketDLTok ||
|
|
61
|
-
next === starTok ||
|
|
62
|
-
next === dbStarTok ||
|
|
63
|
-
next === bracketLTok ||
|
|
64
|
-
next === braceLTok ||
|
|
65
|
-
next === eofTok);
|
|
66
|
-
},
|
|
67
|
-
expectPrev: function (prev) {
|
|
68
|
-
return (prev === dotTok ||
|
|
69
|
-
prev === nameTok ||
|
|
70
|
-
prev === bracketDRTok ||
|
|
71
|
-
prev === starTok ||
|
|
72
|
-
prev === parenRTok ||
|
|
73
|
-
prev === bracketRTok ||
|
|
74
|
-
prev === expandTok ||
|
|
75
|
-
prev === braceRTok);
|
|
76
|
-
},
|
|
77
|
-
});
|
|
78
|
-
var bangTok = TokenType('!', {
|
|
79
|
-
expectNext: function (next) {
|
|
80
|
-
return next === nameTok || next === bracketDLTok;
|
|
81
|
-
},
|
|
82
|
-
});
|
|
83
|
-
var colonTok = TokenType(':', {
|
|
84
|
-
expectNext: function (next) {
|
|
85
|
-
if (this.includesContext(destructorContext)) {
|
|
86
|
-
return next === nameTok || next === braceLTok || next === bracketLTok;
|
|
87
|
-
}
|
|
88
|
-
return next === nameTok || next === bracketDLTok || next === bracketRTok;
|
|
89
|
-
},
|
|
90
|
-
});
|
|
91
|
-
var braceLTok = TokenType('{', {
|
|
92
|
-
expectNext: function (next) {
|
|
93
|
-
return next === nameTok;
|
|
94
|
-
},
|
|
95
|
-
expectPrev: function (prev) {
|
|
96
|
-
if (this.includesContext(destructorContext)) {
|
|
97
|
-
return prev === colonTok || prev === commaTok || prev === bracketLTok;
|
|
98
|
-
}
|
|
99
|
-
return prev === dotTok || prev === colonTok || prev === parenLTok;
|
|
100
|
-
},
|
|
101
|
-
updateContext: function () {
|
|
102
|
-
this.state.context.push(braceContext);
|
|
103
|
-
},
|
|
104
|
-
});
|
|
105
|
-
var braceRTok = TokenType('}', {
|
|
106
|
-
expectNext: function (next) {
|
|
107
|
-
if (this.includesContext(destructorContext)) {
|
|
108
|
-
return (next === commaTok ||
|
|
109
|
-
next === braceRTok ||
|
|
110
|
-
next === eofTok ||
|
|
111
|
-
next === bracketRTok);
|
|
112
|
-
}
|
|
113
|
-
return next === dotTok || next === eofTok || next === commaTok;
|
|
114
|
-
},
|
|
115
|
-
expectPrev: function (prev) {
|
|
116
|
-
return prev === nameTok || prev === braceRTok || prev === bracketRTok;
|
|
117
|
-
},
|
|
118
|
-
updateContext: function () {
|
|
119
|
-
this.state.context.pop(braceContext);
|
|
120
|
-
},
|
|
121
|
-
});
|
|
122
|
-
var bracketLTok = TokenType('[', {
|
|
123
|
-
expectNext: function (next) {
|
|
124
|
-
if (this.includesContext(destructorContext)) {
|
|
125
|
-
return (next === nameTok ||
|
|
126
|
-
next === bracketLTok ||
|
|
127
|
-
next === braceLTok ||
|
|
128
|
-
next === bracketRTok);
|
|
129
|
-
}
|
|
130
|
-
return (next === nameTok ||
|
|
131
|
-
next === bracketDLTok ||
|
|
132
|
-
next === colonTok ||
|
|
133
|
-
next === bracketLTok ||
|
|
134
|
-
next === ignoreTok ||
|
|
135
|
-
next === bracketRTok);
|
|
136
|
-
},
|
|
137
|
-
expectPrev: function (prev) {
|
|
138
|
-
if (this.includesContext(destructorContext)) {
|
|
139
|
-
return prev === colonTok || prev === commaTok || prev === bracketLTok;
|
|
140
|
-
}
|
|
141
|
-
return (prev === starTok ||
|
|
142
|
-
prev === bracketLTok ||
|
|
143
|
-
prev === dotTok ||
|
|
144
|
-
prev === nameTok ||
|
|
145
|
-
prev === parenLTok ||
|
|
146
|
-
prev == commaTok);
|
|
147
|
-
},
|
|
148
|
-
updateContext: function () {
|
|
149
|
-
this.state.context.push(bracketContext);
|
|
150
|
-
},
|
|
151
|
-
});
|
|
152
|
-
var bracketRTok = TokenType(']', {
|
|
153
|
-
expectNext: function (next) {
|
|
154
|
-
if (this.includesContext(destructorContext)) {
|
|
155
|
-
return (next === commaTok ||
|
|
156
|
-
next === braceRTok ||
|
|
157
|
-
next === bracketRTok ||
|
|
158
|
-
next === eofTok);
|
|
159
|
-
}
|
|
160
|
-
return (next === dotTok ||
|
|
161
|
-
next === eofTok ||
|
|
162
|
-
next === commaTok ||
|
|
163
|
-
next === parenRTok ||
|
|
164
|
-
next === bracketRTok);
|
|
165
|
-
},
|
|
166
|
-
updateContext: function () {
|
|
167
|
-
if (this.includesContext(bracketArrayContext))
|
|
168
|
-
return;
|
|
169
|
-
if (!this.includesContext(bracketContext))
|
|
170
|
-
throw this.unexpect();
|
|
171
|
-
this.state.context.pop();
|
|
172
|
-
},
|
|
173
|
-
});
|
|
174
|
-
var bracketDLTok = TokenType('[[', {
|
|
175
|
-
updateContext: function () {
|
|
176
|
-
this.state.context.push(bracketDContext);
|
|
177
|
-
},
|
|
178
|
-
});
|
|
179
|
-
var bracketDRTok = TokenType(']]', {
|
|
180
|
-
updateContext: function () {
|
|
181
|
-
if (this.curContext() !== bracketDContext)
|
|
182
|
-
throw this.unexpect();
|
|
183
|
-
this.state.context.pop();
|
|
184
|
-
},
|
|
185
|
-
});
|
|
186
|
-
var parenLTok = TokenType('(', {
|
|
187
|
-
expectNext: function (next) {
|
|
188
|
-
return (next === nameTok ||
|
|
189
|
-
next === bracketDLTok ||
|
|
190
|
-
next === braceLTok ||
|
|
191
|
-
next === bangTok ||
|
|
192
|
-
next === bracketLTok);
|
|
193
|
-
},
|
|
194
|
-
expectPrev: function (prev) {
|
|
195
|
-
return prev === starTok;
|
|
196
|
-
},
|
|
197
|
-
updateContext: function () {
|
|
198
|
-
this.state.context.push(parenContext);
|
|
199
|
-
},
|
|
200
|
-
});
|
|
201
|
-
var parenRTok = TokenType(')', {
|
|
202
|
-
expectNext: function (next) {
|
|
203
|
-
return (next === dotTok ||
|
|
204
|
-
next === eofTok ||
|
|
205
|
-
next === commaTok ||
|
|
206
|
-
next === parenRTok);
|
|
207
|
-
},
|
|
208
|
-
updateContext: function () {
|
|
209
|
-
if (this.curContext() !== parenContext)
|
|
210
|
-
throw this.unexpect();
|
|
211
|
-
this.state.context.pop();
|
|
212
|
-
},
|
|
213
|
-
});
|
|
214
|
-
var commaTok = TokenType(',', {
|
|
215
|
-
expectNext: function (next) {
|
|
216
|
-
return (next === nameTok ||
|
|
217
|
-
next === bracketDLTok ||
|
|
218
|
-
next === bracketLTok ||
|
|
219
|
-
next === braceLTok);
|
|
220
|
-
},
|
|
221
|
-
});
|
|
222
|
-
var ignoreTok = TokenType('ignore', {
|
|
223
|
-
expectNext: function (next) {
|
|
224
|
-
return next === bracketDRTok;
|
|
225
|
-
},
|
|
226
|
-
expectPrev: function (prev) {
|
|
227
|
-
return prev == bracketDLTok;
|
|
228
|
-
},
|
|
229
|
-
});
|
|
230
|
-
var expandTok = TokenType('expandTok', {
|
|
231
|
-
expectNext: function (next) {
|
|
232
|
-
return (next === dotTok ||
|
|
233
|
-
next === eofTok ||
|
|
234
|
-
next === commaTok ||
|
|
235
|
-
next === parenRTok);
|
|
236
|
-
},
|
|
237
|
-
});
|
|
238
|
-
var eofTok = TokenType('eof');
|
|
239
|
-
|
|
240
|
-
export { bangTok, braceLTok, braceRTok, bracketDLTok, bracketDRTok, bracketLTok, bracketRTok, colonTok, commaTok, dbStarTok, dotTok, eofTok, expandTok, ignoreTok, nameTok, parenLTok, parenRTok, starTok };
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
var isType = function (type) {
|
|
2
|
-
return function (obj) {
|
|
3
|
-
return obj && obj.type === type;
|
|
4
|
-
};
|
|
5
|
-
};
|
|
6
|
-
var isIdentifier = isType('Identifier');
|
|
7
|
-
var isIgnoreExpression = isType('IgnoreExpression');
|
|
8
|
-
var isDotOperator = isType('DotOperator');
|
|
9
|
-
var isWildcardOperator = isType('WildcardOperator');
|
|
10
|
-
var isExpandOperator = isType('ExpandOperator');
|
|
11
|
-
var isGroupExpression = isType('GroupExpression');
|
|
12
|
-
var isRangeExpression = isType('RangeExpression');
|
|
13
|
-
var isDestructorExpression = isType('DestructorExpression');
|
|
14
|
-
var isObjectPattern = isType('ObjectPattern');
|
|
15
|
-
var isArrayPattern = isType('ArrayPattern');
|
|
16
|
-
|
|
17
|
-
export { isArrayPattern, isDestructorExpression, isDotOperator, isExpandOperator, isGroupExpression, isIdentifier, isIgnoreExpression, isObjectPattern, isRangeExpression, isType, isWildcardOperator };
|
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
import { commonjsGlobal } from '../../_virtual/_commonjsHelpers.js';
|
|
2
|
-
import { c as css_escape } from '../../_virtual/css.escape.js';
|
|
3
|
-
|
|
4
|
-
/*! https://mths.be/cssescape v1.5.1 by @mathias | MIT license */
|
|
5
|
-
|
|
6
|
-
(function (module, exports) {
|
|
7
|
-
(function(root, factory) {
|
|
8
|
-
// https://github.com/umdjs/umd/blob/master/returnExports.js
|
|
9
|
-
{
|
|
10
|
-
// For Node.js.
|
|
11
|
-
module.exports = factory(root);
|
|
12
|
-
}
|
|
13
|
-
}(typeof commonjsGlobal != 'undefined' ? commonjsGlobal : commonjsGlobal, function(root) {
|
|
14
|
-
|
|
15
|
-
if (root.CSS && root.CSS.escape) {
|
|
16
|
-
return root.CSS.escape;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
// https://drafts.csswg.org/cssom/#serialize-an-identifier
|
|
20
|
-
var cssEscape = function(value) {
|
|
21
|
-
if (arguments.length == 0) {
|
|
22
|
-
throw new TypeError('`CSS.escape` requires an argument.');
|
|
23
|
-
}
|
|
24
|
-
var string = String(value);
|
|
25
|
-
var length = string.length;
|
|
26
|
-
var index = -1;
|
|
27
|
-
var codeUnit;
|
|
28
|
-
var result = '';
|
|
29
|
-
var firstCodeUnit = string.charCodeAt(0);
|
|
30
|
-
while (++index < length) {
|
|
31
|
-
codeUnit = string.charCodeAt(index);
|
|
32
|
-
// Note: there’s no need to special-case astral symbols, surrogate
|
|
33
|
-
// pairs, or lone surrogates.
|
|
34
|
-
|
|
35
|
-
// If the character is NULL (U+0000), then the REPLACEMENT CHARACTER
|
|
36
|
-
// (U+FFFD).
|
|
37
|
-
if (codeUnit == 0x0000) {
|
|
38
|
-
result += '\uFFFD';
|
|
39
|
-
continue;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
if (
|
|
43
|
-
// If the character is in the range [\1-\1F] (U+0001 to U+001F) or is
|
|
44
|
-
// U+007F, […]
|
|
45
|
-
(codeUnit >= 0x0001 && codeUnit <= 0x001F) || codeUnit == 0x007F ||
|
|
46
|
-
// If the character is the first character and is in the range [0-9]
|
|
47
|
-
// (U+0030 to U+0039), […]
|
|
48
|
-
(index == 0 && codeUnit >= 0x0030 && codeUnit <= 0x0039) ||
|
|
49
|
-
// If the character is the second character and is in the range [0-9]
|
|
50
|
-
// (U+0030 to U+0039) and the first character is a `-` (U+002D), […]
|
|
51
|
-
(
|
|
52
|
-
index == 1 &&
|
|
53
|
-
codeUnit >= 0x0030 && codeUnit <= 0x0039 &&
|
|
54
|
-
firstCodeUnit == 0x002D
|
|
55
|
-
)
|
|
56
|
-
) {
|
|
57
|
-
// https://drafts.csswg.org/cssom/#escape-a-character-as-code-point
|
|
58
|
-
result += '\\' + codeUnit.toString(16) + ' ';
|
|
59
|
-
continue;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
if (
|
|
63
|
-
// If the character is the first character and is a `-` (U+002D), and
|
|
64
|
-
// there is no second character, […]
|
|
65
|
-
index == 0 &&
|
|
66
|
-
length == 1 &&
|
|
67
|
-
codeUnit == 0x002D
|
|
68
|
-
) {
|
|
69
|
-
result += '\\' + string.charAt(index);
|
|
70
|
-
continue;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
// If the character is not handled by one of the above rules and is
|
|
74
|
-
// greater than or equal to U+0080, is `-` (U+002D) or `_` (U+005F), or
|
|
75
|
-
// is in one of the ranges [0-9] (U+0030 to U+0039), [A-Z] (U+0041 to
|
|
76
|
-
// U+005A), or [a-z] (U+0061 to U+007A), […]
|
|
77
|
-
if (
|
|
78
|
-
codeUnit >= 0x0080 ||
|
|
79
|
-
codeUnit == 0x002D ||
|
|
80
|
-
codeUnit == 0x005F ||
|
|
81
|
-
codeUnit >= 0x0030 && codeUnit <= 0x0039 ||
|
|
82
|
-
codeUnit >= 0x0041 && codeUnit <= 0x005A ||
|
|
83
|
-
codeUnit >= 0x0061 && codeUnit <= 0x007A
|
|
84
|
-
) {
|
|
85
|
-
// the character itself
|
|
86
|
-
result += string.charAt(index);
|
|
87
|
-
continue;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
// Otherwise, the escaped character.
|
|
91
|
-
// https://drafts.csswg.org/cssom/#escape-a-character
|
|
92
|
-
result += '\\' + string.charAt(index);
|
|
93
|
-
|
|
94
|
-
}
|
|
95
|
-
return result;
|
|
96
|
-
};
|
|
97
|
-
|
|
98
|
-
if (!root.CSS) {
|
|
99
|
-
root.CSS = {};
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
root.CSS.escape = cssEscape;
|
|
103
|
-
return cssEscape;
|
|
104
|
-
|
|
105
|
-
}));
|
|
106
|
-
} (css_escape));
|
|
107
|
-
|
|
108
|
-
var escapeCSS = css_escape.exports;
|
|
109
|
-
|
|
110
|
-
export { escapeCSS as default };
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Google Chrome as of 67.0.3396.87 introduced timezones with offset that includes seconds.
|
|
3
|
-
* They usually appear for dates that denote time before the timezones were introduced
|
|
4
|
-
* (e.g. for 'Europe/Prague' timezone the offset is GMT+00:57:44 before 1 October 1891
|
|
5
|
-
* and GMT+01:00:00 after that date)
|
|
6
|
-
*
|
|
7
|
-
* Date#getTimezoneOffset returns the offset in minutes and would return 57 for the example above,
|
|
8
|
-
* which would lead to incorrect calculations.
|
|
9
|
-
*
|
|
10
|
-
* This function returns the timezone offset in milliseconds that takes seconds in account.
|
|
11
|
-
*/
|
|
12
|
-
function getTimezoneOffsetInMilliseconds(date) {
|
|
13
|
-
var utcDate = new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds()));
|
|
14
|
-
utcDate.setUTCFullYear(date.getFullYear());
|
|
15
|
-
return date.getTime() - utcDate.getTime();
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export { getTimezoneOffsetInMilliseconds as default };
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import toDate from '../../toDate/index.js';
|
|
2
|
-
import startOfUTCISOWeek from '../startOfUTCISOWeek/index.js';
|
|
3
|
-
import startOfUTCISOWeekYear from '../startOfUTCISOWeekYear/index.js';
|
|
4
|
-
import requiredArgs from '../requiredArgs/index.js';
|
|
5
|
-
|
|
6
|
-
var MILLISECONDS_IN_WEEK = 604800000;
|
|
7
|
-
function getUTCISOWeek(dirtyDate) {
|
|
8
|
-
requiredArgs(1, arguments);
|
|
9
|
-
var date = toDate(dirtyDate);
|
|
10
|
-
var diff = startOfUTCISOWeek(date).getTime() - startOfUTCISOWeekYear(date).getTime(); // Round the number of days to the nearest integer
|
|
11
|
-
// because the number of milliseconds in a week is not constant
|
|
12
|
-
// (e.g. it's different in the week of the daylight saving time clock shift)
|
|
13
|
-
|
|
14
|
-
return Math.round(diff / MILLISECONDS_IN_WEEK) + 1;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export { getUTCISOWeek as default };
|