Created
May 18, 2019 19:07
-
-
Save szanata/26b681eafcf5a2e964e5d61b24a93ce8 to your computer and use it in GitHub Desktop.
Spit & Trim
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const firstIndexOf = ( c, ...vars ) => Math.min( ...vars.map( v => c.indexOf( v ) ).filter( n => n > -1 ) ); | |
const lastIndexOf = ( c, ...vars ) => Math.max( ...vars.map( v => c.lastIndexOf( v ) ) ); | |
utfString.split( '\0ustar' ).slice( 1 ).map( c => | |
c.substring( firstIndexOf( c, '{', '[' ), lastIndexOf( c, '}', ']' ) + 1 ) | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment