-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
92 additions
and
38 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,24 @@ | ||
export const flavours: Record<string, RegExp> = { | ||
/** | ||
* Template: 'Hello, ${name}' | ||
*/ | ||
dollar: /\${([^{}]*)}/gm, | ||
/** | ||
* Template: 'Hello, {{name}}' | ||
*/ | ||
double: /{{([^{}]*)}}/gm, | ||
/** | ||
* Template: 'Hello, {name}' | ||
*/ | ||
single: /{([^{}]*)}/gm, | ||
/** | ||
* Template: 'Hello, #{name}' | ||
*/ | ||
hash: /#{([^{}]*)}/gm, | ||
/** | ||
* Template: 'Hello, %{name}' | ||
*/ | ||
percent: /%{([^{}]*)}/gm, | ||
}; | ||
/** | ||
* Template: 'Hello, ${name}' | ||
*/ | ||
export const dollarPattern = /\${([^{}]*)}/gm; | ||
|
||
/** | ||
* Template: 'Hello, {{name}}' | ||
*/ | ||
export const doublePattern = /{{([^{}]*)}}/gm; | ||
|
||
/** | ||
* Template: 'Hello, {name}' | ||
*/ | ||
export const singlePattern = /{([^{}]*)}/gm; | ||
|
||
/** | ||
* Template: 'Hello, #{name}' | ||
*/ | ||
export const hashPattern = /#{([^{}]*)}/gm; | ||
|
||
/** | ||
* Template: 'Hello, %{name}' | ||
*/ | ||
export const percentPattern = /%{([^{}]*)}/gm; |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/* eslint-env mocha */ | ||
|
||
import { isObject } from "."; | ||
|
||
describe("isObject", (): void => { | ||
test.each([ | ||
[{}, true], | ||
[{ a: 1 }, true], | ||
[[], false], | ||
[null, false], | ||
[undefined, false], | ||
[1, false], | ||
["", false], | ||
[true, false], | ||
[new Map(), false], | ||
[new Set(), false], | ||
[() => {}, false], | ||
])("isObject(%p) === %p", (input, expected): void => | ||
expect(isObject(input)).toBe(expected), | ||
); | ||
}); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,20 @@ | ||
export declare const flavours: Record<string, RegExp>; | ||
/** | ||
* Template: 'Hello, ${name}' | ||
*/ | ||
export declare const dollarPattern: RegExp; | ||
/** | ||
* Template: 'Hello, {{name}}' | ||
*/ | ||
export declare const doublePattern: RegExp; | ||
/** | ||
* Template: 'Hello, {name}' | ||
*/ | ||
export declare const singlePattern: RegExp; | ||
/** | ||
* Template: 'Hello, #{name}' | ||
*/ | ||
export declare const hashPattern: RegExp; | ||
/** | ||
* Template: 'Hello, %{name}' | ||
*/ | ||
export declare const percentPattern: RegExp; |