agent-claw: automated task changes

This commit is contained in:
daniel
2026-05-06 18:55:16 -05:00
parent 38905bb1e9
commit 732b00fb66
8494 changed files with 2018127 additions and 4 deletions

22
cdk/node_modules/aws-cdk-lib/node_modules/case/LICENSE generated vendored Normal file
View File

@@ -0,0 +1,22 @@
Copyright (c) 2013 Nathan Bubna
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.

View File

@@ -0,0 +1,139 @@
### Case: An extensible utility to convert, identify, and flip string case.
Download: [Case.min.js][min] or [Case.js][full]
[NPM][npm]: `npm install case` (little 'c' due to NPM restrictions)
[NuGet][]: `Install-Package Case`
[![Build Status](https://img.shields.io/travis/nbubna/Case.svg)](https://travis-ci.org/nbubna/Case)
[![NPM version](https://img.shields.io/npm/v/case.svg)][npm]
[![NPM](https://img.shields.io/npm/dm/case.svg)][npm]
[NuGet]: http://nuget.org/packages/Case/
[min]: https://raw.github.com/nbubna/Case/master/dist/Case.min.js
[full]: https://raw.github.com/nbubna/Case/master/dist/Case.js
[npm]: https://npmjs.org/package/case
## Documentation
Each of the following functions will first "undo" previous case manipulations
before applying the desired case to the given string.
### Foundations
```javascript
Case.upper('foo_bar') -> 'FOO BAR'
Case.lower('fooBar') -> 'foo bar'
Case.capital('foo_v_bar') -> 'Foo V Bar'
```
### Code Helpers
```javascript
Case.snake('Foo bar!') -> 'foo_bar'
Case.pascal('foo.bar') -> 'FooBar'
Case.camel('foo, bar') -> 'fooBar'
Case.kebab('Foo? Bar.') -> 'foo-bar'
Case.header('fooBar=') -> 'Foo-Bar'
Case.constant('Foo-Bar') -> 'FOO_BAR'
```
### UI Helpers
```javascript
Case.title('foo v. bar') -> 'Foo v. Bar'
Case.sentence('"foo!" said bar', ['Bar']) -> '"Foo!" said Bar'
Case.sentence('the 12 oz. can', null, ['oz']) -> 'The 12 oz. can'
```
`Case.sentence(str, names, abbreviations)` accepts an array of proper names that should be capitalized,
regardless of location in the sentence. This function is specialized, but useful
when dealing with input generated with capslock on (i.e. everything my grandma types).
It can also accept a list of abbreviations (words that may end in a period but aren't meant
to end a sentence).
### Custom Casing
```javascript
Case.lower('FOO-BAR', '.') -> 'foo.bar'
Case.upper('Foo? Bar.', '__') -> 'FOO__BAR'
Case.capital('fooBar', ' + ') -> 'Foo + Bar'
Case.lower("Don't keep 'em!", "/", true) -> 'dont/keep/em'
Case.capital("'ello, world.", null, true) -> 'Ello, World.'
```
`Case.upper`, `Case.lower`, and `Case.capital` accept an optional "fill" value
that will replace any characters which are not letters and numbers. All three also accept
a third optional boolean argument indicating if apostrophes are to be stripped out or left in.
For example, programmatic case changes (snake, kebab, pascal, camel, constant) are best without
apostrophes, but user-facing ones (title, sentence) do not want "don't" turned into "Dont".
### Extending Case
```javascript
Case.type('bang', function(s) {
return Case.upper(s, '!')+'!';
});
Case.bang('bang') -> 'BANG!'
Case.of('TEST!THIS!') -> 'bang'
```
`Case.type(name, fn)`: extends Case, creating a new function on `Case` and adding `Case.of` support automatically.
### Utilities
```javascript
Case.of('foo') -> 'lower'
Case.of('foo_bar') -> 'snake'
Case.of('Foo v Bar') -> 'title'
Case.of('foo_ Bar') -> undefined
Case.of('Hello there, Bob!', ['Bob']) -> 'sentence'
Case.flip('FlipMe') -> 'fLIPmE'
Case.flip('TEST THIS!') -> 'test this!'
Case.random('Hello!') -> 'hElLO!'
```
* `Case.of(str[, names])`: identifies the case of a string, returns undefined if it doesn't match a known type
* `Case.flip(str)`: reverses the case of letters, no other changes
* `Case.random(str)`: randomizes the case of letters, no other changes
## Release History
* 2013-06-10 [v1.0.0][] (public, initial)
* 2013-06-20 [v1.0.1][] (regex improvements)
* 2013-08-23 [v1.0.3][] (better support for Node, Component and AMD)
* 2014-10-24 [v1.1.2][] (regexps used are now extensible and support more latin diacritics)
* 2015-01-27 [v1.2.0][] (deprecate squish in favor of pascal)
* 2015-01-28 [v1.2.1][] (fix UMD regression)
* 2015-10-27 [v1.3.0][] (Case.kebab and Case.random)
* 2015-12-02 [v1.3.2][] (fix title case when small word is first or last)
* 2016-02-01 [v1.3.3][] (Case.of('foo') to return lower, not snake)
* 2016-02-07 [v1.4.0][] (fix apostrophe handling)
* 2016-02-08 [v1.4.1][] (fix swallowed prefix/suffix on lone words)
* 2016-11-11 [v1.4.2][] (add typings for TypeScript support)
* 2017-03-09 [v1.5.2][] (add Header-Case and expose noApostrophes option for upper/lower/capital fns)
* 2017-07-11 [v1.5.3][] (Case.of and to[Type]Case functions should accept extra arguments, like the rest)
* 2017-10-23 [v1.5.4][] (Shift order of Case.of tests to prioritize 'capital' over 'header')
* 2018-05-04 [v1.5.5][] (Fix issue #26, corner case of bad "decamelizing" of string w/number after caps)
* 2018-11-15 [v1.6.0][] (PR #29, support 'abbreviations' argument for Case.sentence to avoid incorrect sentence ends)
* 2019-01-11 [v1.6.1][] (PR #30, update typings to include 'abbreviations' argument for Case.sentence)
* 2019-07-26 [v1.6.2][] (PR #31, allow importing as default)
* 2020-03-24 [v1.6.3][] (PR #33, update license structure in package.json for automated checkers)
[v1.0.0]: https://github.com/nbubna/store/tree/1.0.0
[v1.0.1]: https://github.com/nbubna/store/tree/1.0.1
[v1.0.3]: https://github.com/nbubna/store/tree/1.0.3
[v1.1.2]: https://github.com/nbubna/store/tree/1.1.2
[v1.2.0]: https://github.com/nbubna/store/tree/1.2.0
[v1.2.1]: https://github.com/nbubna/store/tree/1.2.1
[v1.3.0]: https://github.com/nbubna/store/tree/1.3.0
[v1.3.2]: https://github.com/nbubna/store/tree/1.3.2
[v1.3.3]: https://github.com/nbubna/store/tree/1.3.3
[v1.4.0]: https://github.com/nbubna/store/tree/1.4.0
[v1.4.1]: https://github.com/nbubna/store/tree/1.4.1
[v1.4.2]: https://github.com/nbubna/store/tree/1.4.2
[v1.5.2]: https://github.com/nbubna/store/tree/1.5.2
[v1.5.3]: https://github.com/nbubna/store/tree/1.5.3
[v1.5.4]: https://github.com/nbubna/store/tree/1.5.4
[v1.5.5]: https://github.com/nbubna/store/tree/1.5.5
[v1.6.0]: https://github.com/nbubna/store/tree/1.6.0
[v1.6.1]: https://github.com/nbubna/store/tree/1.6.1
[v1.6.2]: https://github.com/nbubna/store/tree/1.6.2
[v1.6.3]: https://github.com/nbubna/store/tree/1.6.3

View File

@@ -0,0 +1,43 @@
declare module 'case' {
namespace Case {
function upper(str: string, fill: string, noApostrophes: boolean) : string;
function upper(str: string, fill: string) : string;
function upper(str: string) : string;
function lower(str: string, fill: string, noApostrophes: boolean) : string;
function lower(str: string, fill: string) : string;
function lower(str: string) : string;
function capital(str: string, fill: string, noApostrophes: boolean) : string;
function capital(str: string, fill: string) : string;
function capital(str: string) : string;
function snake(str: string) : string;
function pascal(str: string) : string;
function camel(str: string) : string;
function kebab(str: string) : string;
function header(str: string) : string;
function constant(str: string) : string;
function title(str: string) : string;
function sentence(str: string, names?: Array<string> | null, abbreviations?: Array<string>) : string;
function of(str: string) : string;
function of(str: string, names: Array<string>) : string;
function flip(str: string) : string
function random(str: string) : string;
function type(type: string, converter: (str: string) => string) : string;
}
export = Case;
}

View File

@@ -0,0 +1,171 @@
/*! Case - v1.6.2 - 2020-03-24
* Copyright (c) 2020 Nathan Bubna; Licensed MIT, GPL */
(function() {
"use strict";
var unicodes = function(s, prefix) {
prefix = prefix || '';
return s.replace(/(^|-)/g, '$1\\u'+prefix).replace(/,/g, '\\u'+prefix);
},
basicSymbols = unicodes('20-26,28-2F,3A-40,5B-60,7B-7E,A0-BF,D7,F7', '00'),
baseLowerCase = 'a-z'+unicodes('DF-F6,F8-FF', '00'),
baseUpperCase = 'A-Z'+unicodes('C0-D6,D8-DE', '00'),
improperInTitle = 'A|An|And|As|At|But|By|En|For|If|In|Of|On|Or|The|To|Vs?\\.?|Via',
regexps = function(symbols, lowers, uppers, impropers) {
symbols = symbols || basicSymbols;
lowers = lowers || baseLowerCase;
uppers = uppers || baseUpperCase;
impropers = impropers || improperInTitle;
return {
capitalize: new RegExp('(^|['+symbols+'])(['+lowers+'])', 'g'),
pascal: new RegExp('(^|['+symbols+'])+(['+lowers+uppers+'])', 'g'),
fill: new RegExp('['+symbols+']+(.|$)','g'),
sentence: new RegExp('(^\\s*|[\\?\\!\\.]+"?\\s+"?|,\\s+")(['+lowers+'])', 'g'),
improper: new RegExp('\\b('+impropers+')\\b', 'g'),
relax: new RegExp('([^'+uppers+'])(['+uppers+']*)(['+uppers+'])(?=[^'+uppers+']|$)', 'g'),
upper: new RegExp('^[^'+lowers+']+$'),
hole: /[^\s]\s[^\s]/,
apostrophe: /'/g,
room: new RegExp('['+symbols+']')
};
},
re = regexps(),
_ = {
re: re,
unicodes: unicodes,
regexps: regexps,
types: [],
up: String.prototype.toUpperCase,
low: String.prototype.toLowerCase,
cap: function(s) {
return _.up.call(s.charAt(0))+s.slice(1);
},
decap: function(s) {
return _.low.call(s.charAt(0))+s.slice(1);
},
deapostrophe: function(s) {
return s.replace(re.apostrophe, '');
},
fill: function(s, fill, deapostrophe) {
if (fill != null) {
s = s.replace(re.fill, function(m, next) {
return next ? fill + next : '';
});
}
if (deapostrophe) {
s = _.deapostrophe(s);
}
return s;
},
prep: function(s, fill, pascal, upper) {
s = s == null ? '' : s + '';// force to string
if (!upper && re.upper.test(s)) {
s = _.low.call(s);
}
if (!fill && !re.hole.test(s)) {
var holey = _.fill(s, ' ');
if (re.hole.test(holey)) {
s = holey;
}
}
if (!pascal && !re.room.test(s)) {
s = s.replace(re.relax, _.relax);
}
return s;
},
relax: function(m, before, acronym, caps) {
return before + ' ' + (acronym ? acronym+' ' : '') + caps;
}
},
Case = {
_: _,
of: function(s) {
for (var i=0,m=_.types.length; i<m; i++) {
if (Case[_.types[i]].apply(Case, arguments) === s){ return _.types[i]; }
}
},
flip: function(s) {
return s.replace(/\w/g, function(l) {
return (l == _.up.call(l) ? _.low : _.up).call(l);
});
},
random: function(s) {
return s.replace(/\w/g, function(l) {
return (Math.round(Math.random()) ? _.up : _.low).call(l);
});
},
type: function(type, fn) {
Case[type] = fn;
_.types.push(type);
}
},
types = {
lower: function(s, fill, deapostrophe) {
return _.fill(_.low.call(_.prep(s, fill)), fill, deapostrophe);
},
snake: function(s) {
return Case.lower(s, '_', true);
},
constant: function(s) {
return Case.upper(s, '_', true);
},
camel: function(s) {
return _.decap(Case.pascal(s));
},
kebab: function(s) {
return Case.lower(s, '-', true);
},
upper: function(s, fill, deapostrophe) {
return _.fill(_.up.call(_.prep(s, fill, false, true)), fill, deapostrophe);
},
capital: function(s, fill, deapostrophe) {
return _.fill(_.prep(s).replace(re.capitalize, function(m, border, letter) {
return border+_.up.call(letter);
}), fill, deapostrophe);
},
header: function(s) {
return Case.capital(s, '-', true);
},
pascal: function(s) {
return _.fill(_.prep(s, false, true).replace(re.pascal, function(m, border, letter) {
return _.up.call(letter);
}), '', true);
},
title: function(s) {
return Case.capital(s).replace(re.improper, function(small, p, i, s) {
return i > 0 && i < s.lastIndexOf(' ') ? _.low.call(small) : small;
});
},
sentence: function(s, names, abbreviations) {
s = Case.lower(s).replace(re.sentence, function(m, prelude, letter) {
return prelude + _.up.call(letter);
});
if (names) {
names.forEach(function(name) {
s = s.replace(new RegExp('\\b'+Case.lower(name)+'\\b', "g"), _.cap);
});
}
if (abbreviations) {
abbreviations.forEach(function(abbr) {
s = s.replace(new RegExp('(\\b'+Case.lower(abbr)+'\\. +)(\\w)'), function(m, abbrAndSpace, letter) {
return abbrAndSpace + _.low.call(letter);
});
});
}
return s;
}
};
// TODO: Remove "squish" in a future breaking release.
types.squish = types.pascal;
// Allow import default
Case.default = Case;
for (var type in types) {
Case.type(type, types[type]);
}
// export Case (AMD, commonjs, or global)
var define = typeof define === "function" ? define : function(){};
define(typeof module === "object" && module.exports ? module.exports = Case : this.Case = Case);
}).call(this);

View File

@@ -0,0 +1,5 @@
/*! Case - v1.6.2 - 2020-03-24
* Copyright (c) 2020 Nathan Bubna; Licensed MIT, GPL */
(function(){"use strict";function e(e,n){return n=n||"",e.replace(/(^|-)/g,"$1\\u"+n).replace(/,/g,"\\u"+n)}function n(e,n,r,t){return e=e||l,n=n||p,r=r||o,t=t||"A|An|And|As|At|But|By|En|For|If|In|Of|On|Or|The|To|Vs?\\.?|Via",{capitalize:new RegExp("(^|["+e+"])(["+n+"])","g"),pascal:new RegExp("(^|["+e+"])+(["+n+r+"])","g"),fill:new RegExp("["+e+"]+(.|$)","g"),sentence:new RegExp('(^\\s*|[\\?\\!\\.]+"?\\s+"?|,\\s+")(['+n+"])","g"),improper:new RegExp("\\b("+t+")\\b","g"),relax:new RegExp("([^"+r+"])(["+r+"]*)(["+r+"])(?=[^"+r+"]|$)","g"),upper:new RegExp("^[^"+n+"]+$"),hole:/[^\s]\s[^\s]/,apostrophe:/'/g,room:new RegExp("["+e+"]")}}var l=e("20-26,28-2F,3A-40,5B-60,7B-7E,A0-BF,D7,F7","00"),p="a-z"+e("DF-F6,F8-FF","00"),o="A-Z"+e("C0-D6,D8-DE","00"),u=n(),c={re:u,unicodes:e,regexps:n,types:[],up:String.prototype.toUpperCase,low:String.prototype.toLowerCase,cap:function(e){return c.up.call(e.charAt(0))+e.slice(1)},decap:function(e){return c.low.call(e.charAt(0))+e.slice(1)},deapostrophe:function(e){return e.replace(u.apostrophe,"")},fill:function(e,r,n){return null!=r&&(e=e.replace(u.fill,function(e,n){return n?r+n:""})),n&&(e=c.deapostrophe(e)),e},prep:function(e,n,r,t){if(e=null==e?"":e+"",!t&&u.upper.test(e)&&(e=c.low.call(e)),!n&&!u.hole.test(e)){var l=c.fill(e," ");u.hole.test(l)&&(e=l)}return r||u.room.test(e)||(e=e.replace(u.relax,c.relax)),e},relax:function(e,n,r,t){return n+" "+(r?r+" ":"")+t}},t={_:c,of:function(e){for(var n=0,r=c.types.length;n<r;n++)if(t[c.types[n]].apply(t,arguments)===e)return c.types[n]},flip:function(e){return e.replace(/\w/g,function(e){return(e==c.up.call(e)?c.low:c.up).call(e)})},random:function(e){return e.replace(/\w/g,function(e){return(Math.round(Math.random())?c.up:c.low).call(e)})},type:function(e,n){t[e]=n,c.types.push(e)}},r={lower:function(e,n,r){return c.fill(c.low.call(c.prep(e,n)),n,r)},snake:function(e){return t.lower(e,"_",!0)},constant:function(e){return t.upper(e,"_",!0)},camel:function(e){return c.decap(t.pascal(e))},kebab:function(e){return t.lower(e,"-",!0)},upper:function(e,n,r){return c.fill(c.up.call(c.prep(e,n,!1,!0)),n,r)},capital:function(e,n,r){return c.fill(c.prep(e).replace(u.capitalize,function(e,n,r){return n+c.up.call(r)}),n,r)},header:function(e){return t.capital(e,"-",!0)},pascal:function(e){return c.fill(c.prep(e,!1,!0).replace(u.pascal,function(e,n,r){return c.up.call(r)}),"",!0)},title:function(e){return t.capital(e).replace(u.improper,function(e,n,r,t){return 0<r&&r<t.lastIndexOf(" ")?c.low.call(e):e})},sentence:function(n,e,r){return n=t.lower(n).replace(u.sentence,function(e,n,r){return n+c.up.call(r)}),e&&e.forEach(function(e){n=n.replace(new RegExp("\\b"+t.lower(e)+"\\b","g"),c.cap)}),r&&r.forEach(function(e){n=n.replace(new RegExp("(\\b"+t.lower(e)+"\\. +)(\\w)"),function(e,n,r){return n+c.low.call(r)})}),n}};for(var a in r.squish=r.pascal,t.default=t,r)t.type(a,r[a]);var i="function"==typeof i?i:function(){};i("object"==typeof module&&module.exports?module.exports=t:this.Case=t)}).call(this);
//# sourceMappingURL=Case.min.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["Case.js"],"names":["unicodes","s","prefix","replace","regexps","symbols","lowers","uppers","impropers","basicSymbols","baseLowerCase","baseUpperCase","capitalize","RegExp","pascal","fill","sentence","improper","relax","upper","hole","apostrophe","room","re","_","types","up","String","prototype","toUpperCase","low","toLowerCase","cap","call","charAt","slice","decap","deapostrophe","m","next","prep","test","holey","before","acronym","caps","Case","of","i","length","apply","arguments","flip","l","random","Math","round","type","fn","push","lower","snake","constant","camel","kebab","capital","border","letter","header","title","small","p","lastIndexOf","names","abbreviations","prelude","forEach","name","abbr","abbrAndSpace","squish","default","define","module","exports","this"],"mappings":";;;CAEA,WACI,aACe,SAAXA,EAAoBC,EAAGC,GAEvB,OADAA,EAASA,GAAU,GACZD,EAAEE,QAAQ,SAAU,QAAQD,GAAQC,QAAQ,KAAM,MAAMD,GAMzD,SAAVE,EAAmBC,EAASC,EAAQC,EAAQC,GAKxC,OAJAH,EAAUA,GAAWI,EACrBH,EAASA,GAAUI,EACnBH,EAASA,GAAUI,EACnBH,EAAYA,GALE,iEAMP,CACHI,WAAY,IAAIC,OAAO,OAAOR,EAAQ,OAAOC,EAAO,KAAM,KAC1DQ,OAAQ,IAAID,OAAO,OAAOR,EAAQ,QAAQC,EAAOC,EAAO,KAAM,KAC9DQ,KAAM,IAAIF,OAAO,IAAIR,EAAQ,UAAU,KACvCW,SAAU,IAAIH,OAAO,wCAAwCP,EAAO,KAAM,KAC1EW,SAAU,IAAIJ,OAAO,OAAOL,EAAU,OAAQ,KAC9CU,MAAO,IAAIL,OAAO,MAAMN,EAAO,OAAOA,EAAO,QAAQA,EAAO,UAAUA,EAAO,OAAQ,KACrFY,MAAO,IAAIN,OAAO,MAAMP,EAAO,OAC/Bc,KAAM,eACNC,WAAY,KACZC,KAAM,IAAIT,OAAO,IAAIR,EAAQ,MAvBrC,I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AAOC,QAAUtC,EAAOuC,KAAKvC,KAAOA,KAE3Fb,KAAKoD","file":"Case.min.js"}

View File

@@ -0,0 +1,189 @@
/*! Case - v1.6.2 - 2020-03-24
* Copyright (c) 2020 Nathan Bubna; Licensed MIT, GPL */
(function() {
"use strict";
var unicodes = function(s, prefix) {
prefix = prefix || '';
return s.replace(/(^|-)/g, '$1\\u'+prefix).replace(/,/g, '\\u'+prefix);
},
basicSymbols = unicodes('20-26,28-2F,3A-40,5B-60,7B-7E,A0-BF,D7,F7', '00'),
baseLowerCase = 'a-z'+unicodes('DF-F6,F8-FF', '00'),
baseUpperCase = 'A-Z'+unicodes('C0-D6,D8-DE', '00'),
improperInTitle = 'A|An|And|As|At|But|By|En|For|If|In|Of|On|Or|The|To|Vs?\\.?|Via',
regexps = function(symbols, lowers, uppers, impropers) {
symbols = symbols || basicSymbols;
lowers = lowers || baseLowerCase;
uppers = uppers || baseUpperCase;
impropers = impropers || improperInTitle;
return {
capitalize: new RegExp('(^|['+symbols+'])(['+lowers+'])', 'g'),
pascal: new RegExp('(^|['+symbols+'])+(['+lowers+uppers+'])', 'g'),
fill: new RegExp('['+symbols+']+(.|$)','g'),
sentence: new RegExp('(^\\s*|[\\?\\!\\.]+"?\\s+"?|,\\s+")(['+lowers+'])', 'g'),
improper: new RegExp('\\b('+impropers+')\\b', 'g'),
relax: new RegExp('([^'+uppers+'])(['+uppers+']*)(['+uppers+'])(?=[^'+uppers+']|$)', 'g'),
upper: new RegExp('^[^'+lowers+']+$'),
hole: /[^\s]\s[^\s]/,
apostrophe: /'/g,
room: new RegExp('['+symbols+']')
};
},
re = regexps(),
_ = {
re: re,
unicodes: unicodes,
regexps: regexps,
types: [],
up: String.prototype.toUpperCase,
low: String.prototype.toLowerCase,
cap: function(s) {
return _.up.call(s.charAt(0))+s.slice(1);
},
decap: function(s) {
return _.low.call(s.charAt(0))+s.slice(1);
},
deapostrophe: function(s) {
return s.replace(re.apostrophe, '');
},
fill: function(s, fill, deapostrophe) {
if (fill != null) {
s = s.replace(re.fill, function(m, next) {
return next ? fill + next : '';
});
}
if (deapostrophe) {
s = _.deapostrophe(s);
}
return s;
},
prep: function(s, fill, pascal, upper) {
s = s == null ? '' : s + '';// force to string
if (!upper && re.upper.test(s)) {
s = _.low.call(s);
}
if (!fill && !re.hole.test(s)) {
var holey = _.fill(s, ' ');
if (re.hole.test(holey)) {
s = holey;
}
}
if (!pascal && !re.room.test(s)) {
s = s.replace(re.relax, _.relax);
}
return s;
},
relax: function(m, before, acronym, caps) {
return before + ' ' + (acronym ? acronym+' ' : '') + caps;
}
},
Case = {
_: _,
of: function(s) {
for (var i=0,m=_.types.length; i<m; i++) {
if (Case[_.types[i]].apply(Case, arguments) === s){ return _.types[i]; }
}
},
flip: function(s) {
return s.replace(/\w/g, function(l) {
return (l == _.up.call(l) ? _.low : _.up).call(l);
});
},
random: function(s) {
return s.replace(/\w/g, function(l) {
return (Math.round(Math.random()) ? _.up : _.low).call(l);
});
},
type: function(type, fn) {
Case[type] = fn;
_.types.push(type);
}
},
types = {
lower: function(s, fill, deapostrophe) {
return _.fill(_.low.call(_.prep(s, fill)), fill, deapostrophe);
},
snake: function(s) {
return Case.lower(s, '_', true);
},
constant: function(s) {
return Case.upper(s, '_', true);
},
camel: function(s) {
return _.decap(Case.pascal(s));
},
kebab: function(s) {
return Case.lower(s, '-', true);
},
upper: function(s, fill, deapostrophe) {
return _.fill(_.up.call(_.prep(s, fill, false, true)), fill, deapostrophe);
},
capital: function(s, fill, deapostrophe) {
return _.fill(_.prep(s).replace(re.capitalize, function(m, border, letter) {
return border+_.up.call(letter);
}), fill, deapostrophe);
},
header: function(s) {
return Case.capital(s, '-', true);
},
pascal: function(s) {
return _.fill(_.prep(s, false, true).replace(re.pascal, function(m, border, letter) {
return _.up.call(letter);
}), '', true);
},
title: function(s) {
return Case.capital(s).replace(re.improper, function(small, p, i, s) {
return i > 0 && i < s.lastIndexOf(' ') ? _.low.call(small) : small;
});
},
sentence: function(s, names, abbreviations) {
s = Case.lower(s).replace(re.sentence, function(m, prelude, letter) {
return prelude + _.up.call(letter);
});
if (names) {
names.forEach(function(name) {
s = s.replace(new RegExp('\\b'+Case.lower(name)+'\\b', "g"), _.cap);
});
}
if (abbreviations) {
abbreviations.forEach(function(abbr) {
s = s.replace(new RegExp('(\\b'+Case.lower(abbr)+'\\. +)(\\w)'), function(m, abbrAndSpace, letter) {
return abbrAndSpace + _.low.call(letter);
});
});
}
return s;
}
};
// TODO: Remove "squish" in a future breaking release.
types.squish = types.pascal;
// Allow import default
Case.default = Case;
for (var type in types) {
Case.type(type, types[type]);
}
// export Case (AMD, commonjs, or global)
var define = typeof define === "function" ? define : function(){};
define(typeof module === "object" && module.exports ? module.exports = Case : this.Case = Case);
}).call(this);
(function(Case, _) {
function create(type) {
var fn = 'to'+_.cap(type)+'Case';
String.prototype[fn] = function() {
Array.prototype.unshift.call(arguments, this);
return Case[type].apply(Case, arguments);
};
}
for (var i=0,m=_.types.length; i<m; i++) {
create(_.types[i]);
}
var _type = Case.type;
Case.type = function(type, fn) {
_type(type, fn);
create(type);
};
})(Case, Case._);

View File

@@ -0,0 +1,5 @@
/*! Case - v1.6.2 - 2020-03-24
* Copyright (c) 2020 Nathan Bubna; Licensed MIT, GPL */
(function(){"use strict";function e(e,n){return n=n||"",e.replace(/(^|-)/g,"$1\\u"+n).replace(/,/g,"\\u"+n)}function n(e,n,r,t){return e=e||p,n=n||l,r=r||o,t=t||"A|An|And|As|At|But|By|En|For|If|In|Of|On|Or|The|To|Vs?\\.?|Via",{capitalize:new RegExp("(^|["+e+"])(["+n+"])","g"),pascal:new RegExp("(^|["+e+"])+(["+n+r+"])","g"),fill:new RegExp("["+e+"]+(.|$)","g"),sentence:new RegExp('(^\\s*|[\\?\\!\\.]+"?\\s+"?|,\\s+")(['+n+"])","g"),improper:new RegExp("\\b("+t+")\\b","g"),relax:new RegExp("([^"+r+"])(["+r+"]*)(["+r+"])(?=[^"+r+"]|$)","g"),upper:new RegExp("^[^"+n+"]+$"),hole:/[^\s]\s[^\s]/,apostrophe:/'/g,room:new RegExp("["+e+"]")}}var p=e("20-26,28-2F,3A-40,5B-60,7B-7E,A0-BF,D7,F7","00"),l="a-z"+e("DF-F6,F8-FF","00"),o="A-Z"+e("C0-D6,D8-DE","00"),u=n(),c={re:u,unicodes:e,regexps:n,types:[],up:String.prototype.toUpperCase,low:String.prototype.toLowerCase,cap:function(e){return c.up.call(e.charAt(0))+e.slice(1)},decap:function(e){return c.low.call(e.charAt(0))+e.slice(1)},deapostrophe:function(e){return e.replace(u.apostrophe,"")},fill:function(e,r,n){return null!=r&&(e=e.replace(u.fill,function(e,n){return n?r+n:""})),n&&(e=c.deapostrophe(e)),e},prep:function(e,n,r,t){if(e=null==e?"":e+"",!t&&u.upper.test(e)&&(e=c.low.call(e)),!n&&!u.hole.test(e)){var p=c.fill(e," ");u.hole.test(p)&&(e=p)}return r||u.room.test(e)||(e=e.replace(u.relax,c.relax)),e},relax:function(e,n,r,t){return n+" "+(r?r+" ":"")+t}},t={_:c,of:function(e){for(var n=0,r=c.types.length;n<r;n++)if(t[c.types[n]].apply(t,arguments)===e)return c.types[n]},flip:function(e){return e.replace(/\w/g,function(e){return(e==c.up.call(e)?c.low:c.up).call(e)})},random:function(e){return e.replace(/\w/g,function(e){return(Math.round(Math.random())?c.up:c.low).call(e)})},type:function(e,n){t[e]=n,c.types.push(e)}},r={lower:function(e,n,r){return c.fill(c.low.call(c.prep(e,n)),n,r)},snake:function(e){return t.lower(e,"_",!0)},constant:function(e){return t.upper(e,"_",!0)},camel:function(e){return c.decap(t.pascal(e))},kebab:function(e){return t.lower(e,"-",!0)},upper:function(e,n,r){return c.fill(c.up.call(c.prep(e,n,!1,!0)),n,r)},capital:function(e,n,r){return c.fill(c.prep(e).replace(u.capitalize,function(e,n,r){return n+c.up.call(r)}),n,r)},header:function(e){return t.capital(e,"-",!0)},pascal:function(e){return c.fill(c.prep(e,!1,!0).replace(u.pascal,function(e,n,r){return c.up.call(r)}),"",!0)},title:function(e){return t.capital(e).replace(u.improper,function(e,n,r,t){return 0<r&&r<t.lastIndexOf(" ")?c.low.call(e):e})},sentence:function(n,e,r){return n=t.lower(n).replace(u.sentence,function(e,n,r){return n+c.up.call(r)}),e&&e.forEach(function(e){n=n.replace(new RegExp("\\b"+t.lower(e)+"\\b","g"),c.cap)}),r&&r.forEach(function(e){n=n.replace(new RegExp("(\\b"+t.lower(e)+"\\. +)(\\w)"),function(e,n,r){return n+c.low.call(r)})}),n}};for(var a in r.squish=r.pascal,t.default=t,r)t.type(a,r[a]);var i="function"==typeof i?i:function(){};i("object"==typeof module&&module.exports?module.exports=t:this.Case=t)}).call(this),function(r,t){function p(e){var n="to"+t.cap(e)+"Case";String.prototype[n]=function(){return Array.prototype.unshift.call(arguments,this),r[e].apply(r,arguments)}}for(var e=0,n=t.types.length;e<n;e++)p(t.types[e]);var l=r.type;r.type=function(e,n){l(e,n),p(e)}}(Case,Case._);
//# sourceMappingURL=Case.plus.min.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,58 @@
{
"name": "case",
"description": "Extensible string utility for converting, identifying and flipping string case",
"keywords": [
"string",
"case",
"camel",
"title",
"upper",
"lower",
"snake",
"squish",
"pascal",
"constant",
"flip",
"capitalization",
"converter"
],
"version": "1.6.3",
"author": {
"name": "Nathan Bubna",
"email": "nathan@esha.com",
"url": "http://www.esha.com/"
},
"engines": {
"node": ">= 0.8.0"
},
"files": [
"dist",
"case.d.ts"
],
"main": "dist/Case.js",
"bugs": {
"url": "http://github.com/nbubna/Case/issues",
"email": "nathan@esharesearch.com"
},
"repository": {
"type": "git",
"url": "http://github.com/nbubna/Case.git"
},
"license": "(MIT OR GPL-3.0-or-later)",
"scripts": {
"test": "grunt qunit"
},
"devDependencies": {
"grunt": "^1.0.4",
"grunt-cli": "^1.3.2",
"grunt-component-build": "^0.5.3",
"grunt-contrib-clean": "^2.0.0",
"grunt-contrib-concat": "^1.0.1",
"grunt-contrib-jshint": "^2.1.0",
"grunt-contrib-qunit": "^3.1.0",
"grunt-contrib-uglify": "^4.0.1",
"grunt-contrib-watch": "^1.1.0",
"grunt-nuget": "~0.3.1"
},
"typings": "case.d.ts"
}