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
// Value object | |
class CityName { | |
static readonly MIN_LEN_NAME: number = 3 | |
static readonly MAX_LEN_NAME: number = 100 | |
private constructor(private _name: string) { } | |
// Factory method with validation rules | |
static create(name: string): [CityName, Error] { |
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
namespace Domain { | |
export class Hero { | |
private constructor(private _name: string) { } | |
get name(): string { return this._name; } | |
static create(name: string): [Hero, Error] { | |
if (!name || name.trim().length < 3 || name.trim().length > 100) { | |
return [null, new InvalidNameError(name)] | |
} |
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
[ | |
{ | |
"code": 100, | |
"name": "Continue", | |
"enum": "CONTINUE", | |
"reference": { | |
"info": "RFC 7231, Section 6.2.1", | |
"url": "https://tools.ietf.org/html/rfc7231#section-6.2.1" | |
}, | |
"description": "The server has received the request headers and the client should proceed to send the request body", |
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
import {execSync} from 'child_process'; | |
function main() { | |
const stdout = execSync( | |
"kubectl get deployment --all-namespaces --selector=projectCustomer=yes | awk '{print $1,$2}' | tail -n +2", | |
); | |
const results = stdout | |
.toString() | |
.split(/\n/) |
OlderNewer