Skip to content

Commit

Permalink
Merge pull request #19 from deinsoftware/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
equiman authored Apr 15, 2023
2 parents 8a85b6b + 6665011 commit 1f8d69c
Show file tree
Hide file tree
Showing 9 changed files with 165 additions and 123 deletions.
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
"arrowfunction",
"arsna",
"arsnd",
"artsna",
"artsnd",
"aruv",
"caaf",
"caaft",
Expand All @@ -47,6 +49,7 @@
"kural",
"paypal",
"pranav",
"SWPM",
"volta",
"vuejs"
],
Expand Down
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,22 @@ Fixed for any bug fixes.
Security to invite users to upgrade in case of vulnerabilities.
-->

## 3.3.0 - 2023/04/15

### Added

- tab jump position icon
- keyboards tricks on README
- `toSorted` on array snippets

### Fixed

- `cafe` snippets on JavaScript and TypeScript

### Changed

- rename snippets identifier

## 3.2.0 - 2023/02/27

### Added
Expand Down
143 changes: 78 additions & 65 deletions README.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "arrow-function-snippets",
"description": "VS Code Arrow function snippets for JS and TS",
"version": "3.2.0",
"version": "3.3.0",
"displayName": "Arrow Function Snippets",
"publisher": "deinsoftware",
"icon": "images/light-icon.png",
Expand Down
28 changes: 19 additions & 9 deletions snippets/arrays.json
Original file line number Diff line number Diff line change
@@ -1,35 +1,45 @@
{
"arrayFilterEqual": {
"array.Filter.Equal": {
"prefix": "arfeq",
"body": "const ${1:newArray} = ${2:array}.filter((${3:element}) => ${3:element} === ${4:value})$0",
"description": "Array Filter compare equal"
},
"arrayFilterNotEqual": {
"array.Filter.NotEqual": {
"prefix": "arfne",
"body": "const ${1:newArray} = ${2:array}.filter((${3:element}) => ${3:element} !== ${4:value})$0",
"description": "Array Filter compare not equal"
},
"arrayFilterObjectEqual": {
"array.Filter.Object.Equal": {
"prefix": "arfoeq",
"body": "const ${1:newArray} = ${2:array}.filter((${3:element}) => ${3:element}.${4:prop} === ${5:value})$0",
"description": "Array Filter Object compare equal"
},
"arrayFilterObjectNotEqual": {
"array.Filter.Object.NotEqual": {
"prefix": "arfone",
"body": "const ${1:newArray} = ${2:array}.filter((${3:element}) => ${3:element}.${4:prop} !== ${5:value})$0",
"description": "Array Filter Object compare not equal"
},
"arraySortNumberAsc": {
"array.Sort.Number.Asc": {
"prefix": "arsna",
"body": "${1:array}.sort((${2:a}, ${3:z}) => ${2:a} - ${3:z})$0",
"description": "Array sort numbers ascending"
"description": "Array sort (mutate) numbers ascending"
},
"arraySortNumberDesc": {
"array.Sort.Number.Desc": {
"prefix": "arsnd",
"body": "${1:array}.sort((${2:a}, ${3:z}) => ${3:z} - ${2:a})$0",
"description": "Array sort numbers descending"
"description": "Array sort (mutate) numbers descending"
},
"arrayUniqueValues": {
"array.ToSorted.Number.Asc": {
"prefix": "artsna",
"body": "${1:array}.toSorted((${2:a}, ${3:z}) => ${2:a} - ${3:z})$0",
"description": "Array sort (not mutate) numbers ascending"
},
"array.ToSorted.Number.Desc": {
"prefix": "artsnd",
"body": "${1:array}.toSorted((${2:a}, ${3:z}) => ${3:z} - ${2:a})$0",
"description": "Array sort (not mutate) numbers descending"
},
"array.UniqueValues": {
"prefix": "aruv",
"body": "const ${1:newArray} = ${2:array}.filter((${3:current}, ${4:index}, ${5:arr}) => ${5:arr}.indexOf(${3:current}) == ${4:index})$0",
"description": "Array unique values"
Expand Down
42 changes: 21 additions & 21 deletions snippets/arrow.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,62 +4,62 @@
"body": "() => $0",
"description": "Arrow function (implicit return)"
},
"arrowFunctionWithArguments": {
"arrowFunction.WithArguments": {
"prefix": "afa",
"body": "(${1:arg}) => $0",
"description": "Arrow function (implicit return) with arguments"
},
"arrowFunctionWithArgumentDestructuring": {
"arrowFunction.WithArgument.Destructuring": {
"prefix": "afad",
"body": "({${1:prop}, ${2:prop}}) => $0",
"description": "Arrow function (implicit return) with argument destructuring"
},
"arrowFunctionObject": {
"arrowFunction.Object": {
"prefix": "afo",
"body": "() => ( { ${1:prop}:${0:value}} )",
"description": "Arrow function (object literal implicit return)"
},
"arrowFunctionObjectWithArguments": {
"arrowFunction.Object.WithArguments": {
"prefix": "afoa",
"body": "(${1:arg}) => ( { ${2:prop}:${0:value}} )",
"description": "Arrow function (object literal implicit return) with arguments"
},
"arrowFunctionExplicit": {
"arrowFunction.Explicit": {
"prefix": "afe",
"body": ["() => {", "\t${1:return} $0", "}"],
"description": "Arrow function (explicit return)"
},
"arrowFunctionExplicitWithArguments": {
"arrowFunction.Explicit.WithArguments": {
"prefix": "afea",
"body": ["(${1:arg}) => {", "\t${2:return} $0", "}"],
"description": "Arrow function (explicit return) with arguments"
},
"arrowFunctionExplicitWithArgumentDestructuring": {
"arrowFunction.Explicit.WithArgument.Destructuring": {
"prefix": "afead",
"body": ["({${1:prop}, ${2:prop}}) => {", "\t${3:return} $0", "}"],
"description": "Arrow function (explicit return) with argument destructuring"
},
"arrowFunctionExplicitEmpty": {
"arrowFunction.Explicit.Empty": {
"prefix": "afee",
"body": ["() => {", "\t$0", "}"],
"description": "Arrow function (without return)"
},
"arrowFunctionExplicitEmptyWithArguments": {
"arrowFunction.Explicit.Empty.WithArguments": {
"prefix": "afeea",
"body": ["(${1:arg}) => {", "\t$0", "}"],
"description": "Arrow function (without return) with arguments"
},
"arrowFunctionParentheses": {
"arrowFunction.Parentheses": {
"prefix": "afp",
"body": ["() => {", "\t( ${0} )", "}"],
"description": "Arrow function (explicit without return)"
},
"arrowFunctionParenthesesWithArguments": {
"arrowFunction.Parentheses.WithArguments": {
"prefix": "afpa",
"body": ["(${1:arg}) => {", "\t( ${0} )", "}"],
"description": "Arrow function (explicit without return) with arguments"
},
"arrowFunctionImmediatelyInvoque": {
"arrowFunction.ImmediatelyInvoque": {
"prefix": ["iiaf", "afii"],
"body": "(() => $0)()",
"description": "Arrow function Immediately Invoke"
Expand All @@ -69,47 +69,47 @@
"body": "async () => $0",
"description": "Arrow async function"
},
"arrowAsyncFunctionWithArguments": {
"arrowAsyncFunction.WithArguments": {
"prefix": "aafa",
"body": "async (${1:arg}) => $0",
"description": "Arrow async function (implicit return) with arguments"
},
"arrowAsyncFunctionImplicitWithArgumentDestructuring": {
"arrowAsyncFunction.Implicit.WithArgument.Destructuring": {
"prefix": "aafad",
"body": "async ({ ${1:prop} }) => $0",
"description": "Arrow async function (explicit return) with argument destructuring"
},
"arrowAsyncFunctionExplicitReturn": {
"arrowAsyncFunction.Explicit.Return": {
"prefix": "aafe",
"body": ["async () => {", "\t${1:return} $0", "}"],
"description": "Arrow async function (explicit with return)"
},
"arrowAsyncFunctionExplicitWithArguments": {
"arrowAsyncFunction.Explicit.WithArguments": {
"prefix": "aafea",
"body": ["async (${1:arg}) => {", "\t${2:return} $0", "}"],
"description": "Arrow async function (explicit without return) with arguments"
},
"arrowAsyncFunctionExplicitWithArgumentDestructuring": {
"arrowAsyncFunction.Explicit.WithArgument.Destructuring": {
"prefix": "aafead",
"body": ["async ({ ${1:prop}, ${2:prop} }) => {", "\t${3:return} $0", "}"],
"description": "Arrow async function (explicit return) with argument destructuring"
},
"arrowAsyncFunctionExplicitEmpty": {
"arrowAsyncFunction.Explicit.Empty": {
"prefix": "aafee",
"body": ["async () => {", "\t$0", "}"],
"description": "Arrow async function (without return)"
},
"arrowAsyncFunctionExplicitEmptyWithArguments": {
"arrowAsyncFunction.Explicit.Empty.WithArguments": {
"prefix": "aafeea",
"body": ["async (${1:arg}) => {", "\t$0", "}"],
"description": "Arrow async function (without return) with arguments"
},
"arrowAsyncAwaitFunctionExplicitWithArguments": {
"arrowAsyncAwaitFunction.Explicit.WithArguments": {
"prefix": "aaafea",
"body": ["async (${1:arg}) => {", "\tconst ${2:name} = await ${0}", "}"],
"description": "Arrow async-await function (explicit without return) with arguments"
},
"arrowAsyncFunctionImmediatelyInvoque": {
"arrowAsyncFunction.ImmediatelyInvoque": {
"prefix": ["iiaaf", "aafii"],
"body": "(async () => $0)()",
"description": "Arrow async function Immediately Invoke"
Expand Down
16 changes: 8 additions & 8 deletions snippets/function-js.json
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
{
"exportDefaultArrowFunction": {
"export.Default.ArrowFunction": {
"prefix": "edaf",
"body": ["export default ($1) => {", "\t$0", "}"],
"description": "Export Default Anonymous Arrow function"
},
"exportDefaultAsyncArrowFunction": {
"export.Default.AsyncArrowFunction": {
"prefix": "edaaf",
"body": ["export default async ($1) => {", "\t$0", "}"],
"description": "Export Default Async Anonymous Arrow function"
},
"constantArrowFunction": {
"constant.ArrowFunction": {
"prefix": "caf",
"body": ["const ${1:name} = ($2) => $0"],
"description": "Constant Arrow function (implicit return)"
},
"constantArrowFunctionExplicit": {
"constant.ArrowFunction.Explicit": {
"prefix": "cafe",
"body": ["const ${1:name} = ($2) => {", "\treturn $0", "}"],
"body": ["const ${1:name} = ($2) => {", "\t${3:return} $0", "}"],
"description": "Constant Arrow function (explicit return)"
},
"exportConstantArrowFunction": {
"export.Constant.ArrowFunction": {
"prefix": "ecaf",
"body": ["export const ${1:name} = ($2) => {", "\t$0", "}"],
"description": "Export Constant Arrow function"
},
"constantAsyncArrowFunction": {
"constant.AsyncArrowFunction": {
"prefix": "caaf",
"body": ["const ${1:name} = async ($2) => {", "\t$0", "}"],
"description": "Constant Async Arrow function"
},
"exportConstantAsyncArrowFunction": {
"export.Constant.AsyncArrowFunction": {
"prefix": "ecaaf",
"body": ["export const ${1:name} = async ($2) => {", "\t$0", "}"],
"description": "Export Constant Async Arrow function"
Expand Down
24 changes: 12 additions & 12 deletions snippets/function-ts.json
Original file line number Diff line number Diff line change
@@ -1,40 +1,40 @@
{
"exportDefaultArrowFunction": {
"export.Default.ArrowFunction": {
"prefix": "edaf",
"body": ["export default ($1) => {", "\t$0", "}"],
"description": "Export Default Anonymous Arrow function"
},
"exportDefaultAsyncArrowFunction": {
"export.Default.AsyncArrowFunction": {
"prefix": "edaaf",
"body": ["export default async ($1) => {", "\t$0", "}"],
"description": "Export Default Async Anonymous Arrow function"
},
"constantArrowFunction": {
"constant.ArrowFunction": {
"prefix": "caf",
"body": ["const ${1:name} = ($2) => $0"],
"description": "Constant Arrow function (implicit return)"
},
"constantArrowFunctionExplicit": {
"constant.ArrowFunction.Explicit": {
"prefix": "cafe",
"body": ["const ${1:name} = ($2) => {", "\treturn $0", "}"],
"body": ["const ${1:name} = ($2) => {", "\t${3:return} $0", "}"],
"description": "Constant Arrow function (explicit return)"
},
"exportConstantArrowFunction": {
"export.Constant.ArrowFunction": {
"prefix": "ecaf",
"body": ["export const ${1:name} = ($2) => {", "\t$0", "}"],
"description": "Export Constant Arrow function"
},
"constantAsyncArrowFunction": {
"constant.Async.ArrowFunction": {
"prefix": "caaf",
"body": ["const ${1:name} = async ($2) => {", "\t$0", "}"],
"description": "Constant Async Arrow function"
},
"exportConstantAsyncArrowFunction": {
"export.Constant.AsyncArrowFunction": {
"prefix": "ecaaf",
"body": ["export const ${1:name} = async ($2) => {", "\t$0", "}"],
"description": "Export Constant Async Arrow function"
},
"constantArrowFunctionType": {
"constant.ArrowFunction.Type": {
"prefix": "caft",
"body": [
"const ${1:name} = ($2) : ${3|string,number,boolean,custom|} => {",
Expand All @@ -43,7 +43,7 @@
],
"description": "Constant Arrow function (explicit return type)"
},
"exportConstantArrowFunctionType": {
"export.ConstantArrow.Function.Type": {
"prefix": "ecaft",
"body": [
"export const ${1:name} = ($2) : ${3|string,number,boolean,custom|} => {",
Expand All @@ -52,7 +52,7 @@
],
"description": "Export Constant Arrow function (explicit return type)"
},
"constantAsyncArrowFunctionType": {
"constant.AsyncArrowFunction.Type": {
"prefix": "caaft",
"body": [
"const ${1:name} = async ($2) : ${3|string,number,boolean,custom|} => {",
Expand All @@ -61,7 +61,7 @@
],
"description": "Constant Async Arrow function (explicit return type)"
},
"exportConstantAsyncArrowFunctionType": {
"export.Constant.AsyncArrowFunction.Type": {
"prefix": "ecaaft",
"body": [
"export const ${1:name} = async ($2) : ${3|string,number,boolean,custom|} => {",
Expand Down
Loading

0 comments on commit 1f8d69c

Please sign in to comment.