libphonenumber-js 1.9.38 → 1.9.42
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/CHANGELOG.md +10 -0
- package/README.md +8 -8
- package/build/AsYouType.test.js +25 -3
- package/build/AsYouType.test.js.map +1 -1
- package/build/AsYouTypeFormatter.PatternMatcher.js +435 -0
- package/build/AsYouTypeFormatter.PatternMatcher.js.map +1 -0
- package/build/AsYouTypeFormatter.PatternMatcher.test.js +447 -0
- package/build/AsYouTypeFormatter.PatternMatcher.test.js.map +1 -0
- package/build/AsYouTypeFormatter.js +57 -10
- package/build/AsYouTypeFormatter.js.map +1 -1
- package/build/PhoneNumber.test.js +9 -9
- package/build/PhoneNumber.test.js.map +1 -1
- package/build/findNumbers.test.js +23 -23
- package/build/findNumbers.test.js.map +1 -1
- package/build/getExampleNumber.test.js +4 -4
- package/build/getExampleNumber.test.js.map +1 -1
- package/build/getNumberType.test.js +3 -3
- package/build/getNumberType.test.js.map +1 -1
- package/build/helpers/checkNumberLength.test.js +3 -3
- package/build/helpers/checkNumberLength.test.js.map +1 -1
- package/build/helpers/extractCountryCallingCode.test.js +4 -4
- package/build/helpers/extractCountryCallingCode.test.js.map +1 -1
- package/build/parsePhoneNumber.test.js +2 -2
- package/build/parsePhoneNumber.test.js.map +1 -1
- package/bundle/libphonenumber-js.min.js +1 -1
- package/bundle/libphonenumber-js.min.js.map +1 -1
- package/bundle/libphonenumber-max.js +1 -1
- package/bundle/libphonenumber-max.js.map +1 -1
- package/bundle/libphonenumber-min.js +1 -1
- package/bundle/libphonenumber-min.js.map +1 -1
- package/bundle/libphonenumber-mobile.js +1 -1
- package/bundle/libphonenumber-mobile.js.map +1 -1
- package/es6/AsYouType.test.js +25 -3
- package/es6/AsYouType.test.js.map +1 -1
- package/es6/AsYouTypeFormatter.PatternMatcher.js +428 -0
- package/es6/AsYouTypeFormatter.PatternMatcher.js.map +1 -0
- package/es6/AsYouTypeFormatter.PatternMatcher.test.js +442 -0
- package/es6/AsYouTypeFormatter.PatternMatcher.test.js.map +1 -0
- package/es6/AsYouTypeFormatter.js +56 -10
- package/es6/AsYouTypeFormatter.js.map +1 -1
- package/es6/PhoneNumber.test.js +1 -1
- package/es6/PhoneNumber.test.js.map +1 -1
- package/es6/findNumbers.test.js +1 -1
- package/es6/findNumbers.test.js.map +1 -1
- package/es6/getExampleNumber.test.js +2 -2
- package/es6/getExampleNumber.test.js.map +1 -1
- package/es6/getNumberType.test.js +1 -1
- package/es6/getNumberType.test.js.map +1 -1
- package/es6/helpers/checkNumberLength.test.js +1 -1
- package/es6/helpers/checkNumberLength.test.js.map +1 -1
- package/es6/helpers/extractCountryCallingCode.test.js +1 -1
- package/es6/helpers/extractCountryCallingCode.test.js.map +1 -1
- package/es6/parsePhoneNumber.test.js +1 -1
- package/es6/parsePhoneNumber.test.js.map +1 -1
- package/exports/README.md +78 -0
- package/exports/examples.mobile.json/index.js +1 -0
- package/exports/metadata.max.json/index.js +1 -0
- package/exports/metadata.min.json/index.js +1 -0
- package/exports/metadata.mobile.json/index.js +1 -0
- package/exports/package.exports.json +55 -0
- package/max/index.commonjs.js +1 -1
- package/max/metadata.js +1 -1
- package/metadata.full.json +1 -1
- package/metadata.full.json.js +1 -1
- package/metadata.max.json +1 -0
- package/metadata.max.json.d.ts +4 -0
- package/metadata.max.json.js +4 -0
- package/metadata.min.json +1 -1
- package/metadata.min.json.js +1 -1
- package/metadata.mobile.json +1 -1
- package/metadata.mobile.json.js +1 -1
- package/package.json +4 -2
- package/source/AsYouType.test.js +26 -3
- package/source/AsYouTypeFormatter.PatternMatcher.js +343 -0
- package/source/AsYouTypeFormatter.PatternMatcher.test.js +596 -0
- package/source/AsYouTypeFormatter.js +58 -9
- package/source/PhoneNumber.test.js +1 -1
- package/source/findNumbers.test.js +1 -1
- package/source/getExampleNumber.test.js +2 -2
- package/source/getNumberType.test.js +1 -1
- package/source/helpers/checkNumberLength.test.js +1 -1
- package/source/helpers/extractCountryCallingCode.test.js +1 -1
- package/source/parsePhoneNumber.test.js +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "libphonenumber-js",
|
|
3
|
-
"version": "1.9.
|
|
3
|
+
"version": "1.9.42",
|
|
4
4
|
"description": "A simpler (and smaller) rewrite of Google Android's libphonenumber library in javascript",
|
|
5
5
|
"main": "index.common.js",
|
|
6
6
|
"module": "index.es6.js",
|
|
@@ -38,12 +38,14 @@
|
|
|
38
38
|
"metadata:update:release": "npm run metadata:download && babel-node runnable/metadata-update-and-release",
|
|
39
39
|
"metadata:update:branch": "npm run metadata:branch && npm run metadata:download && babel-node runnable/metadata-update-and-push",
|
|
40
40
|
"metadata:update:pull-request": "npm run metadata:branch && npm run metadata:download && babel-node runnable/metadata-update-and-push-and-pull-request",
|
|
41
|
-
"metadata:generate": "npm-run-all metadata:generate:min metadata:generate:full metadata:generate:mobile metadata:generate:min:js metadata:generate:full:js metadata:generate:mobile:js metadata:generate:mobile:examples:js",
|
|
41
|
+
"metadata:generate": "npm-run-all metadata:generate:min metadata:generate:full metadata:generate:max metadata:generate:mobile metadata:generate:min:js metadata:generate:full:js metadata:generate:max:js metadata:generate:mobile:js metadata:generate:mobile:examples:js",
|
|
42
42
|
"metadata:generate:min": "babel-node -- runnable/generate ../PhoneNumberMetadata.xml ../metadata.min.json --examples mobile",
|
|
43
43
|
"metadata:generate:full": "babel-node -- runnable/generate ../PhoneNumberMetadata.xml ../metadata.full.json --extended --debug",
|
|
44
|
+
"metadata:generate:max": "babel-node -- runnable/generate ../PhoneNumberMetadata.xml ../metadata.max.json --extended --debug",
|
|
44
45
|
"metadata:generate:mobile": "babel-node -- runnable/generate ../PhoneNumberMetadata.xml ../metadata.mobile.json --types mobile",
|
|
45
46
|
"metadata:generate:min:js": "babel-node -- runnable/json-to-js ./metadata.min.json",
|
|
46
47
|
"metadata:generate:full:js": "babel-node -- runnable/json-to-js ./metadata.full.json",
|
|
48
|
+
"metadata:generate:max:js": "babel-node -- runnable/json-to-js ./metadata.max.json",
|
|
47
49
|
"metadata:generate:mobile:js": "babel-node -- runnable/json-to-js ./metadata.mobile.json",
|
|
48
50
|
"metadata:generate:mobile:examples:js": "babel-node -- runnable/json-to-js ./examples.mobile.json",
|
|
49
51
|
"metadata:download": "babel-node runnable/download https://raw.githubusercontent.com/googlei18n/libphonenumber/master/resources/PhoneNumberMetadata.xml PhoneNumberMetadata.xml",
|
package/source/AsYouType.test.js
CHANGED
|
@@ -585,14 +585,27 @@ describe('AsYouType', () => {
|
|
|
585
585
|
formatter.reset()
|
|
586
586
|
formatter.input('+1-1')
|
|
587
587
|
|
|
588
|
-
|
|
589
|
-
|
|
588
|
+
// Before leading digits < 3 matching was implemented:
|
|
589
|
+
//
|
|
590
|
+
// phoneNumber = formatter.getNumber()
|
|
591
|
+
// expect(phoneNumber).to.not.be.undefined
|
|
592
|
+
//
|
|
593
|
+
// formatter.input('1')
|
|
594
|
+
// phoneNumber = formatter.getNumber()
|
|
595
|
+
// expect(phoneNumber.country).to.be.undefined
|
|
596
|
+
// phoneNumber.countryCallingCode.should.equal('1')
|
|
597
|
+
// phoneNumber.number.should.equal('+111')
|
|
590
598
|
|
|
599
|
+
// After leading digits < 3 matching was implemented:
|
|
600
|
+
//
|
|
601
|
+
phoneNumber = formatter.getNumber()
|
|
602
|
+
expect(phoneNumber).to.be.undefined
|
|
603
|
+
//
|
|
591
604
|
formatter.input('1')
|
|
592
605
|
phoneNumber = formatter.getNumber()
|
|
593
606
|
expect(phoneNumber.country).to.be.undefined
|
|
594
607
|
phoneNumber.countryCallingCode.should.equal('1')
|
|
595
|
-
phoneNumber.number.should.equal('+
|
|
608
|
+
phoneNumber.number.should.equal('+11')
|
|
596
609
|
})
|
|
597
610
|
|
|
598
611
|
it('should work with countries that add digits to national (significant) number', () => {
|
|
@@ -689,6 +702,16 @@ describe('AsYouType', () => {
|
|
|
689
702
|
formatter.isValid().should.equal(true)
|
|
690
703
|
})
|
|
691
704
|
|
|
705
|
+
// https://gitlab.com/catamphetamine/react-phone-number-input/-/issues/93
|
|
706
|
+
it('should format Indonesian numbers', () => {
|
|
707
|
+
const formatter = new AsYouType('ID')
|
|
708
|
+
formatter.getChars().should.equal('')
|
|
709
|
+
// Before leading digits < 3 matching was implemented:
|
|
710
|
+
// formatter.input('081').should.equal('(081)')
|
|
711
|
+
// After leading digits < 3 matching was implemented:
|
|
712
|
+
formatter.input('081').should.equal('081')
|
|
713
|
+
})
|
|
714
|
+
|
|
692
715
|
it('should prepend `complexPrefixBeforeNationalSignificantNumber` (not a complete number)', () => {
|
|
693
716
|
// A country having `national_prefix_for_parsing` with a "capturing group".
|
|
694
717
|
// National prefix is either not used in a format or is optional.
|
|
@@ -0,0 +1,343 @@
|
|
|
1
|
+
export default class PatternMatcher {
|
|
2
|
+
constructor(pattern) {
|
|
3
|
+
this.matchTree = new PatternParser().parse(pattern)
|
|
4
|
+
// console.log(JSON.stringify(this.matchTree, null, 2))
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
match(string, { allowOverflow } = {}) {
|
|
8
|
+
if (!string) {
|
|
9
|
+
throw new Error('String is required')
|
|
10
|
+
}
|
|
11
|
+
const result = match(string.split(''), this.matchTree, true)
|
|
12
|
+
if (result && result.match) {
|
|
13
|
+
delete result.matchedChars
|
|
14
|
+
}
|
|
15
|
+
if (result && result.overflow) {
|
|
16
|
+
if (!allowOverflow) {
|
|
17
|
+
return
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
return result
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
function match(characters, tree, last) {
|
|
25
|
+
if (typeof tree === 'string') {
|
|
26
|
+
if (last) {
|
|
27
|
+
if (characters.length > tree.length) {
|
|
28
|
+
return {
|
|
29
|
+
overflow: true
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
const characterString = characters.join('')
|
|
34
|
+
if (tree.indexOf(characterString) === 0) {
|
|
35
|
+
if (characters.length === tree.length) {
|
|
36
|
+
return {
|
|
37
|
+
match: true,
|
|
38
|
+
matchedChars: characters
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
return {
|
|
42
|
+
partialMatch: true,
|
|
43
|
+
// matchedChars: characters
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
if (characterString.indexOf(tree) === 0) {
|
|
47
|
+
return {
|
|
48
|
+
match: true,
|
|
49
|
+
matchedChars: characters.slice(0, tree.length)
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
return
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
if (Array.isArray(tree)) {
|
|
56
|
+
let restCharacters = characters.slice()
|
|
57
|
+
let i = 0
|
|
58
|
+
while (i < tree.length) {
|
|
59
|
+
const subtree = tree[i]
|
|
60
|
+
const result = match(restCharacters, subtree, last && (i === tree.length - 1))
|
|
61
|
+
if (!result || result.overflow) {
|
|
62
|
+
return result
|
|
63
|
+
}
|
|
64
|
+
if (result.match) {
|
|
65
|
+
// Continue with the next subtree with the rest of the characters.
|
|
66
|
+
restCharacters = restCharacters.slice(result.matchedChars.length)
|
|
67
|
+
if (restCharacters.length === 0) {
|
|
68
|
+
if (i === tree.length - 1) {
|
|
69
|
+
return {
|
|
70
|
+
match: true,
|
|
71
|
+
matchedChars: characters
|
|
72
|
+
}
|
|
73
|
+
} else {
|
|
74
|
+
return {
|
|
75
|
+
partialMatch: true,
|
|
76
|
+
// matchedChars: characters
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
} else if (result.partialMatch) {
|
|
81
|
+
return {
|
|
82
|
+
partialMatch: true,
|
|
83
|
+
// matchedChars: characters
|
|
84
|
+
}
|
|
85
|
+
} else {
|
|
86
|
+
throw new Error(`Unsupported match result:\n${JSON.stringify(result, null, 2)}`)
|
|
87
|
+
}
|
|
88
|
+
i++
|
|
89
|
+
}
|
|
90
|
+
if (last) {
|
|
91
|
+
return {
|
|
92
|
+
overflow: true
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
return {
|
|
96
|
+
match: true,
|
|
97
|
+
matchedChars: characters.slice(0, characters.length - restCharacters.length)
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
switch (tree.op) {
|
|
102
|
+
case '|':
|
|
103
|
+
let partialMatch
|
|
104
|
+
for (const branch of tree.args) {
|
|
105
|
+
const result = match(characters, branch, last)
|
|
106
|
+
if (result) {
|
|
107
|
+
if (result.overflow) {
|
|
108
|
+
return result
|
|
109
|
+
} else if (result.match) {
|
|
110
|
+
return {
|
|
111
|
+
match: true,
|
|
112
|
+
matchedChars: result.matchedChars
|
|
113
|
+
}
|
|
114
|
+
} else if (result.partialMatch) {
|
|
115
|
+
partialMatch = true
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
if (partialMatch) {
|
|
120
|
+
return {
|
|
121
|
+
partialMatch: true,
|
|
122
|
+
// matchedChars: ...
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
// Not even a partial match.
|
|
126
|
+
return
|
|
127
|
+
|
|
128
|
+
case '[]':
|
|
129
|
+
for (const char of tree.args) {
|
|
130
|
+
if (characters[0] === char) {
|
|
131
|
+
if (characters.length === 1) {
|
|
132
|
+
return {
|
|
133
|
+
match: true,
|
|
134
|
+
matchedChars: characters
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
if (last) {
|
|
138
|
+
return {
|
|
139
|
+
overflow: true
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
return {
|
|
143
|
+
match: true,
|
|
144
|
+
matchedChars: [char]
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
// No character matches.
|
|
149
|
+
return
|
|
150
|
+
|
|
151
|
+
default:
|
|
152
|
+
throw new Error(`Unsupported instruction tree: ${tree}`)
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
const OPERATOR = new RegExp(
|
|
157
|
+
// any of:
|
|
158
|
+
'(' +
|
|
159
|
+
// or operator
|
|
160
|
+
'\\|' +
|
|
161
|
+
// or
|
|
162
|
+
'|' +
|
|
163
|
+
// or group start
|
|
164
|
+
'\\(\\?\\:' +
|
|
165
|
+
// or
|
|
166
|
+
'|' +
|
|
167
|
+
// or group end
|
|
168
|
+
'\\)' +
|
|
169
|
+
// or
|
|
170
|
+
'|' +
|
|
171
|
+
// one-of set start
|
|
172
|
+
'\\[' +
|
|
173
|
+
// or
|
|
174
|
+
'|' +
|
|
175
|
+
// one-of set end
|
|
176
|
+
'\\]' +
|
|
177
|
+
')'
|
|
178
|
+
)
|
|
179
|
+
|
|
180
|
+
class PatternParser {
|
|
181
|
+
parse(pattern) {
|
|
182
|
+
this.context = [{
|
|
183
|
+
or: true,
|
|
184
|
+
instructions: []
|
|
185
|
+
}]
|
|
186
|
+
|
|
187
|
+
this.parsePattern(pattern)
|
|
188
|
+
|
|
189
|
+
if (this.context.length !== 1) {
|
|
190
|
+
throw new Error('Non-finalized contexts left when pattern parse ended')
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
const { branches, instructions } = this.context[0]
|
|
194
|
+
|
|
195
|
+
if (branches) {
|
|
196
|
+
return [{
|
|
197
|
+
op: '|',
|
|
198
|
+
args: branches.concat([instructions])
|
|
199
|
+
}]
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
if (instructions.length === 0) {
|
|
203
|
+
throw new Error('Pattern is required')
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
return instructions
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
startContext(context) {
|
|
210
|
+
this.context.push(context)
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
endContext() {
|
|
214
|
+
this.context.pop()
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
getContext() {
|
|
218
|
+
return this.context[this.context.length - 1]
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
parsePattern(pattern) {
|
|
222
|
+
if (!pattern) {
|
|
223
|
+
throw new Error('Empty pattern passed')
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
const match = pattern.match(OPERATOR)
|
|
227
|
+
if (!match) {
|
|
228
|
+
this.getContext().instructions = this.getContext().instructions.concat(
|
|
229
|
+
pattern.split('')
|
|
230
|
+
)
|
|
231
|
+
return
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
const operator = match[1]
|
|
235
|
+
const before = pattern.slice(0, match.index)
|
|
236
|
+
const rightPart = pattern.slice(match.index + operator.length)
|
|
237
|
+
|
|
238
|
+
switch (operator) {
|
|
239
|
+
case '(?:':
|
|
240
|
+
if (before) {
|
|
241
|
+
this.parsePattern(before)
|
|
242
|
+
}
|
|
243
|
+
this.startContext({
|
|
244
|
+
or: true,
|
|
245
|
+
instructions: [],
|
|
246
|
+
branches: []
|
|
247
|
+
})
|
|
248
|
+
break
|
|
249
|
+
|
|
250
|
+
case ')':
|
|
251
|
+
if (!this.getContext().or) {
|
|
252
|
+
throw new Error('")" operator must be preceded by "(?:" operator')
|
|
253
|
+
}
|
|
254
|
+
if (before) {
|
|
255
|
+
this.parsePattern(before)
|
|
256
|
+
}
|
|
257
|
+
if (this.getContext().instructions.length === 0) {
|
|
258
|
+
throw new Error('No instructions found after "|" operator in an "or" group')
|
|
259
|
+
}
|
|
260
|
+
const { branches } = this.getContext()
|
|
261
|
+
branches.push(
|
|
262
|
+
this.getContext().instructions
|
|
263
|
+
)
|
|
264
|
+
this.endContext()
|
|
265
|
+
this.getContext().instructions.push({
|
|
266
|
+
op: '|',
|
|
267
|
+
args: branches
|
|
268
|
+
})
|
|
269
|
+
break
|
|
270
|
+
|
|
271
|
+
case '|':
|
|
272
|
+
if (!this.getContext().or) {
|
|
273
|
+
throw new Error('"|" operator can only be used inside "or" groups')
|
|
274
|
+
}
|
|
275
|
+
if (before) {
|
|
276
|
+
this.parsePattern(before)
|
|
277
|
+
}
|
|
278
|
+
// The top-level is an implicit "or" group, if required.
|
|
279
|
+
if (!this.getContext().branches) {
|
|
280
|
+
if (this.context.length === 1) {
|
|
281
|
+
this.getContext().branches = []
|
|
282
|
+
} else {
|
|
283
|
+
throw new Error('"branches" not found in an "or" group context')
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
this.getContext().branches.push(
|
|
287
|
+
this.getContext().instructions
|
|
288
|
+
)
|
|
289
|
+
this.getContext().instructions = []
|
|
290
|
+
break
|
|
291
|
+
|
|
292
|
+
case '[':
|
|
293
|
+
if (before) {
|
|
294
|
+
this.parsePattern(before)
|
|
295
|
+
}
|
|
296
|
+
this.startContext({
|
|
297
|
+
oneOfSet: true
|
|
298
|
+
})
|
|
299
|
+
break
|
|
300
|
+
|
|
301
|
+
case ']':
|
|
302
|
+
if (!this.getContext().oneOfSet) {
|
|
303
|
+
throw new Error('"]" operator must be preceded by "[" operator')
|
|
304
|
+
}
|
|
305
|
+
this.endContext()
|
|
306
|
+
this.getContext().instructions.push({
|
|
307
|
+
op: '[]',
|
|
308
|
+
args: parseOneOfSet(before)
|
|
309
|
+
})
|
|
310
|
+
break
|
|
311
|
+
|
|
312
|
+
default:
|
|
313
|
+
throw new Error(`Unknown operator: ${operator}`)
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
if (rightPart) {
|
|
317
|
+
this.parsePattern(rightPart)
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
function parseOneOfSet(pattern) {
|
|
323
|
+
const values = []
|
|
324
|
+
let i = 0
|
|
325
|
+
while (i < pattern.length) {
|
|
326
|
+
if (pattern[i] === '-') {
|
|
327
|
+
if (i === 0 || i === pattern.length - 1) {
|
|
328
|
+
throw new Error(`Couldn't parse a one-of set pattern: ${pattern}`)
|
|
329
|
+
}
|
|
330
|
+
const prevValue = pattern[i - 1].charCodeAt(0) + 1
|
|
331
|
+
const nextValue = pattern[i + 1].charCodeAt(0) - 1
|
|
332
|
+
let value = prevValue
|
|
333
|
+
while (value <= nextValue) {
|
|
334
|
+
values.push(String.fromCharCode(value))
|
|
335
|
+
value++
|
|
336
|
+
}
|
|
337
|
+
} else {
|
|
338
|
+
values.push(pattern[i])
|
|
339
|
+
}
|
|
340
|
+
i++
|
|
341
|
+
}
|
|
342
|
+
return values
|
|
343
|
+
}
|