Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(635)

Unified Diff: appengine/config_service/ui/bower_components/polymer/lib/utils/case-map.html

Issue 2923973003: Added base template for config ui. (Closed)
Patch Set: Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: appengine/config_service/ui/bower_components/polymer/lib/utils/case-map.html
diff --git a/appengine/config_service/ui/bower_components/polymer/lib/utils/case-map.html b/appengine/config_service/ui/bower_components/polymer/lib/utils/case-map.html
new file mode 100644
index 0000000000000000000000000000000000000000..b1b44cdafe288d37eddebf73b0e2e0d1fb79b3ad
--- /dev/null
+++ b/appengine/config_service/ui/bower_components/polymer/lib/utils/case-map.html
@@ -0,0 +1,64 @@
+<!--
+@license
+Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
+This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
+The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
+The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
+Code distributed by Google as part of the polymer project is also
+subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
+-->
+<link rel="import" href="boot.html">
+<script>
+(function() {
+ 'use strict';
+
+ const caseMap = {};
+ const DASH_TO_CAMEL = /-[a-z]/g;
+ const CAMEL_TO_DASH = /([A-Z])/g;
+
+ /**
+ * Module with utilities for converting between "dash-case" and "camelCase"
+ * identifiers.
+ *
+ * @namespace
+ * @memberof Polymer
+ * @summary Module that provides utilities for converting between "dash-case"
+ * and "camelCase".
+ */
+ const CaseMap = {
+
+ /**
+ * Converts "dash-case" identifier (e.g. `foo-bar-baz`) to "camelCase"
+ * (e.g. `fooBarBaz`).
+ *
+ * @memberof Polymer.CaseMap
+ * @param {string} dash Dash-case identifier
+ * @return {string} Camel-case representation of the identifier
+ */
+ dashToCamelCase(dash) {
+ return caseMap[dash] || (
+ caseMap[dash] = dash.indexOf('-') < 0 ? dash : dash.replace(DASH_TO_CAMEL,
+ (m) => m[1].toUpperCase()
+ )
+ );
+ },
+
+ /**
+ * Converts "camelCase" identifier (e.g. `fooBarBaz`) to "dash-case"
+ * (e.g. `foo-bar-baz`).
+ *
+ * @memberof Polymer.CaseMap
+ * @param {string} camel Camel-case identifier
+ * @return {string} Dash-case representation of the identifier
+ */
+ camelToDashCase(camel) {
+ return caseMap[camel] || (
+ caseMap[camel] = camel.replace(CAMEL_TO_DASH, '-$1').toLowerCase()
+ );
+ }
+
+ };
+
+ Polymer.CaseMap = CaseMap;
+})();
+</script>

Powered by Google App Engine
This is Rietveld 408576698