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

afformative

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

afformative - npm Package Compare versions

Comparing version 0.6.0 to 0.6.1

47

dist/afformative.cjs.js

@@ -5,16 +5,9 @@ 'use strict';

function _objectWithoutPropertiesLoose(source, excluded) {
if (source == null) return {};
var target = {};
var sourceKeys = Object.keys(source);
var key, i;
var _toConsumableArray = require('@babel/runtime/helpers/toConsumableArray');
var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
for (i = 0; i < sourceKeys.length; i++) {
key = sourceKeys[i];
if (excluded.indexOf(key) >= 0) continue;
target[key] = source[key];
}
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
return target;
}
var _toConsumableArray__default = /*#__PURE__*/_interopDefaultLegacy(_toConsumableArray);
var _objectWithoutProperties__default = /*#__PURE__*/_interopDefaultLegacy(_objectWithoutProperties);

@@ -47,3 +40,3 @@ // TODO: Update `FormatDefinition` type based on this snippet. Sadly, TypeScript cannot correctly

suggestions = _ref$suggestions === void 0 ? [] : _ref$suggestions,
dataContext = _objectWithoutPropertiesLoose(_ref, ["children", "suggestions"]);
dataContext = _objectWithoutProperties__default['default'](_ref, ["children", "suggestions"]);

@@ -53,26 +46,14 @@ return (_format = format(children, suggestions, dataContext)) !== null && _format !== void 0 ? _format : null;

