This file contains hidden or 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
class ProductService extends CRUDService<Product> { | |
constructor() { | |
super('product'); | |
} | |
async create(options: CrudOperationOptions<Product>) { | |
if (userIsPermitted(options.user)) { | |
return super.create(options); | |
} |
This file contains hidden or 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
if (userIsPermitted(options.user)) { | |
return super.create(options); | |
} | |
return undefined; |
This file contains hidden or 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 passwordIsValid = (password: string) => password.length >= 6; |
This file contains hidden or 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
export const validationRules: ValidationRule[] = [ | |
{ | |
id: "lowercase", | |
name: "Lower-case", | |
check: (value: string) => /[a-z|ç|ş|ö|ü|ı|ğ]/u.test(value), | |
}, | |
{ | |
id: "uppercase", | |
name: "Upper-case", | |
check: (value: string) => /[A-Z|Ç|Ş|Ö|Ü|İ|Ğ]/u.test(value), |
This file contains hidden or 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
"packageManager": "[email protected]" |
This file contains hidden or 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
nodeLinker: node-modules |
This file contains hidden or 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
"workspaces": { | |
"packages": [ | |
"packages/*" | |
] | |
}, |
This file contains hidden or 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
"scripts": { | |
"start": "yarn workspaces foreach -pi run start", | |
"build": "yarn workspaces foreach -pti run build" | |
} |
This file contains hidden or 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
"dependencies": { | |
"@mariusbongarts/medium-monorepo-shared": "1.0.0" | |
} |
This file contains hidden or 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
export const matchUrlWithoutHashsRegex = (url: string) => | |
`(${url.split('#')[0]})(\\s|#[\\w]{1,}|\\/(\\s)|\\/(#)|($))` | |
export function currentPageFilter<T extends Mark | Bookmark>(element: T) { | |
const regex = new RegExp(matchUrlWithoutHashsRegex(location.href)); | |
return regex.test(element.url); | |
} |