Socket
Socket
Sign inDemoInstall

phone-fns

Package Overview
Dependencies
1
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 3.2.1 to 3.2.3

19

changelog.md
# Changelog
## v3.2.3
### New
- Switched over to [pinet](https://github.com/dhershman1/pinet) jsdoc templating
- Changed documentation hosting
### Improved
- All dependencies have been updated
- Removed docs folder
- Removed david-dm badge since it doesn't seem to be coming back
- Documentation workflow now handled by circleci
- `format` can now take in `Number` type phone numbers
## v3.2.2
- Dev dependency fixes
## v3.2.1

@@ -4,0 +23,0 @@

30

dist/phone-fns.js
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('kyanite')) :
typeof define === 'function' && define.amd ? define(['exports', 'kyanite'], factory) :
(global = global || self, factory(global.phoneFns = {}, global.kyanite));
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.phoneFns = {}, global.kyanite));
}(this, (function (exports, kyanite) { 'use strict';
function _slicedToArray(arr, i) {
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest();
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
}

@@ -16,6 +16,3 @@

function _iterableToArrayLimit(arr, i) {
if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === "[object Arguments]")) {
return;
}
if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return;
var _arr = [];

@@ -46,4 +43,21 @@ var _n = true;

function _unsupportedIterableToArray(o, minLen) {
if (!o) return;
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
var n = Object.prototype.toString.call(o).slice(8, -1);
if (n === "Object" && o.constructor) n = o.constructor.name;
if (n === "Map" || n === "Set") return Array.from(o);
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
}
function _arrayLikeToArray(arr, len) {
if (len == null || len > arr.length) len = arr.length;
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
return arr2;
}
function _nonIterableRest() {
throw new TypeError("Invalid attempt to destructure non-iterable instance");
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}

@@ -118,3 +132,3 @@

var _reduce = kyanite.addIndex(kyanite.reduce);
return kyanite.branch(kyanite.both(kyanite.complement(isValid), kyanite.complement(validFormat(layout))), kyanite.identity, kyanite.pipe([kyanite.split(''), uglify, _reduce(function (d, acc, i) {
return kyanite.branch(kyanite.both(kyanite.complement(isValid), kyanite.complement(validFormat(layout))), kyanite.identity, kyanite.pipe([uglify, kyanite.split(''), _reduce(function (d, acc, i) {
return kyanite.gt(i, cCount) ? kyanite.replace(/C/i, d, acc) : kyanite.replace(/N/i, d, acc);

@@ -121,0 +135,0 @@ }, layout)]), phone);

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

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("kyanite")):"function"==typeof define&&define.amd?define(["exports","kyanite"],t):t((e=e||self).phoneFns={},e.kyanite)}(this,(function(e,t){"use strict";function n(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if(!(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var u,c=e[Symbol.iterator]();!(r=(u=c.next()).done)&&(n.push(u.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var r=t.compose(t.replace(/[a-z]\w?|\W/gi,""),String),o=function(e){var t=n(r(e).match(/([_0-9]{3})?([_0-9]{3})([_0-9]{4})([_0-9]{1,})?/),5),o=t[1],i=t[2],u=t[3],c=t[4];return{areaCode:o,localCode:i,lineNumber:u,extension:void 0===c?"":c}};function i(e){return function(){var n=o(e),r=n.localCode,i=n.lineNumber;return t.test(/^([0-9]{3})[-. ]?([0-9]{4})$/,r+i)}}function u(e){return function(){var n=o(e),r=n.areaCode,i=n.localCode,u=n.lineNumber;return t.test(/^\+?([0-9]{2})\)?[-. ]?([0-9]{4})[-. ]?([0-9]{4})$/,r+i+u)}}var c,a=function(e){var n=r(e),o=t.compose(t.reduced);return t.pipe([t.when(t.isEmpty,o(t.F)),t.length,t.when(t.lt(7),o(t.F)),t.when(t.eq(7),i(n)),u(n)],n)},l=(c=function(e,n){var o=t.includes("C",e)?t.length(e.match(/C/g)):0,i=t.addIndex(t.reduce);return t.branch(t.both(t.complement(a),t.complement(function(e){return function(n){var o=t.compose(t.countBy(t.toUpper),t.split(""),e),i=o.N,u=o.C,c=void 0===u?0:u;return t.pipe([r,t.length,t.eq(t.add(i,c))],n)}}(e))),t.identity,t.pipe([t.split(""),r,i((function(e,n,r){return t.gt(r,o)?t.replace(/C/i,e,n):t.replace(/N/i,e,n)}),e)]),n)},function e(t,n){return arguments.length?1===arguments.length?function(e){return c(t,e)}:c(t,n):e});e.breakdown=o,e.format=l,e.isValid=a,e.uglify=r,Object.defineProperty(e,"__esModule",{value:!0})}));
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("kyanite")):"function"==typeof define&&define.amd?define(["exports","kyanite"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).phoneFns={},e.kyanite)}(this,(function(e,t){"use strict";function n(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var u,a=e[Symbol.iterator]();!(r=(u=a.next()).done)&&(n.push(u.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==a.return||a.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return r(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var o=t.compose(t.replace(/[a-z]\w?|\W/gi,""),String),i=function(e){var t=n(o(e).match(/([_0-9]{3})?([_0-9]{3})([_0-9]{4})([_0-9]{1,})?/),5),r=t[1],i=t[2],u=t[3],a=t[4];return{areaCode:r,localCode:i,lineNumber:u,extension:void 0===a?"":a}};function u(e){return function(){var n=i(e),r=n.localCode,o=n.lineNumber;return t.test(/^([0-9]{3})[-. ]?([0-9]{4})$/,r+o)}}function a(e){return function(){var n=i(e),r=n.areaCode,o=n.localCode,u=n.lineNumber;return t.test(/^\+?([0-9]{2})\)?[-. ]?([0-9]{4})[-. ]?([0-9]{4})$/,r+o+u)}}var c,l=function(e){var n=o(e),r=t.compose(t.reduced);return t.pipe([t.when(t.isEmpty,r(t.F)),t.length,t.when(t.lt(7),r(t.F)),t.when(t.eq(7),u(n)),a(n)],n)},f=(c=function(e,n){var r=t.includes("C",e)?t.length(e.match(/C/g)):0,i=t.addIndex(t.reduce);return t.branch(t.both(t.complement(l),t.complement(function(e){return function(n){var r=t.compose(t.countBy(t.toUpper),t.split(""),e),i=r.N,u=r.C,a=void 0===u?0:u;return t.pipe([o,t.length,t.eq(t.add(i,a))],n)}}(e))),t.identity,t.pipe([o,t.split(""),i((function(e,n,o){return t.gt(o,r)?t.replace(/C/i,e,n):t.replace(/N/i,e,n)}),e)]),n)},function e(t,n){return arguments.length?1===arguments.length?function(e){return c(t,e)}:c(t,n):e});e.breakdown=i,e.format=f,e.isValid=l,e.uglify=o,Object.defineProperty(e,"__esModule",{value:!0})}));
{
"name": "phone-fns",
"version": "3.2.1",
"version": "3.2.3",
"description": "A small, modern, and functional phone library for javascript",

@@ -12,2 +12,4 @@ "main": "dist/phone-fns.min.js",

"docs": "node_modules/.bin/jsdoc -c jsdoc.json",
"docs:deploy": "gh-pages -m 'auto commit [ci skip]' --dist docs",
"docs:test": "gh-pages -m 'auto commit [ci skip]' --dist docs --branch gh-pages",
"build": "rollup -c",

@@ -58,21 +60,23 @@ "lint": "standard src/**/*.js",

"devDependencies": {
"@babel/core": "7.8.7",
"@babel/preset-env": "7.8.7",
"@killparadise/docdash": "github:dhershman1/docdash",
"@babel/core": "7.12.3",
"@babel/preset-env": "7.12.1",
"@rollup/plugin-babel": "^5.2.1",
"esm": "3.2.25",
"globby": "11.0.0",
"jsdoc": "3.6.3",
"nyc": "15.0.0",
"rollup": "1.32.0",
"rollup-plugin-babel": "4.3.3",
"rollup-plugin-cleanup": "3.1.1",
"rollup-plugin-filesize": "6.2.1",
"rollup-plugin-terser": "5.2.0",
"standard": "14.3.1",
"gh-pages": "3.1.0",
"globby": "11.0.1",
"jsdoc": "3.6.5",
"npm-run-all": "^4.1.5",
"nyc": "15.1.0",
"pinet": "1.0.0",
"rollup": "2.33.3",
"rollup-plugin-cleanup": "3.2.1",
"rollup-plugin-filesize": "9.0.2",
"rollup-plugin-terser": "7.0.2",
"standard": "16.0.3",
"tap-spec": "5.0.0",
"tape": "4.13.2"
"tape": "5.0.1"
},
"dependencies": {
"kyanite": "1.2.0"
"kyanite": "1.4.2"
}
}
[![npm](https://img.shields.io/npm/v/phone-fns.svg?style=flat-square)](https://www.npmjs.com/package/phone-fns)
[![David](https://img.shields.io/david/dhershman1/phone-fns.svg?style=flat-square)](https://david-dm.org/dhershman1/phone-fns)
[![CircleCI](https://circleci.com/gh/dhershman1/phone-fns.svg?style=svg)](https://circleci.com/gh/dhershman1/phone-fns)

@@ -30,9 +29,2 @@ [![codecov](https://codecov.io/gh/dhershman1/phone-fns/branch/master/graph/badge.svg)](https://codecov.io/gh/dhershman1/phone-fns)

CDN
```html
<!-- It is recommended to replace the @latest with a strict version number for production -->
<script src="https://cdn.jsdelivr.net/npm/phone-fns@latest/dist/phone-fns.min.js"></script>
```
Through the browser

@@ -39,0 +31,0 @@

@@ -77,4 +77,4 @@ import {

pipe([
uglify,
split(''),
uglify,
_reduce((d, acc, i) => gt(i, cCount) ? replace(/C/i, d, acc) : replace(/N/i, d, acc), layout)

@@ -81,0 +81,0 @@ ]),

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc