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

@corefunc/corefunc

Package Overview
Dependencies
Maintainers
1
Versions
237
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@corefunc/corefunc - npm Package Compare versions

Comparing version 0.0.8 to 0.0.9

cast/toRegExp.cjs

20

cast/toRegExp.ts

@@ -1,4 +0,4 @@

import fnIsArray from "lodash-es/isArray";
import fnIsRegExp from "lodash-es/isRegExp";
import fnIsString from "lodash-es/isString";
import isArray from "../is/isArray";
import isRegExp from "../is/isRegExp";
import isString from "../is/isString";

@@ -9,14 +9,14 @@ /**

*/
function toRegExp(pattern) {
if (fnIsRegExp(pattern)) {
export default function toRegExp(pattern): boolean | RegExp {
if (isRegExp(pattern)) {
return pattern;
}
if (fnIsString(pattern)) {
if (isString(pattern)) {
return new RegExp(pattern);
}
if (fnIsArray(pattern)) {
if (fnIsString(pattern[0]) === false) {
if (isArray(pattern)) {
if (isString(pattern[0]) === false) {
return false;
}
if (fnIsString(pattern[1]) === true) {
if (isString(pattern[1]) === true) {
return new RegExp(pattern[0], pattern[1]);

@@ -28,3 +28,1 @@ }

}
export default toRegExp;

@@ -5,3 +5,3 @@ /**

*/
export default function toString(value): string {
export default function toString(value: any): string {
if (value === null || value === undefined) {

@@ -8,0 +8,0 @@ return "";

@@ -1,5 +0,3 @@

function isArray(value) {
export default function isArray(value: any): boolean {
return Array.isArray(value);
}
export default isArray;

@@ -67,3 +67,3 @@ {

},
"version": "0.0.8"
"version": "0.0.9"
}

@@ -5,3 +5,3 @@ # CoreFunc

## Recommended usage for Three Shaking
## Recommended usage for Tree Shaking

@@ -8,0 +8,0 @@ ```javascript

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