formatter.displayName = formatterOptions == null ? void 0 : formatterOptions.displayName;
formatter.displayName = formatterOptions === null || formatterOptions === void 0 ? void 0 : formatterOptions.displayName;
formatter.format = function (value, usageSuggestions, dataContext) {
if (usageSuggestions === void 0) {
usageSuggestions = [];
}
if (dataContext === void 0) {
dataContext = {};
}
formatter.format = function (value) {
var usageSuggestions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
var dataContext = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
return format(value, usageSuggestions, dataContext);
};
formatter.formatAsPrimitive = function (value, usageSuggestions, dataContext) {
if (usageSuggestions === void 0) {
usageSuggestions = [];
}
if (dataContext === void 0) {
dataContext = {};
}
return format(value, ["primitive"].concat(usageSuggestions), dataContext);
formatter.formatAsPrimitive = function (value) {
var usageSuggestions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
var dataContext = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
return format(value, ["primitive"].concat(_toConsumableArray__default['default'](usageSuggestions)), dataContext);
};

@@ -79,0 +60,0 @@

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

function _objectWithoutPropertiesLoose(source, excluded) {
if (source == null) return {};
var target = {};
var sourceKeys = Object.keys(source);
var key, i;
import _toConsumableArray from '@babel/runtime/helpers/esm/toConsumableArray';
import _objectWithoutProperties from '@babel/runtime/helpers/esm/objectWithoutProperties';
for (i = 0; i < sourceKeys.length; i++) {
key = sourceKeys[i];
if (excluded.indexOf(key) >= 0) continue;
target[key] = source[key];
}
return target;
}
// TODO: Update `FormatDefinition` type based on this snippet. Sadly, TypeScript cannot correctly

@@ -42,3 +30,3 @@ // verify the return type of the format definition based on the suggestions, printing errors such

suggestions = _ref$suggestions === void 0 ? [] : _ref$suggestions,
dataContext = _objectWithoutPropertiesLoose(_ref, ["children", "suggestions"]);
dataContext = _objectWithoutProperties(_ref, ["children", "suggestions"]);

@@ -48,26 +36,14 @@ return (_format = format(children, suggestions, dataContext)) !== null && _format !== void 0 ? _format : null;

formatter.displayName = formatterOptions == null ? void 0 : formatterOptions.displayName;
formatter.displayName = formatterOptions === null || formatterOptions === void 0 ? void 0 : formatterOptions.displayName;
formatter.format = function (value, usageSuggestions, dataContext) {
if (usageSuggestions === void 0) {
usageSuggestions = [];
}
if (dataContext === void 0) {
dataContext = {};
}
formatter.format = function (value) {
var usageSuggestions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
var dataContext = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
return format(value, usageSuggestions, dataContext);
};
formatter.formatAsPrimitive = function (value, usageSuggestions, dataContext) {
if (usageSuggestions === void 0) {
usageSuggestions = [];
}
if (dataContext === void 0) {
dataContext = {};
}
return format(value, ["primitive"].concat(usageSuggestions), dataContext);
formatter.formatAsPrimitive = function (value) {
var usageSuggestions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
var dataContext = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
return format(value, ["primitive"].concat(_toConsumableArray(usageSuggestions)), dataContext);
};

@@ -74,0 +50,0 @@

@@ -7,2 +7,37 @@ (function (global, factory) {

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 _arrayWithoutHoles(arr) {
if (Array.isArray(arr)) return _arrayLikeToArray(arr);
}
function _iterableToArray(iter) {
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
}
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 _nonIterableSpread() {
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _toConsumableArray(arr) {
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
}
function _objectWithoutPropertiesLoose(source, excluded) {

@@ -23,2 +58,21 @@ if (source == null) return {};

function _objectWithoutProperties(source, excluded) {
if (source == null) return {};
var target = _objectWithoutPropertiesLoose(source, excluded);
var key, i;
if (Object.getOwnPropertySymbols) {
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
for (i = 0; i < sourceSymbolKeys.length; i++) {
key = sourceSymbolKeys[i];
if (excluded.indexOf(key) >= 0) continue;
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
target[key] = source[key];
}
}
return target;
}
// TODO: Update `FormatDefinition` type based on this snippet. Sadly, TypeScript cannot correctly

@@ -50,3 +104,3 @@ // verify the return type of the format definition based on the suggestions, printing errors such

suggestions = _ref$suggestions === void 0 ? [] : _ref$suggestions,
dataContext = _objectWithoutPropertiesLoose(_ref, ["children", "suggestions"]);
dataContext = _objectWithoutProperties(_ref, ["children", "suggestions"]);

@@ -56,26 +110,14 @@ return (_format = format(children, suggestions, dataContext)) !== null && _format !== void 0 ? _format : null;

formatter.displayName = formatterOptions == null ? void 0 : formatterOptions.displayName;
formatter.displayName = formatterOptions === null || formatterOptions === void 0 ? void 0 : formatterOptions.displayName;
formatter.format = function (value, usageSuggestions, dataContext) {
if (usageSuggestions === void 0) {
usageSuggestions = [];
}
if (dataContext === void 0) {
dataContext = {};
}
formatter.format = function (value) {
var usageSuggestions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
var dataContext = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
return format(value, usageSuggestions, dataContext);
};
formatter.formatAsPrimitive = function (value, usageSuggestions, dataContext) {
if (usageSuggestions === void 0) {
usageSuggestions = [];
}
if (dataContext === void 0) {
dataContext = {};
}
return format(value, ["primitive"].concat(usageSuggestions), dataContext);
formatter.formatAsPrimitive = function (value) {
var usageSuggestions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
var dataContext = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
return format(value, ["primitive"].concat(_toConsumableArray(usageSuggestions)), dataContext);
};

@@ -82,0 +124,0 @@

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

!function(n,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((n="undefined"!=typeof globalThis?globalThis:n||self).Afformative={})}(this,(function(n){"use strict";n.makeFormatter=function n(e,t){var i=function(n){var t,i=n.children,r=n.suggestions,o=void 0===r?[]:r,u=function(n,e){if(null==n)return{};var t,i,r={},o=Object.keys(n);for(i=0;o.length>i;i++)0>e.indexOf(t=o[i])&&(r[t]=n[t]);return r}(n,["children","suggestions"]);return null!==(t=e(i,o,u))&&void 0!==t?t:null};return i.displayName=null==t?void 0:t.displayName,i.format=function(n,t,i){return void 0===t&&(t=[]),void 0===i&&(i={}),e(n,t,i)},i.formatAsPrimitive=function(n,t,i){return void 0===t&&(t=[]),void 0===i&&(i={}),e(n,["primitive"].concat(t),i)},i.wrap=function(e,r){var o=n((function(n,t,r){return e((function(n,e,o){return i.format(n,null!=e?e:t,null!=o?o:r)}),n,t,r)}),null!=r?r:t);return o.innerFormatter=i,o},i},Object.defineProperty(n,"__esModule",{value:!0})}));
!function(t,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports):"function"==typeof define&&define.amd?define(["exports"],r):r((t="undefined"!=typeof globalThis?globalThis:t||self).Afformative={})}(this,(function(t){"use strict";function r(t,r){(null==r||r>t.length)&&(r=t.length);for(var e=0,n=Array(r);r>e;e++)n[e]=t[e];return n}function e(t){return function(t){if(Array.isArray(t))return r(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return r(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function n(t,r){if(null==t)return{};var e,n,o=function(t,r){if(null==t)return{};var e,n,o={},i=Object.keys(t);for(n=0;i.length>n;n++)0>r.indexOf(e=i[n])&&(o[e]=t[e]);return o}(t,r);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(n=0;i.length>n;n++)0>r.indexOf(e=i[n])&&Object.prototype.propertyIsEnumerable.call(t,e)&&(o[e]=t[e])}return o}t.makeFormatter=function t(r,o){var i=function(t){var e,o=t.children,i=t.suggestions,u=void 0===i?[]:i,l=n(t,["children","suggestions"]);return null!==(e=r(o,u,l))&&void 0!==e?e:null};return i.displayName=null==o?void 0:o.displayName,i.format=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return r(t,e,n)},i.formatAsPrimitive=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return r(t,["primitive"].concat(e(n)),o)},i.wrap=function(r,e){var n=t((function(t,e,n){return r((function(t,r,o){return i.format(t,null!=r?r:e,null!=o?o:n)}),t,e,n)}),null!=e?e:o);return n.innerFormatter=i,n},i},Object.defineProperty(t,"__esModule",{value:!0})}));
export * from "./makeFormatter";
//# sourceMappingURL=index.d.ts.map

@@ -0,0 +0,0 @@ declare type PrimitiveSuggestion = "primitive";

{
"name": "afformative",
"version": "0.6.0",
"version": "0.6.1",
"license": "MIT",

@@ -30,2 +30,5 @@ "main": "dist/afformative.cjs.js",

],
"dependencies": {
"@babel/runtime": "^7.12.1"
},
"publishConfig": {

@@ -35,3 +38,3 @@ "access": "public"

"sideEffects": false,
"gitHead": "b5ffb3e48e19a74b2ca89af2ad7a96becbe711e7"
"gitHead": "3b81fd5d4c4fae9cfe04b8fd0b53c1c3e3bbaa23"
}
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