New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

minifaker

Package Overview
Dependencies
Maintainers
1
Versions
38
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

minifaker - npm Package Compare versions

Comparing version 1.9.0 to 1.10.0

27

dist/index.d.ts

@@ -85,4 +85,20 @@ export declare const addLocale: (name: string, locale: any) => void;

export declare const port: () => number;
export declare const adjective: (options?: {
export declare const ipv6: () => string;
export declare const color: (options?: {
r?: number;
g?: number;
b?: number;
}) => string;
export declare enum WordType {
VERB = "verb",
PREPOSITION = "preposition",
NOUN = "noun",
INTERJECTION = "interjection",
CONJUNCTION = "conjunction",
ADVERB = "adverb",
ADJECTIVE = "adjective"
}
export declare const word: (options?: {
locale?: string;
type?: WordType;
filter?: (word: string) => void;

@@ -159,7 +175,14 @@ }) => string;

port: () => number;
adjective: (options?: {
word: (options?: {
locale?: string;
type?: WordType;
filter?: (word: string) => void;
}) => string;
ipv6: () => string;
color: (options?: {
r?: number;
g?: number;
b?: number;
}) => string;
};
export default _default;

@@ -14,4 +14,4 @@ var __defProp = Object.defineProperty;

PlaceImgFilter: () => PlaceImgFilter,
WordType: () => WordType,
addLocale: () => addLocale,
adjective: () => adjective,
array: () => array,

@@ -24,2 +24,3 @@ arrayElement: () => arrayElement,

citySufix: () => citySufix,
color: () => color,
default: () => src_default,

@@ -30,2 +31,3 @@ firstName: () => firstName,

ip: () => ip,
ipv6: () => ipv6,
jobArea: () => jobArea,

@@ -41,6 +43,10 @@ jobDescriptor: () => jobDescriptor,

port: () => port,
setDefaultLocale: () => setDefaultLocale
setDefaultLocale: () => setDefaultLocale,
word: () => word
});
var locales = {};
var defaultLocale = null;
var throwNoDefaultLocale = () => {
throw new Error(`No default locale defined. Import at least one locale!`);
};
var throwNoLocale = (locale) => {

@@ -56,2 +62,4 @@ throw new Error(`The locale [${locale}] is not imported or supported.`);

var getLocaleData = ({ locale: _locale, key }) => {
if (!defaultLocale)
throwNoDefaultLocale();
const locale = _locale || defaultLocale;

@@ -215,5 +223,31 @@ if (!locales[locale])

};
var adjective = (options = {}) => {
const { locale, filter } = options;
const adjectives = getLocaleData({ locale, key: "adjectives" });
var ipv6 = () => {
return array(8, () => number({ max: 65535 }).toString(16)).join(":");
};
var color = (options = {}) => {
const { r, g, b } = options;
const leadingZero = (value) => {
if (value.length === 1)
return `0${value}`;
return value;
};
const red = (r || number({ max: 256 })).toString(16);
const green = (g || number({ max: 256 })).toString(16);
const blue = (b || number({ max: 256 })).toString(16);
return `#${leadingZero(red)}${leadingZero(green)}${leadingZero(blue)}`;
};
var WordType;
(function(WordType2) {
WordType2["VERB"] = "verb";
WordType2["PREPOSITION"] = "preposition";
WordType2["NOUN"] = "noun";
WordType2["INTERJECTION"] = "interjection";
WordType2["CONJUNCTION"] = "conjunction";
WordType2["ADVERB"] = "adverb";
WordType2["ADJECTIVE"] = "adjective";
})(WordType || (WordType = {}));
var word = (options = {}) => {
const { type, locale, filter } = options;
const _type = type || arrayElement(Object.values(WordType));
const adjectives = getLocaleData({ locale, key: `${_type}s` });
if (typeof filter === "function")

@@ -247,3 +281,5 @@ return arrayElement(adjectives.filter(filter));

port,
adjective
word,
ipv6,
color
};

@@ -255,4 +291,4 @@ // Annotate the CommonJS export names for ESM import in node:

PlaceImgFilter,
WordType,
addLocale,
adjective,
array,

@@ -265,2 +301,3 @@ arrayElement,

citySufix,
color,
firstName,

@@ -270,2 +307,3 @@ imageUrlFromPlaceIMG,

ip,
ipv6,
jobArea,

@@ -281,3 +319,4 @@ jobDescriptor,

port,
setDefaultLocale
setDefaultLocale,
word
});

2

package.json
{
"name": "minifaker",
"version": "1.9.0",
"version": "1.10.0",
"description": "lightweight faker.js",

@@ -5,0 +5,0 @@ "types": "./dist/index.d.ts",

@@ -97,2 +97,4 @@ # minifaker

port|n/a|port
adjective|en|adjective
adjective,adverb,conjunction, interjection,noun,preposition,verb|en|word
ipv6|n/a|ipv6
color|n/a|color

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

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