@@ -54,6 +54,7 @@ const DATA_SOURCES = [
5454 binProperties : "#table-binary-unicode-properties" ,
5555 gcValues : getLatestUnicodeGeneralCategoryValues ,
5656 scValues : getLatestUnicodeScriptValues ,
57+ binPropertiesOfStrings : "#table-binary-unicode-properties-of-strings" ,
5758 } ,
5859]
5960const FILE_PATH = "src/unicode/properties.ts"
@@ -63,6 +64,7 @@ type Datum = {
6364 binProperties : string [ ]
6465 gcValues : string [ ]
6566 scValues : string [ ]
67+ binPropertiesOfStrings : string [ ]
6668}
6769
6870// Main
@@ -72,12 +74,14 @@ type Datum = {
7274 binProperties : new Set < string > ( ) ,
7375 gcValues : new Set < string > ( ) ,
7476 scValues : new Set < string > ( ) ,
77+ binPropertiesOfStrings : new Set < string > ( ) ,
7578 }
7679
7780 for ( const {
7881 binProperties,
7982 gcValues,
8083 scValues,
84+ binPropertiesOfStrings,
8185 url,
8286 version,
8387 } of DATA_SOURCES ) {
@@ -86,6 +90,7 @@ type Datum = {
8690 binProperties : [ ] ,
8791 gcValues : [ ] ,
8892 scValues : [ ] ,
93+ binPropertiesOfStrings : [ ] ,
8994 }
9095 data [ version ] = datum
9196
@@ -120,6 +125,13 @@ type Datum = {
120125 scValues ,
121126 existing . scValues ,
122127 )
128+ if ( binPropertiesOfStrings ) {
129+ datum . binPropertiesOfStrings = await collectValues (
130+ window ,
131+ binPropertiesOfStrings ,
132+ existing . binPropertiesOfStrings ,
133+ )
134+ }
123135
124136 logger . log ( "Done" )
125137 }
@@ -140,6 +152,9 @@ const scValueSets = new DataSet(${Object.values(data)
140152const binPropertySets = new DataSet(${ Object . values ( data )
141153 . map ( ( d ) => makeDataCode ( d . binProperties ) )
142154 . join ( "," ) } )
155+ const binPropertyOfStringsSets = new DataSet(${ Object . values ( data )
156+ . map ( ( d ) => makeDataCode ( d . binPropertiesOfStrings ) )
157+ . join ( "," ) } )
143158
144159export function isValidUnicodeProperty(version: number, name: string, value: string): boolean {
145160 if (gcNameSet.has(name)) {
@@ -169,6 +184,19 @@ export function isValidLoneUnicodeProperty(version: number, value: string): bool
169184 . filter ( Boolean )
170185 . join ( " || " ) }
171186}
187+
188+ export function isValidLoneUnicodePropertyOfString(version: number, value: string): boolean {
189+ return ${ Object . entries ( data )
190+ . map ( ( [ version , { binPropertiesOfStrings } ] ) =>
191+ makeVerificationCode (
192+ version ,
193+ "binPropertyOfStringsSets" ,
194+ binPropertiesOfStrings ,
195+ ) ,
196+ )
197+ . filter ( Boolean )
198+ . join ( " || " ) }
199+ }
172200`
173201
174202 logger . log ( "Formatting code..." )
0 commit comments