Lines Matching +full:js +full:- +full:yaml
7 # https://www.apache.org/licenses/LICENSE-2.0
18 import yaml
23 def _read_sample_metadata_comment(sample_file: str) -> Dict:
24 """Additional meta-information can be provided through embedded comments:
26 // sample-metadata:
29 // usage: node iam.js --help
35 r"(?P<metadata>// *sample-metadata:([^\n]+|\n//)+)", contents, re.DOTALL
38 # the metadata yaml is stored in a comments, remove the
39 # prefix so that we can parse the yaml contained.
42 sample_metadata = yaml.load(
43 sample_metadata_string, Loader=yaml.SafeLoader
44 )["sample-metadata"]
45 except yaml.scanner.ScannerError:
51 def _sample_metadata(file: str) -> Dict[str, str]:
59 def all_samples(sample_globs: List[str]) -> List[Dict[str, str]]:
60 """Walks samples directory and builds up samples data-structure
69 "file": "samples/requesterPays.js"
81 """Parser to convert fooBar.js to Foo Bar."""
84 str_decamelize = re.sub("^.", value[0].upper(), value) # apple -> Apple.
86 "([A-Z]+)([A-Z])([a-z0-9])", r"\1 \2\3", str_decamelize
87 ) # ACLBatman -> ACL Batman.
88 return re.sub("([a-z0-9])([A-Z])", r"\1 \2", str_decamelize) # FooBar -> Foo Bar.