UNPKG

@stdlib/esm

Version:

ES module distribution for Stdlib, a standard library for JavaScript and Node.js.

3 lines 3.97 kB
// This file is a part of stdlib. License is Apache-2.0: http://www.apache.org/licenses/LICENSE-2.0 import e from"./../utils/keys.js";import t from"./../assert/is-capitalized.js";import h from"./../string/uncapitalize.js";import l from"./../string/capitalize.js";import o from"./tokenize.js";import a from"./../assert/is-string.js";var w="are not",i="can not",n="can not",v="could have",d="could not",s="could not have",u="did not",r="does not",y="do not",m="had not",c="has not",g="have not",f="he would",p="he would have",j="he is",k="how did",z="how will",b="how is",x="i am",E="is not",I="it will",M="let us",P="that is",S="will not",T={"'s":"is","'S":"Is","aren't":"are not",arent:w,"can't":"can not",cant:i,"can't've":"can not have","'cause":"because",cannot:n,"could've":"could have",couldve:v,"couldn't":"could not",couldnt:d,"couldn't've":"could not have",couldntve:s,"didn't":"did not",didnt:u,"doesn't":"does not",doesnt:r,"don't":"do not",dont:y,"hadn't":"had not",hadnt:m,"hadn't've":"had not have","hasn't":"has not",hasnt:c,"haven't":"have not",havent:g,"he'd":"he would",hed:f,"he'd've":"he would have",hedve:p,"he'll":"he will","he'll've":"he will have","he's":"he is",hes:j,"how'd":"how did",howd:k,"how'd'y":"how did you","how'll":"how will",howll:z,"how's":"how is",hows:b,"i'd":"i would","i'd've":"i would have","i'll":"i will","i'll've":"i will have","i'm":"i am",im:x,"i'ma":"i am going to","i've":"i have","isn't":"is not",isnt:E,"it'd":"it would","it'd've":"it would have","it'll've":"it will have","it'll":"it will",itll:I,"it's":"it is","let's":"let us",lets:M,"ma'am":"madam","mayn't":"may not","mightn't":"it might not","mightn't've":"might not have","might've":"might have","mustn't":"must not","mustn't've":"must not have","must've":"must have","needn't":"need not","needn't've":"need not have","not've":"not have","oughtn't":"ought not","oughtn't've":"ought not to have","so've":"so have","so's":"so is","shan't":"shall not","sha'n't":"shall not","shan't've":"shall not have","she'd":"she would","she'd've":"she would have","she'll":"she will","she'll've":"she will have","she's":"she is","should've":"should have","shouldn't":"should not","shouldn't've":"should not have","that'd":"that would","that'd've":"that would have","that's":"that is",thats:P,"there'd":"there would","there'd've":"there would have","there's":"there is","they'd":"they would","they'd've":"they would have","they'll":"they will","they'll've":"they will have","they're":"they are","they've":"they have","to've":"to have","wasn't":"was not","we'd":"we would","we'd've":"we would have","we'll":"we will","we'll've":"we will have","we're":"we are","we've":"we have","weren't":"were not","what'll":"what will","what'll've":"what will have","what're":"what are","what's":"what has/is","what've":"what have","when's":"when is","when've":"when have","where'd":"where would","where's":"where is","where've":"where have","who'd":"who would","who'll":"who will","who'll've":"who will have","who're":"who are","who's":"who is","who've":"who have","why've":"why have","why'll":"why will","why're":"why are","why's":"why is","will've":"will have","won't":"will not",wont:S,"won't've":"will not have","would've":"would have","wouldn't":"would not","wouldn't've":"would not have","y'all":"you all","y'all'd":"you all would","y'all'd've":"you all would have","y'all're":"you all are","y'all've":"you all have","you'd":"you would","you'd've":"you would have","you'll":"you will","you'll've":"you will have","you're":"you are","you've":"you have"},V=e,q=t,A=h,B=l,C=o,D=a.isPrimitive,F=T,G=V(F);function H(e){var t,h,l,o,a,w;if(!D(e))throw new TypeError("invalid argument. Must provide a primitive string. Value: `"+e+"`.");for(l="",t=C(e,!0),a=0;a<t.length;a++){if(h=t[a],q(h)){for(w=0;w<G.length;w++)if(o=G[w],A(h)===o){h=B(F[o]);break}}else for(w=0;w<G.length;w++)if(h===(o=G[w])){h=F[o];break}l+=h}return l}var J=H;export default J; //# sourceMappingURL=expand-contractions.js.map