@graphql-mesh/string-interpolation 0.0.0

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.
@@ -0,0 +1,2 @@
1
+ import { Interpolator } from './interpolator';
2
+ export { Interpolator };
package/dist/index.js ADDED
@@ -0,0 +1,174 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
6
+
7
+ const _ = _interopDefault(require('lodash'));
8
+ const jsonPtr = require('json-ptr');
9
+
10
+ const defaultOptions = {
11
+ delimiter: ['{', '}'],
12
+ };
13
+
14
+ const uppercase = value => value.toUpperCase();
15
+
16
+ const lowercase = value => value.toLowerCase();
17
+
18
+ const titlecase = value => value.replace(/\w\S*/g, s => s.charAt(0).toUpperCase() + s.substr(1).toLowerCase());
19
+
20
+ const defaultModifiers = [{
21
+ key: 'uppercase',
22
+ transform: uppercase,
23
+ },
24
+ {
25
+ key: 'lowercase',
26
+ transform: lowercase,
27
+ },
28
+ {
29
+ key: 'title',
30
+ transform: titlecase,
31
+ }];
32
+
33
+ class Interpolator {
34
+ constructor(options = defaultOptions) {
35
+ this.options = options;
36
+ this.modifiers = [];
37
+ this.aliases = [];
38
+ this.registerBuiltInModifiers();
39
+ }
40
+ registerBuiltInModifiers() {
41
+ defaultModifiers.forEach(modifier => this.registerModifier(modifier.key, modifier.transform));
42
+ return this;
43
+ }
44
+ get delimiter() {
45
+ return this.options.delimiter;
46
+ }
47
+ delimiterStart() {
48
+ return this.options.delimiter[0];
49
+ }
50
+ delimiterEnd() {
51
+ return this.options.delimiter[1];
52
+ }
53
+ registerModifier(key, transform) {
54
+ if (!key) {
55
+ return new Error('Modifiers must have a key');
56
+ }
57
+ if (typeof transform !== 'function') {
58
+ return new Error('Modifiers must have a transformer. Transformers must be a function that returns a value.');
59
+ }
60
+ this.modifiers.push({ key: key.toLowerCase(), transform });
61
+ return this;
62
+ }
63
+ parseRules(str) {
64
+ const regex = `${this.delimiterStart()}([^}]+)${this.delimiterEnd()}`;
65
+ const execRegex = new RegExp(regex, 'gi');
66
+ const matches = str.match(execRegex);
67
+ // const parsableMatches = matches.map((match) => ({ key: removeDelimiter(match), replaceWith: match }));
68
+ return matches ? this.extractRules(matches) : [];
69
+ }
70
+ extractRules(matches) {
71
+ return matches.map((match) => {
72
+ const alternativeText = this.getAlternativeText(match);
73
+ const modifiers = this.getModifiers(match);
74
+ return {
75
+ key: this.getKeyFromMatch(match),
76
+ replace: match,
77
+ modifiers,
78
+ alternativeText
79
+ };
80
+ });
81
+ }
82
+ getKeyFromMatch(match) {
83
+ const removeReservedSymbols = [':', '|'];
84
+ return this.removeDelimiter(removeReservedSymbols.reduce((val, sym) => val.indexOf(sym) > 0 ? this.removeAfter(val, sym) : val, match));
85
+ }
86
+ removeDelimiter(val) {
87
+ return val.replace(new RegExp(this.delimiterStart(), 'g'), '').replace(new RegExp(this.delimiterEnd(), 'g'), '');
88
+ }
89
+ removeAfter(str, val) {
90
+ return str.substring(0, str.indexOf(val));
91
+ }
92
+ extractAfter(str, val) {
93
+ return str.substring(str.indexOf(val) + 1);
94
+ }
95
+ getAlternativeText(str) {
96
+ if (str.indexOf(':') > 0) {
97
+ const altText = this.removeDelimiter(this.extractAfter(str, ':'));
98
+ if (altText.indexOf('|') > 0) {
99
+ return this.removeAfter(altText, '|');
100
+ }
101
+ return altText;
102
+ }
103
+ return '';
104
+ }
105
+ getModifiers(str) {
106
+ if (str.indexOf('|') > 0) {
107
+ const strModifiers = this.removeDelimiter(this.extractAfter(str, '|')).split(',');
108
+ return strModifiers.map(modifier => this.getModifier(modifier.toLowerCase()));
109
+ }
110
+ return [];
111
+ }
112
+ parse(str = '', data = {}) {
113
+ const rules = this.parseRules(str);
114
+ if (rules && rules.length > 0) {
115
+ return this.parseFromRules(str, data, rules);
116
+ }
117
+ return str;
118
+ }
119
+ parseFromRules(str, data, rules) {
120
+ return rules.reduce((reducedStr, rule) => this.applyRule(reducedStr, rule, data), str);
121
+ }
122
+ applyRule(str, rule, data = {}) {
123
+ const dataToReplace = this.applyData(rule.key, data);
124
+ if (dataToReplace) {
125
+ return str.replace(rule.replace, this.applyModifiers(rule.modifiers, dataToReplace, data));
126
+ }
127
+ else if (rule.alternativeText) {
128
+ return str.replace(rule.replace, this.applyModifiers(rule.modifiers, rule.alternativeText, data));
129
+ }
130
+ const defaultModifier = this.applyModifiers(rule.modifiers, rule.key, data);
131
+ if (defaultModifier === rule.key) {
132
+ return str.replace(rule.replace, '');
133
+ }
134
+ return str.replace(rule.replace, defaultModifier);
135
+ }
136
+ getFromAlias(key) {
137
+ return this.aliases.find(alias => alias.key.toLowerCase() === key.toLowerCase());
138
+ }
139
+ applyData(key, data) {
140
+ const [prop, ptr] = key.split('#');
141
+ const propData = _.get(data, prop);
142
+ if (ptr) {
143
+ return jsonPtr.JsonPointer.get(propData, ptr);
144
+ }
145
+ return propData;
146
+ }
147
+ getModifier(key) {
148
+ return this.modifiers.find(modifier => modifier.key === key);
149
+ }
150
+ applyModifiers(modifiers, str, rawData) {
151
+ try {
152
+ const transformers = modifiers.map(modifier => modifier && modifier.transform);
153
+ return transformers.reduce((str, transform) => transform ? transform(str, rawData) : str, str);
154
+ }
155
+ catch (e) {
156
+ return str;
157
+ }
158
+ }
159
+ addAlias(key, ref) {
160
+ if (typeof ref === 'function') {
161
+ this.aliases.push({ key, ref: ref() });
162
+ }
163
+ else {
164
+ this.aliases.push({ key, ref });
165
+ }
166
+ return this;
167
+ }
168
+ removeAlias(key) {
169
+ this.aliases = this.aliases.filter(alias => alias.key !== key);
170
+ return this;
171
+ }
172
+ }
173
+
174
+ exports.Interpolator = Interpolator;
package/dist/index.mjs ADDED
@@ -0,0 +1,168 @@
1
+ import _ from 'lodash';
2
+ import { JsonPointer } from 'json-ptr';
3
+
4
+ const defaultOptions = {
5
+ delimiter: ['{', '}'],
6
+ };
7
+
8
+ const uppercase = value => value.toUpperCase();
9
+
10
+ const lowercase = value => value.toLowerCase();
11
+
12
+ const titlecase = value => value.replace(/\w\S*/g, s => s.charAt(0).toUpperCase() + s.substr(1).toLowerCase());
13
+
14
+ const defaultModifiers = [{
15
+ key: 'uppercase',
16
+ transform: uppercase,
17
+ },
18
+ {
19
+ key: 'lowercase',
20
+ transform: lowercase,
21
+ },
22
+ {
23
+ key: 'title',
24
+ transform: titlecase,
25
+ }];
26
+
27
+ class Interpolator {
28
+ constructor(options = defaultOptions) {
29
+ this.options = options;
30
+ this.modifiers = [];
31
+ this.aliases = [];
32
+ this.registerBuiltInModifiers();
33
+ }
34
+ registerBuiltInModifiers() {
35
+ defaultModifiers.forEach(modifier => this.registerModifier(modifier.key, modifier.transform));
36
+ return this;
37
+ }
38
+ get delimiter() {
39
+ return this.options.delimiter;
40
+ }
41
+ delimiterStart() {
42
+ return this.options.delimiter[0];
43
+ }
44
+ delimiterEnd() {
45
+ return this.options.delimiter[1];
46
+ }
47
+ registerModifier(key, transform) {
48
+ if (!key) {
49
+ return new Error('Modifiers must have a key');
50
+ }
51
+ if (typeof transform !== 'function') {
52
+ return new Error('Modifiers must have a transformer. Transformers must be a function that returns a value.');
53
+ }
54
+ this.modifiers.push({ key: key.toLowerCase(), transform });
55
+ return this;
56
+ }
57
+ parseRules(str) {
58
+ const regex = `${this.delimiterStart()}([^}]+)${this.delimiterEnd()}`;
59
+ const execRegex = new RegExp(regex, 'gi');
60
+ const matches = str.match(execRegex);
61
+ // const parsableMatches = matches.map((match) => ({ key: removeDelimiter(match), replaceWith: match }));
62
+ return matches ? this.extractRules(matches) : [];
63
+ }
64
+ extractRules(matches) {
65
+ return matches.map((match) => {
66
+ const alternativeText = this.getAlternativeText(match);
67
+ const modifiers = this.getModifiers(match);
68
+ return {
69
+ key: this.getKeyFromMatch(match),
70
+ replace: match,
71
+ modifiers,
72
+ alternativeText
73
+ };
74
+ });
75
+ }
76
+ getKeyFromMatch(match) {
77
+ const removeReservedSymbols = [':', '|'];
78
+ return this.removeDelimiter(removeReservedSymbols.reduce((val, sym) => val.indexOf(sym) > 0 ? this.removeAfter(val, sym) : val, match));
79
+ }
80
+ removeDelimiter(val) {
81
+ return val.replace(new RegExp(this.delimiterStart(), 'g'), '').replace(new RegExp(this.delimiterEnd(), 'g'), '');
82
+ }
83
+ removeAfter(str, val) {
84
+ return str.substring(0, str.indexOf(val));
85
+ }
86
+ extractAfter(str, val) {
87
+ return str.substring(str.indexOf(val) + 1);
88
+ }
89
+ getAlternativeText(str) {
90
+ if (str.indexOf(':') > 0) {
91
+ const altText = this.removeDelimiter(this.extractAfter(str, ':'));
92
+ if (altText.indexOf('|') > 0) {
93
+ return this.removeAfter(altText, '|');
94
+ }
95
+ return altText;
96
+ }
97
+ return '';
98
+ }
99
+ getModifiers(str) {
100
+ if (str.indexOf('|') > 0) {
101
+ const strModifiers = this.removeDelimiter(this.extractAfter(str, '|')).split(',');
102
+ return strModifiers.map(modifier => this.getModifier(modifier.toLowerCase()));
103
+ }
104
+ return [];
105
+ }
106
+ parse(str = '', data = {}) {
107
+ const rules = this.parseRules(str);
108
+ if (rules && rules.length > 0) {
109
+ return this.parseFromRules(str, data, rules);
110
+ }
111
+ return str;
112
+ }
113
+ parseFromRules(str, data, rules) {
114
+ return rules.reduce((reducedStr, rule) => this.applyRule(reducedStr, rule, data), str);
115
+ }
116
+ applyRule(str, rule, data = {}) {
117
+ const dataToReplace = this.applyData(rule.key, data);
118
+ if (dataToReplace) {
119
+ return str.replace(rule.replace, this.applyModifiers(rule.modifiers, dataToReplace, data));
120
+ }
121
+ else if (rule.alternativeText) {
122
+ return str.replace(rule.replace, this.applyModifiers(rule.modifiers, rule.alternativeText, data));
123
+ }
124
+ const defaultModifier = this.applyModifiers(rule.modifiers, rule.key, data);
125
+ if (defaultModifier === rule.key) {
126
+ return str.replace(rule.replace, '');
127
+ }
128
+ return str.replace(rule.replace, defaultModifier);
129
+ }
130
+ getFromAlias(key) {
131
+ return this.aliases.find(alias => alias.key.toLowerCase() === key.toLowerCase());
132
+ }
133
+ applyData(key, data) {
134
+ const [prop, ptr] = key.split('#');
135
+ const propData = _.get(data, prop);
136
+ if (ptr) {
137
+ return JsonPointer.get(propData, ptr);
138
+ }
139
+ return propData;
140
+ }
141
+ getModifier(key) {
142
+ return this.modifiers.find(modifier => modifier.key === key);
143
+ }
144
+ applyModifiers(modifiers, str, rawData) {
145
+ try {
146
+ const transformers = modifiers.map(modifier => modifier && modifier.transform);
147
+ return transformers.reduce((str, transform) => transform ? transform(str, rawData) : str, str);
148
+ }
149
+ catch (e) {
150
+ return str;
151
+ }
152
+ }
153
+ addAlias(key, ref) {
154
+ if (typeof ref === 'function') {
155
+ this.aliases.push({ key, ref: ref() });
156
+ }
157
+ else {
158
+ this.aliases.push({ key, ref });
159
+ }
160
+ return this;
161
+ }
162
+ removeAlias(key) {
163
+ this.aliases = this.aliases.filter(alias => alias.key !== key);
164
+ return this;
165
+ }
166
+ }
167
+
168
+ export { Interpolator };
@@ -0,0 +1,32 @@
1
+ export class Interpolator {
2
+ constructor(options?: {
3
+ delimiter: string[];
4
+ });
5
+ options: {
6
+ delimiter: string[];
7
+ };
8
+ modifiers: any[];
9
+ aliases: any[];
10
+ registerBuiltInModifiers(): Interpolator;
11
+ get delimiter(): string[];
12
+ delimiterStart(): string;
13
+ delimiterEnd(): string;
14
+ registerModifier(key: any, transform: any): Error | Interpolator;
15
+ parseRules(str: any): any;
16
+ extractRules(matches: any): any;
17
+ getKeyFromMatch(match: any): any;
18
+ removeDelimiter(val: any): any;
19
+ removeAfter(str: any, val: any): any;
20
+ extractAfter(str: any, val: any): any;
21
+ getAlternativeText(str: any): any;
22
+ getModifiers(str: any): any;
23
+ parse(str?: string, data?: {}): any;
24
+ parseFromRules(str: any, data: any, rules: any): any;
25
+ applyRule(str: any, rule: any, data?: {}): any;
26
+ getFromAlias(key: any): any;
27
+ applyData(key: any, data: any): any;
28
+ getModifier(key: any): any;
29
+ applyModifiers(modifiers: any, str: any, rawData: any): any;
30
+ addAlias(key: any, ref: any): Interpolator;
31
+ removeAlias(key: any): Interpolator;
32
+ }
@@ -0,0 +1,4 @@
1
+ export const defaultModifiers: {
2
+ key: string;
3
+ transform: (value: any) => any;
4
+ }[];
@@ -0,0 +1 @@
1
+ export function lowercase(value: any): any;
@@ -0,0 +1 @@
1
+ export function titlecase(value: any): any;
@@ -0,0 +1 @@
1
+ export function uppercase(value: any): any;
@@ -0,0 +1,33 @@
1
+ {
2
+ "name": "@graphql-mesh/string-interpolation",
3
+ "version": "0.0.0",
4
+ "description": "Dynamic string manipulation",
5
+ "sideEffects": false,
6
+ "dependencies": {
7
+ "json-ptr": "3.1.0",
8
+ "lodash": "^4.17.21"
9
+ },
10
+ "repository": {
11
+ "type": "git",
12
+ "url": "Urigo/graphql-mesh",
13
+ "directory": "packages/string-interpolation"
14
+ },
15
+ "author": "Arda TANRIKULU <ardatanrikulu@gmail.com>",
16
+ "main": "index.js",
17
+ "module": "index.mjs",
18
+ "typings": "index.d.ts",
19
+ "typescript": {
20
+ "definition": "index.d.ts"
21
+ },
22
+ "exports": {
23
+ ".": {
24
+ "require": "./index.js",
25
+ "import": "./index.mjs"
26
+ },
27
+ "./*": {
28
+ "require": "./*.js",
29
+ "import": "./*.mjs"
30
+ },
31
+ "./package.json": "./package.json"
32
+ }
33
+ }
@@ -0,0 +1,3 @@
1
+ export namespace defaultOptions {
2
+ const delimiter: string[];
3
+ }
package/package.json ADDED
@@ -0,0 +1,35 @@
1
+ {
2
+ "name": "@graphql-mesh/string-interpolation",
3
+ "version": "0.0.0",
4
+ "description": "Dynamic string manipulation",
5
+ "sideEffects": false,
6
+ "main": "dist/index.js",
7
+ "module": "dist/index.mjs",
8
+ "typings": "dist/index.d.ts",
9
+ "typescript": {
10
+ "definition": "dist/index.d.ts"
11
+ },
12
+ "exports": {
13
+ ".": {
14
+ "require": "./dist/index.js",
15
+ "import": "./dist/index.mjs"
16
+ },
17
+ "./*": {
18
+ "require": "./dist/*.js",
19
+ "import": "./dist/*.mjs"
20
+ }
21
+ },
22
+ "dependencies": {
23
+ "json-ptr": "3.1.0",
24
+ "lodash": "^4.17.21"
25
+ },
26
+ "author": "Arda TANRIKULU <ardatanrikulu@gmail.com>",
27
+ "repository": {
28
+ "type": "git",
29
+ "url": "Urigo/graphql-mesh",
30
+ "directory": "packages/string-interpolation"
31
+ },
32
+ "publishConfig": {
33
+ "access": "public"
34
+ }
35
+ }
package/src/index.ts ADDED
@@ -0,0 +1,3 @@
1
+ import { Interpolator } from './interpolator';
2
+
3
+ export { Interpolator };
@@ -0,0 +1,171 @@
1
+ import { defaultOptions } from './statics/DefaultOptions';
2
+ import _ from 'lodash';
3
+ import { defaultModifiers } from './modifiers';
4
+ import { JsonPointer } from 'json-ptr';
5
+
6
+ export class Interpolator {
7
+ constructor(options = defaultOptions) {
8
+ this.options = options;
9
+ this.modifiers = [];
10
+ this.aliases = [];
11
+ this.registerBuiltInModifiers();
12
+ }
13
+
14
+ registerBuiltInModifiers() {
15
+ defaultModifiers.forEach(modifier => this.registerModifier(modifier.key, modifier.transform));
16
+ return this;
17
+ }
18
+
19
+ get delimiter() {
20
+ return this.options.delimiter;
21
+ }
22
+
23
+ delimiterStart() {
24
+ return this.options.delimiter[0];
25
+ }
26
+
27
+ delimiterEnd() {
28
+ return this.options.delimiter[1];
29
+ }
30
+
31
+ registerModifier(key, transform) {
32
+ if (!key) {
33
+ return new Error('Modifiers must have a key');
34
+ }
35
+
36
+ if (typeof transform !== 'function') {
37
+ return new Error('Modifiers must have a transformer. Transformers must be a function that returns a value.');
38
+ }
39
+
40
+ this.modifiers.push({key: key.toLowerCase(), transform});
41
+ return this;
42
+ }
43
+
44
+ parseRules(str) {
45
+ const regex = `${this.delimiterStart()}([^}]+)${this.delimiterEnd()}`;
46
+ const execRegex = new RegExp(regex, 'gi');
47
+ const matches = str.match(execRegex);
48
+
49
+ // const parsableMatches = matches.map((match) => ({ key: removeDelimiter(match), replaceWith: match }));
50
+ return matches ? this.extractRules(matches) : [];
51
+ }
52
+
53
+ extractRules(matches) {
54
+ return matches.map((match) => {
55
+ const alternativeText = this.getAlternativeText(match);
56
+ const modifiers = this.getModifiers(match);
57
+ return {
58
+ key: this.getKeyFromMatch(match),
59
+ replace: match,
60
+ modifiers,
61
+ alternativeText
62
+ }
63
+ })
64
+ }
65
+
66
+ getKeyFromMatch(match) {
67
+ const removeReservedSymbols = [':', '|'];
68
+ return this.removeDelimiter(removeReservedSymbols.reduce((val, sym) => val.indexOf(sym) > 0 ? this.removeAfter(val, sym) : val, match));
69
+ }
70
+
71
+ removeDelimiter(val) {
72
+ return val.replace(new RegExp(this.delimiterStart(), 'g'), '').replace(new RegExp(this.delimiterEnd(), 'g'), '');
73
+ }
74
+
75
+ removeAfter(str, val) {
76
+ return str.substring(0, str.indexOf(val));
77
+ }
78
+
79
+ extractAfter(str, val) {
80
+ return str.substring(str.indexOf(val) + 1);
81
+ }
82
+
83
+ getAlternativeText(str) {
84
+ if (str.indexOf(':') > 0) {
85
+ const altText = this.removeDelimiter(this.extractAfter(str, ':'));
86
+ if (altText.indexOf('|') > 0) {
87
+ return this.removeAfter(altText, '|');
88
+ }
89
+ return altText;
90
+ }
91
+
92
+ return '';
93
+ }
94
+
95
+ getModifiers(str) {
96
+ if (str.indexOf('|') > 0) {
97
+ const strModifiers = this.removeDelimiter(this.extractAfter(str, '|')).split(',');
98
+ return strModifiers.map(modifier => this.getModifier(modifier.toLowerCase()));
99
+ }
100
+
101
+ return [];
102
+ }
103
+
104
+ parse(str = '', data = {}) {
105
+ const rules = this.parseRules(str);
106
+ if (rules && rules.length > 0) {
107
+ return this.parseFromRules(str, data, rules);
108
+ }
109
+
110
+ return str;
111
+ }
112
+
113
+ parseFromRules(str, data, rules) {
114
+ return rules.reduce((reducedStr, rule) => this.applyRule(reducedStr, rule, data), str);
115
+ }
116
+
117
+ applyRule(str, rule, data = {}) {
118
+ const dataToReplace = this.applyData(rule.key, data);
119
+ if (dataToReplace) {
120
+ return str.replace(rule.replace, this.applyModifiers(rule.modifiers, dataToReplace, data));
121
+ } else if (rule.alternativeText) {
122
+ return str.replace(rule.replace, this.applyModifiers(rule.modifiers, rule.alternativeText, data));
123
+ }
124
+
125
+ const defaultModifier = this.applyModifiers(rule.modifiers, rule.key, data);
126
+ if (defaultModifier === rule.key) {
127
+ return str.replace(rule.replace, '');
128
+ }
129
+ return str.replace(rule.replace, defaultModifier);
130
+ }
131
+
132
+ getFromAlias(key) {
133
+ return this.aliases.find(alias => alias.key.toLowerCase() === key.toLowerCase());
134
+ }
135
+
136
+ applyData(key, data) {
137
+ const [prop, ptr] = key.split('#');
138
+ const propData = _.get(data, prop);
139
+ if (ptr) {
140
+ return JsonPointer.get(propData, ptr);
141
+ }
142
+ return propData;
143
+ }
144
+
145
+ getModifier(key) {
146
+ return this.modifiers.find(modifier => modifier.key === key);
147
+ }
148
+
149
+ applyModifiers(modifiers, str, rawData) {
150
+ try {
151
+ const transformers = modifiers.map(modifier => modifier && modifier.transform);
152
+ return transformers.reduce((str, transform) => transform ? transform(str, rawData) : str, str);
153
+ } catch (e) {
154
+ return str;
155
+ }
156
+ }
157
+
158
+ addAlias(key, ref) {
159
+ if (typeof ref === 'function'){
160
+ this.aliases.push({key, ref: ref() });
161
+ } else {
162
+ this.aliases.push({ key, ref });
163
+ }
164
+ return this;
165
+ }
166
+
167
+ removeAlias(key) {
168
+ this.aliases = this.aliases.filter(alias => alias.key !== key);
169
+ return this;
170
+ }
171
+ }
@@ -0,0 +1,16 @@
1
+ import { uppercase } from './uppercase';
2
+ import { lowercase } from './lowercase';
3
+ import { titlecase } from './title';
4
+
5
+ export const defaultModifiers = [{
6
+ key: 'uppercase',
7
+ transform: uppercase,
8
+ },
9
+ {
10
+ key: 'lowercase',
11
+ transform: lowercase,
12
+ },
13
+ {
14
+ key: 'title',
15
+ transform: titlecase,
16
+ }];
@@ -0,0 +1 @@
1
+ export const lowercase = value => value.toLowerCase();
@@ -0,0 +1 @@
1
+ export const titlecase = value => value.replace(/\w\S*/g, s => s.charAt(0).toUpperCase() + s.substr(1).toLowerCase());
@@ -0,0 +1 @@
1
+ export const uppercase = value => value.toUpperCase();
@@ -0,0 +1,3 @@
1
+ export const defaultOptions = {
2
+ delimiter: ['{', '}'],
3
+ }