Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@fluentfixture/shared

Package Overview
Dependencies
Maintainers
0
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@fluentfixture/shared - npm Package Compare versions

Comparing version 1.0.5 to 1.0.6-alpha.1

lib/src/random/random.d.ts

1

lib/index.d.ts
export * from './src/types/type-utils';
export * from './src/strings/string-utils';
export * from './src/dates/date-utils';
export * from './src/random/random';

@@ -20,1 +20,2 @@ "use strict";

__exportStar(require("./src/dates/date-utils"), exports);
__exportStar(require("./src/random/random"), exports);

24

lib/src/strings/string-utils.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.StringUtils = void 0;
const change_case_1 = require("change-case");
const change_case_all_1 = require("change-case-all");
class StringUtils {
static upperCase(str) {
return str.toUpperCase();
return change_case_all_1.Case.upper(str);
}
static lowerCase(str) {
return str.toLowerCase();
return change_case_all_1.Case.lower(str);
}

@@ -31,29 +31,29 @@ static trim(str) {

static pathCase(str) {
return (0, change_case_1.pathCase)(str);
return change_case_all_1.Case.path(str);
}
static headerCase(str) {
return (0, change_case_1.headerCase)(str);
return change_case_all_1.Case.train(str);
}
static paramCase(str) {
return (0, change_case_1.paramCase)(str);
return change_case_all_1.Case.kebab(str);
}
static snakeCase(str) {
return (0, change_case_1.snakeCase)(str);
return change_case_all_1.Case.snake(str);
}
static pascalCase(str) {
return (0, change_case_1.pascalCase)(str);
return change_case_all_1.Case.pascal(str);
}
static capitalCase(str) {
return (0, change_case_1.capitalCase)(str);
return change_case_all_1.Case.capital(str);
}
static camelCase(str) {
return (0, change_case_1.camelCase)(str);
return change_case_all_1.Case.camel(str);
}
static constantCase(str) {
return (0, change_case_1.constantCase)(str);
return change_case_all_1.Case.constant(str);
}
static dotCase(str) {
return (0, change_case_1.dotCase)(str);
return change_case_all_1.Case.dot(str);
}
}
exports.StringUtils = StringUtils;
export declare class TypeUtils {
static isString(str: unknown): str is string;
static isDate(date: unknown): date is Date;
static isObject(obj: unknown): obj is Object;
static isObject(obj: unknown): obj is object;
static isNumber(num: unknown): num is number;
static isFunction(fn: unknown): fn is Function;
static isBoolean(bool: unknown): bool is boolean;
static isSymbol(symbol: unknown): symbol is Symbol;
static isSymbol(symbol: unknown): symbol is symbol;
static isInteger(num: unknown): num is number;

@@ -10,0 +10,0 @@ static isNull(val: unknown): val is null;

@@ -33,3 +33,3 @@ "use strict";

static isUndefined(val) {
return typeof val === 'undefined';
return val === undefined;
}

@@ -36,0 +36,0 @@ static isArray(arr) {

@@ -10,3 +10,3 @@ "use strict";

});
test.each(type_sets_1.NON_STRING_DATA_SET)('should return false when parameter is not a string, %p', (str) => {
test.each(type_sets_1.NON_STRING_DATA_SET)('should return false when parameter is not a string: %p', (str) => {
expect(type_utils_1.TypeUtils.isString(str)).toBe(false);

@@ -19,3 +19,3 @@ });

});
test.each(type_sets_1.NON_DATE_DATA_SET)('should return false when parameter is not a date, %p', (date) => {
test.each(type_sets_1.NON_DATE_DATA_SET)('should return false when parameter is not a date: %p', (date) => {
expect(type_utils_1.TypeUtils.isDate(date)).toBe(false);

@@ -28,3 +28,3 @@ });

});
test.each(type_sets_1.NON_OBJECT_DATA_SET)('should return false when parameter is not an object, %p', (date) => {
test.each(type_sets_1.NON_OBJECT_DATA_SET)('should return false when parameter is not an object: %p', (date) => {
expect(type_utils_1.TypeUtils.isObject(date)).toBe(false);

@@ -37,3 +37,3 @@ });

});
test.each(type_sets_1.NON_NUMBER_DATA_SET)('should return false when parameter is not a number, %p', (num) => {
test.each(type_sets_1.NON_NUMBER_DATA_SET)('should return false when parameter is not a number: %p', (num) => {
expect(type_utils_1.TypeUtils.isNumber(num)).toBe(false);

@@ -46,3 +46,3 @@ });

});
test.each(type_sets_1.NON_FUNCTION_DATA_SET)('should return false when parameter is not a function, %p', (fn) => {
test.each(type_sets_1.NON_FUNCTION_DATA_SET)('should return false when parameter is not a function: %p', (fn) => {
expect(type_utils_1.TypeUtils.isFunction(fn)).toBe(false);

@@ -55,3 +55,3 @@ });

});
test.each(type_sets_1.NON_BOOLEAN_DATA_SET)('should return false when parameter is not a boolean, %p', (bool) => {
test.each(type_sets_1.NON_BOOLEAN_DATA_SET)('should return false when parameter is not a boolean: %p', (bool) => {
expect(type_utils_1.TypeUtils.isBoolean(bool)).toBe(false);

@@ -64,3 +64,3 @@ });

});
test.each(type_sets_1.NON_SYMBOL_DATA_SET)('should return false when parameter is not a symbol, %p', (sym) => {
test.each(type_sets_1.NON_SYMBOL_DATA_SET)('should return false when parameter is not a symbol: %p', (sym) => {
expect(type_utils_1.TypeUtils.isSymbol(sym)).toBe(false);

@@ -73,3 +73,3 @@ });

});
test.each(type_sets_1.NON_NON_EMPTY_STRING_DATA_SET)('should return false when parameter is not a non-empty string, %p', (str) => {
test.each(type_sets_1.NON_NON_EMPTY_STRING_DATA_SET)('should return false when parameter is not a non-empty string: %p', (str) => {
expect(type_utils_1.TypeUtils.isNonEmptyString(str)).toBe(false);

@@ -82,3 +82,3 @@ });

});
test.each(type_sets_1.NON_NON_BLANK_STRING_DATA_SET)('should return false when parameter is not a non-blank string, %p', (str) => {
test.each(type_sets_1.NON_NON_BLANK_STRING_DATA_SET)('should return false when parameter is not a non-blank string: %p', (str) => {
expect(type_utils_1.TypeUtils.isNonBlankString(str)).toBe(false);

@@ -91,3 +91,3 @@ });

});
test.each(type_sets_1.NON_INTEGER_DATA_SET)('should return false when parameter is not an integer, %p', (int) => {
test.each(type_sets_1.NON_INTEGER_DATA_SET)('should return false when parameter is not an integer: %p', (int) => {
expect(type_utils_1.TypeUtils.isInteger(int)).toBe(false);

@@ -100,3 +100,3 @@ });

});
test.each(type_sets_1.NON_ARRAY_DATA_SET)('should return false when parameter is not an array, %p', (val) => {
test.each(type_sets_1.NON_ARRAY_DATA_SET)('should return false when parameter is not an array: %p', (val) => {
expect(type_utils_1.TypeUtils.isArray(val)).toBe(false);

@@ -109,3 +109,3 @@ });

});
test.each(type_sets_1.NON_NULL_DATA_SET)('should return false when parameter is not null, %p', (val) => {
test.each(type_sets_1.NON_NULL_DATA_SET)('should return false when parameter is not null: %p', (val) => {
expect(type_utils_1.TypeUtils.isNull(val)).toBe(false);

@@ -118,3 +118,3 @@ });

});
test.each(type_sets_1.NON_UNDEFINED_DATA_SET)('should return false when parameter is not undefined, %p', (val) => {
test.each(type_sets_1.NON_UNDEFINED_DATA_SET)('should return false when parameter is not undefined: %p', (val) => {
expect(type_utils_1.TypeUtils.isUndefined(val)).toBe(false);

@@ -130,3 +130,3 @@ });

});
test.each(type_sets_1.NON_NON_ASSIGNED_DATA_SET)('should return true when parameter is not null or undefined, %p', (val) => {
test.each(type_sets_1.NON_NON_ASSIGNED_DATA_SET)('should return true when parameter is not null or undefined: %p', (val) => {
expect(type_utils_1.TypeUtils.isAssigned(val)).toBe(true);

@@ -133,0 +133,0 @@ });

{
"name": "@fluentfixture/shared",
"description": "Shared utils of @fluentfixture project. Contains common string, date ,and type utilities.",
"version": "1.0.5",
"version": "1.0.6-alpha.1",
"license": "MIT",

@@ -43,6 +43,8 @@ "main": "lib/index.js",

"dependencies": {
"change-case": "4.1.2",
"dayjs": "1.11.7"
"change-case-all": "2.1.0",
"dayjs": "1.11.13",
"random-js": "2.1.0",
"randomstring": "1.3.0"
},
"gitHead": "97d6f407b745441bc6b6b590c6a3b48f60450dda"
"gitHead": "1b708788a1f088446a604eedf6684a3befe86594"
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc