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

@twilio-paste/uid-library

Package Overview
Dependencies
Maintainers
5
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@twilio-paste/uid-library - npm Package Compare versions

Comparing version 0.1.3 to 0.2.0

dist/tsconfig.tsbuildinfo

11

CHANGELOG.md

@@ -6,2 +6,13 @@ # Change Log

# [0.2.0](https://github.com/twilio-labs/paste/compare/@twilio-paste/uid-library@0.1.3...@twilio-paste/uid-library@0.2.0) (2021-01-21)
### Features
* ESBuild for builds ([#1084](https://github.com/twilio-labs/paste/issues/1084)) ([0536460](https://github.com/twilio-labs/paste/commit/053646011508be10477d5b732269cdb0419235d7))
## [0.1.3](https://github.com/twilio-labs/paste/compare/@twilio-paste/uid-library@0.1.2...@twilio-paste/uid-library@0.1.3) (2021-01-15)

@@ -8,0 +19,0 @@

16

dist/index.es.js

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

import*as r from"react";import{createContext as n,Component as t,createElement as e,useState as o,useContext as u}from"react";var i=function(){var r=1,n=new WeakMap,t=function(e,o){return"number"==typeof e||"string"==typeof e?o?"idx-"+o:"val-"+e:n.has(e)?"uid"+n.get(e):(n.set(e,r++),t(e))};return t},c=i(),f=function(r){return void 0===r&&(r=""),{value:1,prefix:r,uid:i()}},p=f(),a=n(f()),s=function(r){return r.value++},d=function(r){return r?r.prefix:""},v=function(r,n){return(v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var t in n)n.hasOwnProperty(t)&&(r[t]=n[t])})(r,n)};var l=function(r,n,t){var e=n+r;return String(t?t(e):e)},h=function(r){function n(){var n=null!==r&&r.apply(this,arguments)||this;return n.state={quartz:n.props.idSource||p,prefix:d(n.props.idSource),id:s(n.props.idSource||p)},n.uid=function(r){return l(n.state.id+"-"+n.state.quartz.uid(r),n.state.prefix,n.props.name)},n}return function(r,n){function t(){this.constructor=r}v(r,n),r.prototype=null===n?Object.create(n):(t.prototype=n.prototype,new t)}(n,r),n.prototype.render=function(){var r=this.props,n=r.children,t=r.name,e=this.state,o=e.id,u=e.prefix;return n(l(o,u,t),this.uid)},n}(t),m=function(r){var n=r.children,t=r.prefix,o=void 0===t?"":t;return e(y,null,(function(r){return e(a.Provider,{value:f(r+"-"+o)},n)}))},y=function(r){var n=r.name,t=r.children;return e(a.Consumer,null,(function(r){return e(h,{name:n,idSource:r,children:t})}))},x=function(){if("production"!==process.env.NODE_ENV&&!("useContext"in r))throw new Error("Hooks API requires React 16.8+");return o(function(r){var n=r||p,t=d(n)+s(n);return{uid:t,gen:function(r){return t+n.uid(r)}}}(u(a)))},_=function(){return x()[0].uid},g=function(){return x()[0].gen};export{m as UIDFork,c as uid,_ as useUID,g as useUIDSeed};
var y=function(){var e=1,n=new WeakMap,t=function(r,o){return typeof r=="number"||typeof r=="string"?o?"idx-"+o:"val-"+r:n.has(r)?"uid"+n.get(r):(n.set(r,e++),t(r))};return t},b=y();import{createElement as s}from"react";import{createContext as w}from"react";var c=function(e){return e===void 0&&(e=""),{value:1,prefix:e,uid:y()}},i=c(),a=w(c()),f=function(e){return e.value++},l=function(e){return e?e.prefix:""};var v=function(e,n){return v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var o in r)r.hasOwnProperty(o)&&(t[o]=r[o])},v(e,n)};function d(e,n){v(e,n);function t(){this.constructor=e}e.prototype=n===null?Object.create(n):(t.prototype=n.prototype,new t)}import{Component as g}from"react";var h=function(e,n,t){var r=n+e;return String(t?t(r):r)},x=function(e){d(n,e);function n(){var t=e!==null&&e.apply(this,arguments)||this;return t.state={quartz:t.props.idSource||i,prefix:l(t.props.idSource),id:f(t.props.idSource||i)},t.uid=function(r){return h(t.state.id+"-"+t.state.quartz.uid(r),t.state.prefix,t.props.name)},t}return n.prototype.render=function(){var t=this.props,r=t.children,o=t.name,u=this.state,p=u.id,_=u.prefix;return r(h(p,_,o),this.uid)},n}(g);var I=function(e){var n=e.children,t=e.prefix,r=t===void 0?"":t;return s(S,null,function(o){return s(a.Provider,{value:c(o+"-"+r)},n)})},S=function(e){var n=e.name,t=e.children;return s(a.Consumer,null,function(r){return s(x,{name:n,idSource:r,children:t})})};import{useContext as O,useState as P}from"react";var R=function(e){var n=e||i,t=l(n),r=f(n),o=t+r,u=function(p){return o+n.uid(p)};return{uid:o,gen:u}},m=function(){return P(R(O(a)))},D=function(){var e=m()[0].uid;return e},j=function(){var e=m()[0].gen;return e};export{I as UIDFork,b as uid,D as useUID,j as useUIDSeed};
/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */

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

"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),r=function(){var e=1,r=new WeakMap,t=function(n,u){return"number"==typeof n||"string"==typeof n?u?"idx-"+u:"val-"+n:r.has(n)?"uid"+r.get(n):(r.set(n,e++),t(n))};return t},t=r(),n=function(e){return void 0===e&&(e=""),{value:1,prefix:e,uid:r()}},u=n(),o=e.createContext(n()),i=function(e){return e.value++},c=function(e){return e?e.prefix:""},a=function(e,r){return(a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var t in r)r.hasOwnProperty(t)&&(e[t]=r[t])})(e,r)};var p=function(e,r,t){var n=r+e;return String(t?t(n):n)},s=function(e){function r(){var r=null!==e&&e.apply(this,arguments)||this;return r.state={quartz:r.props.idSource||u,prefix:c(r.props.idSource),id:i(r.props.idSource||u)},r.uid=function(e){return p(r.state.id+"-"+r.state.quartz.uid(e),r.state.prefix,r.props.name)},r}return function(e,r){function t(){this.constructor=e}a(e,r),e.prototype=null===r?Object.create(r):(t.prototype=r.prototype,new t)}(r,e),r.prototype.render=function(){var e=this.props,r=e.children,t=e.name,n=this.state,u=n.id,o=n.prefix;return r(p(u,o,t),this.uid)},r}(e.Component),f=function(r){var t=r.name,n=r.children;return e.createElement(o.Consumer,null,(function(r){return e.createElement(s,{name:t,idSource:r,children:n})}))},d=function(){if("production"!==process.env.NODE_ENV&&!("useContext"in e))throw new Error("Hooks API requires React 16.8+");return e.useState(function(e){var r=e||u,t=c(r)+i(r);return{uid:t,gen:function(e){return t+r.uid(e)}}}(e.useContext(o)))};exports.UIDFork=function(r){var t=r.children,u=r.prefix,i=void 0===u?"":u;return e.createElement(f,null,(function(r){return e.createElement(o.Provider,{value:n(r+"-"+i)},t)}))},exports.uid=t,exports.useUID=function(){return d()[0].uid},exports.useUIDSeed=function(){return d()[0].gen};
var P=Object.create,f=Object.defineProperty,R=Object.getPrototypeOf,D=Object.prototype.hasOwnProperty,j=Object.getOwnPropertyNames,U=Object.getOwnPropertyDescriptor;var m=e=>f(e,"__esModule",{value:!0});var E=(e,r)=>{m(e);for(var t in r)f(e,t,{get:r[t],enumerable:!0})},C=(e,r,t)=>{if(m(e),r&&typeof r=="object"||typeof r=="function")for(let n of j(r))!D.call(e,n)&&n!=="default"&&f(e,n,{get:()=>r[n],enumerable:!(t=U(r,n))||t.enumerable});return e},l=e=>e&&e.__esModule?e:C(f(e!=null?P(R(e)):{},"default",{value:e,enumerable:!0}),e);E(exports,{UIDFork:()=>A,uid:()=>T,useUID:()=>z,useUIDSeed:()=>G});var h=function(){var e=1,r=new WeakMap,t=function(n,o){return typeof n=="number"||typeof n=="string"?o?"idx-"+o:"val-"+n:r.has(n)?"uid"+r.get(n):(r.set(n,e++),t(n))};return t},T=h();var u=l(require("react"));var _=l(require("react"));var s=function(e){return e===void 0&&(e=""),{value:1,prefix:e,uid:h()}},i=s(),a=_.createContext(s()),p=function(e){return e.value++},y=function(e){return e?e.prefix:""};var x=function(e,r){return x=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var o in n)n.hasOwnProperty(o)&&(t[o]=n[o])},x(e,r)};function b(e,r){x(e,r);function t(){this.constructor=e}e.prototype=r===null?Object.create(r):(t.prototype=r.prototype,new t)}var w=l(require("react"));var g=function(e,r,t){var n=r+e;return String(t?t(n):n)},S=function(e){b(r,e);function r(){var t=e!==null&&e.apply(this,arguments)||this;return t.state={quartz:t.props.idSource||i,prefix:y(t.props.idSource),id:p(t.props.idSource||i)},t.uid=function(n){return g(t.state.id+"-"+t.state.quartz.uid(n),t.state.prefix,t.props.name)},t}return r.prototype.render=function(){var t=this.props,n=t.children,o=t.name,c=this.state,d=c.id,O=c.prefix;return n(g(d,O,o),this.uid)},r}(w.Component);var A=function(e){var r=e.children,t=e.prefix,n=t===void 0?"":t;return u.createElement(q,null,function(o){return u.createElement(a.Provider,{value:s(o+"-"+n)},r)})},q=function(e){var r=e.name,t=e.children;return u.createElement(a.Consumer,null,function(n){return u.createElement(S,{name:r,idSource:n,children:t})})};var v=l(require("react"));var F=function(e){var r=e||i,t=y(r),n=p(r),o=t+n,c=function(d){return o+r.uid(d)};return{uid:o,gen:c}},I=function(){return v.useState(F(v.useContext(a)))},z=function(){var e=I()[0].uid;return e},G=function(){var e=I()[0].gen;return e};
/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */

14

package.json
{
"name": "@twilio-paste/uid-library",
"version": "0.1.3",
"version": "0.2.0",
"category": "library",

@@ -21,7 +21,7 @@ "status": "beta",

"scripts": {
"build": "yarn clean && yarn compile",
"build:dev": "yarn clean && yarn compile:dev",
"clean": "rm -rf ./dist && rm -rf tsconfig.build.tsbuildinfo && rm -rf .rpt2_cache",
"compile": "rollup -c --environment NODE_ENV:production",
"compile:dev": "rollup -c --environment NODE_ENV:development"
"build": "yarn clean && NODE_ENV=production node build.js && tsc",
"build:js": "NODE_ENV=development node build.js",
"build:props": "typedoc --tsconfig ./tsconfig.json --json ./dist/prop-types.json",
"clean": "rm -rf ./dist",
"tsc": "tsc"
},

@@ -39,3 +39,3 @@ "dependencies": {

},
"gitHead": "c4163904aa7c0cd4b9c4b46ffc40fe4d0db7cfb7"
"gitHead": "1bc07961cc789a6631a75fb663d9d8f5935e3ae7"
}
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